aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoogler <hvd@google.com>2023-05-25 07:48:30 -0700
committerCopybara-Service <copybara-worker@google.com>2023-05-25 07:49:01 -0700
commit72f72324fe4d7002f24027ddcca040bb11d6b296 (patch)
tree6ec713835a45f36e72641675a74cc2de8129ea14
parent730e5b5dc284640d363233b4fe8ec1fcd84b0f96 (diff)
downloadbazelbuild-rules_java-72f72324fe4d7002f24027ddcca040bb11d6b296.tar.gz
Fix `rules_java` import/export setup
PiperOrigin-RevId: 535255881 Change-Id: I191446e4a988b4e49782b03d2b47815f669af665
-rw-r--r--distro/BUILD.bazel2
-rw-r--r--examples/hello_world/BUILD4
-rw-r--r--examples/hello_world/com/google/HelloWorld.java (renamed from examples/hello_world/HelloWorld.java)4
-rw-r--r--toolchains/BUILD5
-rw-r--r--toolchains/default_java_toolchain.bzl2
-rw-r--r--toolchains/local_java_repository.bzl2
6 files changed, 12 insertions, 7 deletions
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 @@ load("//java:defs.bzl", "java_binary")
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
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 @@ load(
"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 @@ cc_library(
"@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):