Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ImportDepsChecker to a checked in deploy jar. #7140

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ JAVA_TOOLS = [
"//third_party/java/proguard:embedded_tools",
"//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper:srcs",
"//src/tools/singlejar:embedded_tools",
"//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:embedded_tools",
"//third_party/ijar",
"//third_party/ijar:zipper",
"//third_party/ijar:embedded_tools",
Expand Down
2 changes: 2 additions & 0 deletions src/create_embedded_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
('*tools/cpp/runfiles/generated_*',
lambda x: 'tools/cpp/runfiles/' + os.path.basename(x)[len('generated_'):]),
('*JavaBuilder*_deploy.jar', lambda x: 'tools/jdk/' + os.path.basename(x)),
('*ImportDepsChecker_deploy.jar',
lambda x: 'tools/jdk/' + os.path.basename(x)),
('*JacocoCoverage*_deploy.jar',
lambda x: 'tools/jdk/JacocoCoverage_deploy.jar'),
('*turbine_deploy.jar', lambda x: 'tools/jdk/turbine_deploy.jar'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ filegroup(
srcs = glob(["**"]),
)

filegroup(
name = "embedded_tools",
srcs = [
"BUILD.tools",
":ImportDepsChecker_deploy.jar",
],
)

java_library(
name = "import_deps_checker",
srcs = glob(
Expand Down

This file was deleted.

Binary file not shown.
7 changes: 6 additions & 1 deletion third_party/java/java_tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To see how to update the tools run:

```
./third_party/java/java_tools/update_java_tools.sh help
third_party/java/java_tools/update_java_tools.sh help
```

The following tools were built with bazel 0.21.0 at commit 252c82cd135f1bcdadfc961c127895e9b2347b77
Expand All @@ -17,3 +17,8 @@ third_party/java/java_tools/JacocoCoverage_jarjar_deploy.jar
third_party/java/java_tools/turbine_deploy.jar
third_party/java/java_tools/turbine_direct_binary_deploy.jar
third_party/java/java_tools/SingleJar_deploy.jar

The following tools were built with bazel 0.21.0 at commit 7f97ed4df69c2d9358a063cc7bb310c615ff6496 by running:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it's nicer to build all the tools at the same commit, but it's OK to do that once all of them are moved to checked-in deploy jars.

$ third_party/java/java_tools/update_java_tools.sh ImportDepsChecker

third_party/java/java_tools/ImportDepsChecker_deploy.jar
7 changes: 4 additions & 3 deletions third_party/java/java_tools/update_java_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# by the Java rules in Bazel.
#
# For usage please run
# ~/third_party/java/java_tools/update_java_tools.sh help
# third_party/java/java_tools/update_java_tools.sh help

# Maps the java tool names to their associated bazel target.
declare -A tool_name_to_target=(["JavaBuilder"]="src/java_tools/buildjar:JavaBuilder_deploy.jar" \
Expand All @@ -15,13 +15,14 @@ declare -A tool_name_to_target=(["JavaBuilder"]="src/java_tools/buildjar:JavaBui
["JacocoCoverage"]="src/java_tools/junitrunner/java/com/google/testing/coverage:JacocoCoverage_jarjar_deploy.jar" \
["Turbine"]="src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac:turbine_deploy.jar" \
["TurbineDirect"]="src/java_tools/buildjar/java/com/google/devtools/build/java/turbine:turbine_direct_binary_deploy.jar" \
["SingleJar"]="src/java_tools/singlejar/java/com/google/devtools/build/singlejar:bazel-singlejar_deploy.jar")
["SingleJar"]="src/java_tools/singlejar/java/com/google/devtools/build/singlejar:bazel-singlejar_deploy.jar" \
["ImportDepsChecker"]="src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker_deploy.jar")

usage="This script updates the checked-in jars corresponding to the tools "\
"used by the Java rules in Bazel.

To update all the tools simultaneously run from your bazel workspace root:
~/third_party/java/java_tools/update_java_tools.sh
third_party/java/java_tools/update_java_tools.sh

To update only one or one subset of the tools run
third_party/java/java_tools/update_java_tools.sh tool_1 tool_2 ... tool_n
Expand Down
2 changes: 1 addition & 1 deletion tools/android/BUILD.tools
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sh_binary(

alias(
name = "aar_import_deps_checker",
actual = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker_embedded",
actual = "//tools/jdk:ImportDepsChecker_bin",
visibility = ["//visibility:public"]
)

Expand Down
20 changes: 20 additions & 0 deletions tools/jdk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,26 @@ java_import(
neverlink = 1,
)

java_import(
name = "ImportDepsChecker",
jars = ["//tools/jdk:ImportDepsChecker_deploy.jar"]
)

java_binary(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this is used only in Android code, but it looks like a useful Java tool, so move on.

name = "ImportDepsChecker_bin",
main_class = "com.google.devtools.build.importdeps.Main",
jvm_flags = [
# quiet warnings from com.google.protobuf.UnsafeUtil,
# see: https://github.com/google/protobuf/issues/3781
"-XX:+IgnoreUnrecognizedVMOptions",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/java.lang=ALL-UNNAMED",
],
runtime_deps = [
"//tools/jdk:ImportDepsChecker_deploy.jar"
],
)

alias(
name = "jre",
actual = "@local_jdk//:jre",
Expand Down