diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java index d11345aa804816..7c6ef5996dd92b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java @@ -113,11 +113,6 @@ public final class JavaCompileAction extends SpawnAction { */ private final ImmutableList processorNames; - /** - * The list of custom javac flags to pass to annotation processors. - */ - private final ImmutableList processorFlags; - /** Set of additional Java source files to compile. */ private final ImmutableList sourceJars; @@ -158,7 +153,6 @@ public final class JavaCompileAction extends SpawnAction { * @param extdirInputs the compile-time extclasspath entries * @param processorPath the classpath to search for annotation processors * @param processorNames the annotation processors to run - * @param processorFlags custom annotation processor flags to pass to javac * @param sourceJars jars of sources to compile * @param sourceFiles source files to compile * @param javacOpts the javac options for the compilation @@ -183,7 +177,6 @@ private JavaCompileAction( ImmutableList extdirInputs, NestedSet processorPath, List processorNames, - List processorFlags, Collection sourceJars, ImmutableSet sourceFiles, List javacOpts, @@ -218,7 +211,6 @@ private JavaCompileAction( this.extdirInputs = extdirInputs; this.processorPath = processorPath; this.processorNames = ImmutableList.copyOf(processorNames); - this.processorFlags = ImmutableList.copyOf(processorFlags); this.sourceJars = ImmutableList.copyOf(sourceJars); this.sourceFiles = sourceFiles; this.javacOpts = ImmutableList.copyOf(javacOpts); @@ -308,10 +300,6 @@ public List getProcessorNames() { return processorNames; } - private List getProcessorFlags() { - return processorFlags; - } - /** * Returns the output jar artifact that gets generated by archiving the results of the Java * compilation. @@ -520,6 +508,7 @@ public static class Builder { private PathFragment classDirectory; private NestedSet processorPath = NestedSetBuilder.emptySet(Order.NAIVE_LINK_ORDER); private final List processorNames = new ArrayList<>(); + /** The list of custom javac flags to pass to annotation processors. */ private final List processorFlags = new ArrayList<>(); private String ruleKind; private Label targetLabel; @@ -582,8 +571,6 @@ public JavaCompileAction build() { } Preconditions.checkState(javaExecutable != null, owner); - Preconditions.checkState(javaExecutable.isAbsolute() ^ !javabaseInputs.isEmpty(), - javaExecutable); ImmutableList.Builder outputsBuilder = ImmutableList.builder() .addAll( @@ -655,7 +642,6 @@ public JavaCompileAction build() { extdirInputs, processorPath, processorNames, - processorFlags, sourceJars, sourceFiles, internedJcopts, diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JvmConfigurationLoader.java b/src/main/java/com/google/devtools/build/lib/rules/java/JvmConfigurationLoader.java index 4006bc872fb810..0af25147e60d33 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JvmConfigurationLoader.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JvmConfigurationLoader.java @@ -35,6 +35,7 @@ import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.syntax.Type; import com.google.devtools.build.lib.vfs.PathFragment; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -127,6 +128,14 @@ private static Jvm createFromRuntimeSuite( PathFragment javaHomePath = defaultJavaHome(javaRuntimeLabel); if (attributes.isAttributeValueExplicitlySpecified("java_home")) { javaHomePath = javaHomePath.getRelative(attributes.get("java_home", Type.STRING)); + List