Fix `rules_java` import/export setup PiperOrigin-RevId: 535255881 Change-Id: I191446e4a988b4e49782b03d2b47815f669af665
diff --git a/distro/BUILD.bazel b/distro/BUILD.bazel index 71352e8..d136ca1 100644 --- a/distro/BUILD.bazel +++ b/distro/BUILD.bazel
@@ -1,6 +1,6 @@ -load("@rules_java//java:defs.bzl", "version") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@rules_pkg//releasing:defs.bzl", "print_rel_notes") +load("//java:defs.bzl", "version") package( default_visibility = ["//visibility:private"],
diff --git a/examples/hello_world/BUILD b/examples/hello_world/BUILD index 96b2a5f..282e2d7 100644 --- a/examples/hello_world/BUILD +++ b/examples/hello_world/BUILD
@@ -2,6 +2,6 @@ java_binary( name = "hello_world", - srcs = ["HelloWorld.java"], - main_class = "HelloWorld", + srcs = ["com/google/HelloWorld.java"], + main_class = "com.google.HelloWorld", )
diff --git a/examples/hello_world/HelloWorld.java b/examples/hello_world/com/google/HelloWorld.java similarity index 93% rename from examples/hello_world/HelloWorld.java rename to examples/hello_world/com/google/HelloWorld.java index 20331e4..5104eb0 100644 --- a/examples/hello_world/HelloWorld.java +++ b/examples/hello_world/com/google/HelloWorld.java
@@ -11,8 +11,12 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +package com.google; public class HelloWorld { + + private HelloWorld() {} + public static void main (String[] args) { System.out.println("Hello World!\n"); }
diff --git a/toolchains/BUILD b/toolchains/BUILD index 09211a4..6ef4b62 100644 --- a/toolchains/BUILD +++ b/toolchains/BUILD
@@ -1,6 +1,6 @@ load("@rules_cc//cc:defs.bzl", "cc_library") load( - "//toolchains:default_java_toolchain.bzl", + ":default_java_toolchain.bzl", "DEFAULT_TOOLCHAIN_CONFIGURATION", "PREBUILT_TOOLCHAIN_CONFIGURATION", "bootclasspath", @@ -8,7 +8,7 @@ "java_runtime_files", ) load( - "//toolchains:java_toolchain_alias.bzl", + ":java_toolchain_alias.bzl", "java_host_runtime_alias", "java_runtime_alias", "java_runtime_version_alias", @@ -108,6 +108,7 @@ "@bazel_tools//src/conditions:windows": ["include/win32"], "//conditions:default": [], }), + tags = ["nobuilder"], ) [
diff --git a/toolchains/default_java_toolchain.bzl b/toolchains/default_java_toolchain.bzl index 919b327..9442c5e 100644 --- a/toolchains/default_java_toolchain.bzl +++ b/toolchains/default_java_toolchain.bzl
@@ -14,7 +14,7 @@ """Rules for defining default_java_toolchain""" -load("@rules_java//java:defs.bzl", "java_toolchain") +load("//java:defs.bzl", "java_toolchain") # JVM options, without patching java.compiler and jdk.compiler modules. BASE_JDK9_JVM_OPTS = [
diff --git a/toolchains/local_java_repository.bzl b/toolchains/local_java_repository.bzl index faaced5..7cba8f5 100644 --- a/toolchains/local_java_repository.bzl +++ b/toolchains/local_java_repository.bzl
@@ -14,7 +14,7 @@ """Rules for importing and registering a local JDK.""" -load("@rules_java//java:defs.bzl", "java_runtime") +load("//java:defs.bzl", "java_runtime") load(":default_java_toolchain.bzl", "default_java_toolchain") def _detect_java_version(repository_ctx, java_bin):