diff options
author | cushon <cushon@google.com> | 2018-08-08 08:42:10 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-08 08:43:53 -0700 |
commit | c56699db5f9173739ba3ac55aa9fa69b6457a99b (patch) | |
tree | 3590eebf1ccbd1c0235cf5bc81bd9493fab04b54 /tools/android | |
parent | 366da4cf27b7f957ef39f89206db77fa2ac289df (diff) |
'DumpPlatformClasspath' now dumps the current JDK's default platform classpath
instead of indirecting through javac's bootclasspath handling and attempting
to pin to a particular source version. This is a stop-gap until we can just
use javac's --release flag.
Using the output of DumpPlatformClasspath as the bootclasspath for the default
java_toolchain side-steps issues with @local_jdk (see #5744, #5594).
PiperOrigin-RevId: 207890272
Diffstat (limited to 'tools/android')
-rw-r--r-- | tools/android/BUILD.tools | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/tools/android/BUILD.tools b/tools/android/BUILD.tools index fa2e4e938f..41961f4a72 100644 --- a/tools/android/BUILD.tools +++ b/tools/android/BUILD.tools @@ -97,18 +97,13 @@ java_binary( ) gen_java_lang_extras_jar_cmd = """ - for jar in $(locations @local_jdk//:bootclasspath); do - if [[ "$${jar}" == *"/rt.jar" ]]; then - $(location %s) \ - --exclude_build_data \ - --dont_change_compression \ - --sources $${jar} \ - --include_prefixes "java/lang/invoke/" \ - --include_prefixes "java/lang/annotation/" \ - --output $@ - break - fi - done + $(location %s) \ + --exclude_build_data \ + --dont_change_compression \ + --sources $(location @bazel_tools//tools/jdk:platformclasspath) \ + --include_prefixes "java/lang/invoke/" \ + --include_prefixes "java/lang/annotation/" \ + --output $@ """ # javac needs this Jar to compile lambdas, method references, and type annotations. @@ -116,7 +111,7 @@ gen_java_lang_extras_jar_cmd = """ genrule( name = "gen_java_lang_extras_jar", srcs = [ - "@local_jdk//:bootclasspath" + "@bazel_tools//tools/jdk:platformclasspath" ], tools = select({ "//src/conditions:windows": [":singlejar_javabin"], @@ -178,15 +173,10 @@ genrule( srcs = ["desugar_jdk_libs.jar"], outs = ["desugared_java8_legacy_libs.jar"], cmd = """ - classpath=() - for j in $(locations //tools/jdk:bootclasspath); do - classpath+=("--classpath_entry") - classpath+=("$${j}") - done $(location :desugar_java8) \ --input $< \ --output $@ \ - "$${classpath[@]}" \ + --classpath_entry "$(location @bazel_tools//tools/jdk:platformclasspath)" \ --core_library --allow_empty_bootclasspath \ --nobest_effort_tolerate_missing_deps \ --noemit_dependency_metadata_as_needed \ @@ -223,7 +213,7 @@ genrule( --dont_rewrite_core_library_invocation "java/util/Iterator#remove" """, tools = [ ":desugar_java8", - "//tools/jdk:bootclasspath", + "@bazel_tools//tools/jdk:platformclasspath", ], visibility = ["//visibility:private"], ) |