Skip to content

Commit

Permalink
Split Resource field initialization into multiple methods if needed.
Browse files Browse the repository at this point in the history
This uses a max worst case bytecode size for each field initializer, and
puts fields in a new method when the sum of the sizes starts to exceed
the max allowed Java bytecode size.

RELNOTES: n/a
PiperOrigin-RevId: 470096715
Change-Id: I99f07b552c152e97b665092ac9b853ffdc0cbcc8
  • Loading branch information
Googler authored and copybara-github committed Aug 25, 2022
1 parent b671079 commit be486b1
Show file tree
Hide file tree
Showing 105 changed files with 366 additions and 15 deletions.
2 changes: 2 additions & 0 deletions src/java_tools/buildjar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ load("@rules_java//java:defs.bzl", "java_binary")
# JavaBuilder and java tools used by Bazel
package(default_visibility = [":buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ load("//tools/build_rules:java_rules_skylark.bzl", "bootstrap_java_binary", "boo
# source code.
package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_library")

package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*.java"]) + ["BUILD"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*.java"]) + ["BUILD"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ load("//tools/build_rules:java_rules_skylark.bzl", "bootstrap_java_library")
# compile Java source code.
package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

java_library(
name = "plugins",
srcs = ["BlazeJavaCompilerPlugin.java"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0

java_library(
name = "statistics",
srcs = ["BlazeJavacStatistics.java"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ package(
default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"],
)

licenses(["notice"]) # Apache 2.0

# Exports the canonical javac bootclasspath artifact locations
genrule(
name = "javac-bootclasspath-locations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_binary")

package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

java_binary(
name = "turbine_direct_binary",
main_class = "com.google.turbine.main.Main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_test")

package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*.java"]) + [
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/dynamic/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/events/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/exec/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]) + [
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/exec/local/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/graph/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/metrics/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/network/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/packages/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/pkgcache/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/platform/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/profiler/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/query2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/remote/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]) + [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/remote/disk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/remote/http/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/remote/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package(
default_visibility = ["//src:__subpackages__"],
)

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["*"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/repository/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/devtools/build/lib/rules/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob(["**"]) + [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//src:__subpackages__"])

licenses(["notice"]) # Apache 2.0

filegroup(
name = "srcs",
srcs = glob([
Expand Down
Loading

0 comments on commit be486b1

Please sign in to comment.