diff options
author | Googler <noreply@google.com> | 2015-02-12 15:50:36 +0000 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@google.com> | 2015-02-12 15:50:36 +0000 |
commit | 6bf0d27fef0a135e5f158c1b0b5ac0ba3ebc9303 (patch) | |
tree | c8e2af5768cabb4841d1386ffa1c0ddefa4348a5 | |
parent | 4a8b0500c3f5784851e8b8aaec4854cbed7e4996 (diff) |
JavaCompileAction uses a NestedSet for inputs. This way it doesn't flatten classpathEntries during the analysis phase.
Deprecated NestedSetBuilder.addAll(NestedSet) and Runfiles.Builder.addArtifacts(NestedSet) method calls are replaced with the proper methods in []. With the above changes ChainedRuleDependenciesTest passes for [].
--
MOS_MIGRATED_REVID=86179486
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java | 25 |
1 files changed, 17 insertions, 8 deletions
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 655270bcff..397fa18685 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 @@ -93,7 +93,7 @@ public class JavaCompileAction extends AbstractAction { /** * The list of classpath entries to specify to javac. */ - private final NestedSet<Artifact> classpath; + private final NestedSet<Artifact> classpathEntries; /** * The list of classpath entries to search for annotation processors. @@ -175,7 +175,7 @@ public class JavaCompileAction extends AbstractAction { CommandLine commandLine, PathFragment classDirectory, Artifact outputJar, - NestedSet<Artifact> classpath, + NestedSet<Artifact> classpathEntries, List<Artifact> processorPath, Artifact langtoolsJar, Artifact javaBuilderJar, @@ -190,17 +190,26 @@ public class JavaCompileAction extends AbstractAction { BuildConfiguration.StrictDepsMode strictJavaDeps, Collection<Artifact> compileTimeDependencyArtifacts, JavaSemantics semantics) { - super(owner, Iterables.concat(ImmutableList.of( - classpath, processorPath, messages, resources, - classpathResources, sourceJars, sourceFiles, compileTimeDependencyArtifacts, - ImmutableList.of(langtoolsJar, javaBuilderJar), baseInputs)), + super(owner, NestedSetBuilder.<Artifact>stableOrder() + .addTransitive(classpathEntries) + .addAll(processorPath) + .addAll(messages) + .addAll(resources) + .addAll(classpathResources) + .addAll(sourceJars) + .addAll(sourceFiles) + .addAll(compileTimeDependencyArtifacts) + .addAll(baseInputs) + .add(langtoolsJar) + .add(javaBuilderJar) + .build(), outputs); this.javaCompileCommandLine = javaCompileCommandLine; this.commandLine = commandLine; this.classDirectory = Preconditions.checkNotNull(classDirectory); this.outputJar = outputJar; - this.classpath = classpath; + this.classpathEntries = classpathEntries; this.processorPath = ImmutableList.copyOf(processorPath); this.processorNames = ImmutableList.copyOf(processorNames); this.messages = ImmutableList.copyOf(messages); @@ -237,7 +246,7 @@ public class JavaCompileAction extends AbstractAction { */ @VisibleForTesting public Iterable<Artifact> getClasspath() { - return classpath; + return classpathEntries; } /** |