diff --git a/src/java_tools/buildjar/BUILD b/src/java_tools/buildjar/BUILD index bbd3c4f5a8c6bd..ab8aff6ab5c4df 100644 --- a/src/java_tools/buildjar/BUILD +++ b/src/java_tools/buildjar/BUILD @@ -1,6 +1,6 @@ # Description: # JavaBuilder and java tools used by Bazel -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [":buildjar_package_group"]) filegroup( name = "srcs", @@ -13,17 +13,28 @@ filegroup( "//src/java_tools/buildjar/javatests/com/google/devtools/build/java/bazel:srcs", "//src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine:srcs", ], + visibility = ["//:__subpackages__"], +) + +package_group( + name = "buildjar_package_group", + packages = [ + "//src/java_tools/buildjar/...", + "//src/tools/android/...", + ], ) java_binary( name = "JavaBuilder", main_class = "com.google.devtools.build.buildjar.BazelJavaBuilder", + visibility = ["//visibility:public"], runtime_deps = ["//src/java_tools/buildjar/java/com/google/devtools/build/buildjar"], ) java_binary( name = "VanillaJavaBuilder", main_class = "com.google.devtools.build.buildjar.VanillaJavaBuilder", + visibility = ["//visibility:public"], runtime_deps = ["//src/java_tools/buildjar/java/com/google/devtools/build/buildjar:vanilla_java_builder"], ) @@ -31,24 +42,31 @@ filegroup( name = "JavaBuilderDeploy", srcs = [":JavaBuilder_deploy.jar"], tags = ["manual"], + visibility = [ + ":buildjar_package_group", + "//src:__pkg__", + ], ) filegroup( name = "bootstrap_deploy.jar", srcs = ["//src/java_tools/buildjar/java/com/google/devtools/build/buildjar:bootstrap_deploy.jar"], tags = ["manual"], + visibility = ["//visibility:public"], ) filegroup( name = "bootstrap_VanillaJavaBuilder_deploy.jar", srcs = ["//src/java_tools/buildjar/java/com/google/devtools/build/buildjar:bootstrap_VanillaJavaBuilder_deploy.jar"], tags = ["manual"], + visibility = ["//visibility:public"], ) filegroup( name = "bootstrap_genclass_deploy.jar", srcs = ["//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:bootstrap_genclass_deploy.jar"], tags = ["manual"], + visibility = ["//visibility:public"], ) java_library( diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD index 5690a38298330b..f2223b9b7833d5 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD @@ -1,7 +1,7 @@ # Description: # The Java library builders, which are used by Bazel to compile Java # source code. -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) filegroup( name = "srcs", @@ -48,6 +48,10 @@ java_library( alias( name = "jarhelper", actual = "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper", + visibility = [ + "//src/java_tools/buildjar:buildjar_package_group", + "//src/tools/android:__subpackages__", + ], ) # Bazel's BuildJar @@ -64,6 +68,7 @@ java_library( "VanillaJavaBuilder.java", ], ), + visibility = ["//src/java_tools/buildjar:buildjar_package_group"], deps = [ ":JarOwner", ":invalid_command_line_exception", diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD index f981f56b36fd23..bd6e437f721883 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD @@ -1,4 +1,4 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) filegroup( name = "srcs", @@ -8,6 +8,11 @@ filegroup( java_binary( name = "GenClass", main_class = "com.google.devtools.build.buildjar.genclass.GenClass", + visibility = [ + "//src:__pkg__", + "//src/java_tools/buildjar:buildjar_package_group", + "//src/test/shell/bazel:__pkg__", + ], runtime_deps = [":genclass_lib"], ) diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD index 5939d3bd753396..2947261fefeb52 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD @@ -1,8 +1,12 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) filegroup( name = "srcs", srcs = glob(["*.java"]) + ["BUILD"], + visibility = [ + "//src:__pkg__", + "//src/java_tools/buildjar:buildjar_package_group", + ], ) java_library( diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD index ef40584c530d9d..cf8096bd0e2eaf 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD @@ -1,7 +1,7 @@ # Description: # Plugins for the Java library builders, which are used by Bazel to # compile Java source code. -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) java_library( name = "plugins", diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD index d0d01749683826..4816cd8216359a 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD @@ -4,7 +4,7 @@ # This is not the source code for javac itself. package( - default_visibility = ["//src:__subpackages__"], + default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"], ) load(":build_defs.bzl", "default_javacopts") @@ -26,6 +26,7 @@ java_library( ":javac-bootclasspath-locations", ], data = ["@bazel_tools//tools/jdk:bootclasspath"], + visibility = ["//visibility:public"], deps = ["//third_party:guava"], ) @@ -46,6 +47,7 @@ java_library( ":java-langtools-location", ], data = ["//third_party/java/jdk/langtools:javac_jar"], + visibility = ["//visibility:public"], ) # Exports javacopts from the current java toolchain @@ -62,6 +64,7 @@ java_library( "JavaBuilderConfig.java", "JavaBuilderJavacOpts.java", ], + visibility = ["//visibility:public"], deps = [ "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar:javac_options", "//third_party:guava", @@ -74,6 +77,7 @@ java_library( name = "BazelJavaCompiler", srcs = ["BazelJavaCompiler.java"], data = ["//third_party/java/jdk/langtools:javac_jar"], + visibility = ["//visibility:public"], deps = [ ":JavaBuilderConfig", ":JavaLangtools", @@ -87,6 +91,7 @@ java_library( java_library( name = "BazelJavac", srcs = ["BazelJavac.java"], + visibility = ["//visibility:public"], deps = [":BazelJavaCompiler"], ) @@ -95,6 +100,7 @@ java_binary( # Use same stack size as javac and JavaBuilder. jvm_flags = ["-Xss4m"], main_class = "com.google.devtools.build.java.bazel.BazelJavac", + visibility = ["//visibility:public"], runtime_deps = [":BazelJavac"], ) diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/BUILD index 55d65813eec1a9..f3cafee714cb32 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/BUILD @@ -1,8 +1,12 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) java_binary( name = "turbine", main_class = "com.google.devtools.build.java.turbine.Turbine", + visibility = [ + "//:__subpackages__", + "//src/java_tools/buildjar:buildjar_package_group", + ], runtime_deps = [":turbine_main"], ) diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/BUILD index 0738f614b38887..8391655d255552 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/BUILD @@ -1,4 +1,4 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) java_library( name = "javac_turbine", diff --git a/src/java_tools/buildjar/javatests/com/google/devtools/build/buildjar/BUILD b/src/java_tools/buildjar/javatests/com/google/devtools/build/buildjar/BUILD index 93672419109355..c680e4f12aaf3d 100644 --- a/src/java_tools/buildjar/javatests/com/google/devtools/build/buildjar/BUILD +++ b/src/java_tools/buildjar/javatests/com/google/devtools/build/buildjar/BUILD @@ -1,4 +1,4 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) filegroup( name = "srcs", diff --git a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/bazel/BUILD b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/bazel/BUILD index bb194f9b393ddd..5c59fe38f8c4f5 100644 --- a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/bazel/BUILD +++ b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/bazel/BUILD @@ -1,6 +1,6 @@ # Description: # Tests for tools for working with Java source code -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) java_test( name = "BazelJavaCompilerTest", diff --git a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/BUILD b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/BUILD index cf7c527f42a2d1..73cea18cae0907 100644 --- a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/BUILD +++ b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/BUILD @@ -1,4 +1,4 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) filegroup( name = "srcs", diff --git a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/javac/BUILD b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/javac/BUILD index a77f3a32fc8921..701f380d64e766 100644 --- a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/javac/BUILD +++ b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/javac/BUILD @@ -1,4 +1,4 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) java_library( name = "AbstractJavacTurbineCompilationTest", diff --git a/src/java_tools/junitrunner/BUILD b/src/java_tools/junitrunner/BUILD index 725f4d36dfe3db..b06806a3adbdcd 100644 --- a/src/java_tools/junitrunner/BUILD +++ b/src/java_tools/junitrunner/BUILD @@ -1,6 +1,6 @@ # Description: # Run JUnit tests in a controlled environment. -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//visibility:private"]) filegroup( name = "srcs", @@ -12,4 +12,10 @@ filegroup( "//src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner:srcs", "//src/java_tools/junitrunner/javatests/com/google/testing/junit/runner:srcs", ], + visibility = ["//:__subpackages__"], +) + +package_group( + name = "junitrunner_package_group", + packages = ["//src/java_tools/junitrunner/..."], ) diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD index 8ddeb9ffc0251e..dcd479334bbf79 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD @@ -3,7 +3,7 @@ package( default_testonly = 1, - default_visibility = ["//src:__subpackages__"], + default_visibility = ["//visibility:public"], ) # Libraries diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD index eaeb69a3fe0a1d..cb9dd224c927bf 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) filegroup( name = "common_runner_java_files", @@ -50,12 +52,20 @@ java_library( java_binary( name = "Runner", main_class = "com.google.testing.junit.runner.BazelTestRunner", + visibility = [ + "//src:__subpackages__", + "//src/java_tools/junitrunner:junitrunner_package_group", + ], runtime_deps = [":test_runner"], ) java_binary( name = "ExperimentalRunner", main_class = "com.google.testing.junit.runner.ExperimentalTestRunner", + visibility = [ + "//src:__pkg__", + "//src/java_tools/junitrunner:junitrunner_package_group", + ], runtime_deps = [":experimental_test_runner"], ) diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD index 8b35f547588995..ecbe811e466def 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) # Internal code for the JUnit runner that does not depend on JUnit 4. # Code used by the JUnit runner that does depend on JUnit 4 diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD index f7ff60f4393581..05c248c720dc0d 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) # JUnit4 test runner core code. java_library( diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD index c8501b5cd60d92..8395b149239d38 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) java_library( name = "model", diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD index 3f68bd22000ad9..72e5687e3d756c 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) # TODO(bazel-team): This should be testonly = 1. java_library( diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD index c63f78824eabf5..2fcd55a1b7d886 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) # TODO(bazel-team): This should be testonly = 1. java_library( diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD index c9027de4aa8f64..21ba2c0341442d 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) java_library( name = "testing", diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD index 2dc4d68d9eda3f..4d2ae59c7b90c6 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD @@ -1,8 +1,11 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) java_library( name = "util", srcs = glob(["*.java"]), + visibility = ["//visibility:public"], deps = [ "//third_party:jsr305", "//third_party:junit4", diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD b/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD index 8e593dd5feeb9c..d16775014e8915 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) filegroup( name = "srcs", diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD index 23604b6240a07e..0dca286284e59e 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) # Libraries # ========================================================= diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD index d5df0df0dd05a6..d7182eb4c6e5c5 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD @@ -1,4 +1,6 @@ -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", +]) java_library( name = "testbed", diff --git a/src/java_tools/singlejar/BUILD b/src/java_tools/singlejar/BUILD index f27e78e67c1653..332bb57457b680 100644 --- a/src/java_tools/singlejar/BUILD +++ b/src/java_tools/singlejar/BUILD @@ -1,7 +1,7 @@ # Description: # SingleJar combines multiple zip files and additional files # into a single zip file. -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools:__subpackages__"]) filegroup( name = "srcs", @@ -11,21 +11,30 @@ filegroup( "//src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar:srcs", "//src/java_tools/singlejar/javatests/com/google/devtools/build/zip:srcs", ], + visibility = ["//:__subpackages__"], +) + +package_group( + name = "singlejar_package_group", + packages = ["//src/java_tools/singlejar/..."], ) alias( name = "libSingleJar", actual = "//src/java_tools/singlejar/java/com/google/devtools/build/singlejar:libSingleJar", + visibility = ["//visibility:public"], ) alias( name = "SingleJar", actual = "//src/java_tools/singlejar/java/com/google/devtools/build/singlejar:bazel-singlejar", + visibility = ["//visibility:public"], ) alias( name = "SingleJar_deploy.jar", actual = "//src/java_tools/singlejar/java/com/google/devtools/build/singlejar:bazel-singlejar_deploy.jar", + visibility = ["//visibility:public"], ) alias( diff --git a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD index b57dd8064fd0d2..c74eb6e5b6552d 100644 --- a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD +++ b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD @@ -1,17 +1,7 @@ # Description: # SingleJar combines multiple zip files and additional files # into a single zip file. -package(default_visibility = ["//src:__subpackages__"]) - -package_group( - name = "packages", - packages = [ - "//java/com/google/devtools/build/singlejar", - "//javatests/com/google/devtools/build/singlejar", - "//src/java_tools/singlejar/java/com/google/devtools/build/singlejar", - "//src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar", - ], -) +package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) filegroup( name = "srcs", @@ -29,6 +19,7 @@ java_library( "ZipCombiner.java", "ZipEntryFilter.java", ], + visibility = ["//visibility:public"], deps = [ "//src/java_tools/singlejar/java/com/google/devtools/build/zip", "//third_party:jsr305", @@ -52,6 +43,10 @@ java_binary( name = "bazel-singlejar", srcs = glob(["*.java"]), main_class = "com.google.devtools.build.singlejar.SingleJar", + visibility = [ + "//:__subpackages__", + "//src/java_tools/singlejar:singlejar_package_group", + ], deps = [ "//src/java_tools/singlejar/java/com/google/devtools/build/zip", "//src/main/java/com/google/devtools/build/lib/shell", @@ -84,6 +79,7 @@ bootstrap_java_binary( ], main_class = "com.google.devtools.build.singlejar.SingleJar", tags = ["manual"], + visibility = ["//visibility:public"], deps = [ ":skylark-deps", "//src/main/java/com/google/devtools/build/lib/shell:shell-skylark", diff --git a/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD b/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD index 00292119c1a80c..4cadbdf110a464 100644 --- a/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD +++ b/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD @@ -2,15 +2,7 @@ # Zip provides a library for reading and writing zip files, allowing more # advanced manipulation than the JDK equivalents by providing detailed zip # entry data and raw file access. -package(default_visibility = ["//src:__subpackages__"]) - -package_group( - name = "packages", - packages = [ - "//src/java_tools/singlejar/java/com/google/devtools/build/zip", - "//src/java_tools/singlejar/javatests/com/google/devtools/build/zip", - ], -) +package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) filegroup( name = "srcs", @@ -26,5 +18,6 @@ filegroup( java_library( name = "zip", srcs = glob(["*.java"]), + visibility = ["//visibility:public"], deps = ["//third_party:jsr305"], ) diff --git a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD index e8ac3738a7fc9f..ce83ab01c57b35 100644 --- a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD +++ b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD @@ -1,6 +1,6 @@ # Description: # Tests for SingleJar -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) java_library( name = "libSingleJarTesting", diff --git a/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD b/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD index db24dd58382517..269df1d9ff0d25 100644 --- a/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD +++ b/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD @@ -1,6 +1,6 @@ # Description: # Tests for Zip -package(default_visibility = ["//src:__subpackages__"]) +package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) java_library( name = "zip_tests",