forked from bazelbuild/intellij
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop depending on deprecated @local_jdk//:langtools for tools.jar.
This removes the warning when building `//java:fast_build_javac` and `//java:jdk_tools_lib`: ``` $ bazel build //java:jdk_tools_lib //java:fast_build_javac WARNING: /Users/jingwen/code/intellij/java/BUILD:178:1: in java_import rule //java:jdk_tools_jar: target '//java:jdk_tools_jar' depends on deprecated target '@local_jdk//:langtools': Don't depend on targets in the JDK workspace; use @bazel_tools//tools/jdk:current_java_runtime instead (see bazelbuild/bazel#5594) ``` PiperOrigin-RevId: 257387444
- Loading branch information
1 parent
8669d42
commit 64945bd
Showing
2 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package(default_visibility = ["//java:__subpackages__"]) | ||
|
||
# Getting tools.jar from @local_jdk//:langtools is deprecated. Instead, | ||
# copy tools.jar from @bazel_tools//tools_jdk:current_java_runtime. | ||
# https://github.com/bazelbuild/bazel/issues/5594 | ||
# https://stackoverflow.com/questions/53066974/how-can-i-use-the-jar-tool-with-bazel-v0-19 | ||
genrule( | ||
name = "jdk_tools_jar", | ||
outs = ["tools.jar"], | ||
cmd = "cp $(JAVABASE)/lib/tools.jar $@", | ||
toolchains = ["@bazel_tools//tools/jdk:current_java_runtime"], | ||
tools = ["@bazel_tools//tools/jdk:current_java_runtime"], | ||
) | ||
|
||
java_import( | ||
name = "langtools", | ||
jars = [":tools.jar"], | ||
) |