diff options
author | cushon <cushon@google.com> | 2018-08-07 09:45:11 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-07 09:46:55 -0700 |
commit | 08840382263f5c21f258c19fae15b9696bc0e86f (patch) | |
tree | 0abbb4c99cb2c747c0ab8a570ebf844ab25a7f6b /src/java_tools/buildjar | |
parent | e37dd1deda6a2d12886c456ffc072980eeb69677 (diff) |
Tolerate empty bootclasspaths in VanillaJavaBuilder
PiperOrigin-RevId: 207730551
Diffstat (limited to 'src/java_tools/buildjar')
-rw-r--r-- | src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java index 0064c894a6..c090709743 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java @@ -251,10 +251,13 @@ public class VanillaJavaBuilder implements Closeable { OptionsParser optionsParser, StandardJavaFileManager fileManager, Path nativeHeaderDir) throws IOException { fileManager.setLocation(StandardLocation.CLASS_PATH, toFiles(optionsParser.getClassPath())); - fileManager.setLocation( - StandardLocation.PLATFORM_CLASS_PATH, + Iterable<File> bootClassPath = Iterables.concat( - toFiles(optionsParser.getBootClassPath()), toFiles(optionsParser.getExtClassPath()))); + toFiles(optionsParser.getBootClassPath()), toFiles(optionsParser.getExtClassPath())); + // The bootclasspath may legitimately be empty if --release is being used. + if (!Iterables.isEmpty(bootClassPath)) { + fileManager.setLocation(StandardLocation.PLATFORM_CLASS_PATH, bootClassPath); + } fileManager.setLocation( StandardLocation.ANNOTATION_PROCESSOR_PATH, toFiles(optionsParser.getProcessorPath())); if (optionsParser.getSourceGenDir() != null) { |