diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java | 29 |
1 files changed, 9 insertions, 20 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 95e83c1086..95ff93b0be 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 @@ -43,7 +43,6 @@ import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.actions.CommandLine; import com.google.devtools.build.lib.analysis.actions.CustomCommandLine; import com.google.devtools.build.lib.analysis.actions.CustomCommandLine.CustomMultiArgv; -import com.google.devtools.build.lib.analysis.actions.LazyWriteExecPathsFileAction; import com.google.devtools.build.lib.analysis.actions.ParameterFileWriteAction; import com.google.devtools.build.lib.analysis.actions.SpawnAction; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; @@ -482,7 +481,7 @@ public final class JavaCompileAction extends SpawnAction { private Artifact outputDepsProto; private Collection<Artifact> additionalOutputs; private Artifact paramFile; - private Artifact fileWithPathsForCoverage; + private Artifact metadata; private ImmutableSet<Artifact> sourceFiles = ImmutableSet.of(); private final Collection<Artifact> sourceJars = new ArrayList<>(); private BuildConfiguration.StrictDepsMode strictJavaDeps = @@ -576,6 +575,7 @@ public final class JavaCompileAction extends SpawnAction { .addAll( new ArrayList<>(Collections2.filter(Arrays.asList( outputJar, + metadata, gensrcOutputJar, manifestProtoOutput, outputDepsProto), Predicates.notNull()))); @@ -598,11 +598,6 @@ public final class JavaCompileAction extends SpawnAction { semantics.getJavaBuilderMainClass(), pathSeparator); - if (fileWithPathsForCoverage != null) { - analysisEnvironment.registerAction( - new LazyWriteExecPathsFileAction(owner, fileWithPathsForCoverage, sourceFiles)); - } - // The actual params-file-based command line executed for a compile action. CommandLine javaBuilderCommandLine = CustomCommandLine.builder() .add(spawnCommandLineBase) @@ -617,7 +612,7 @@ public final class JavaCompileAction extends SpawnAction { .addAll(instrumentationJars) .build(); - NestedSetBuilder<Artifact> inputsBuilder = + NestedSet<Artifact> inputs = NestedSetBuilder.<Artifact>stableOrder() .addTransitive(classpathEntries) .addTransitive(compileTimeDependencyArtifacts) @@ -629,12 +624,8 @@ public final class JavaCompileAction extends SpawnAction { .addAll(sourcePathEntries) .addAll(extdirInputs) .add(paramFile) - .addTransitive(tools); - if (fileWithPathsForCoverage != null) { - inputsBuilder.add(fileWithPathsForCoverage); - } - - NestedSet<Artifact> inputs = inputsBuilder.build(); + .addTransitive(tools) + .build(); return new JavaCompileAction( owner, @@ -753,9 +744,9 @@ public final class JavaCompileAction extends SpawnAction { } } } - if (fileWithPathsForCoverage != null) { + if (metadata != null) { result.add("--post_processor"); - result.addExecPath(JACOCO_INSTRUMENTATION_PROCESSOR, fileWithPathsForCoverage); + result.addExecPath(JACOCO_INSTRUMENTATION_PROCESSOR, metadata); result.addPath( configuration .getCoverageMetadataDirectory(targetLabel.getPackageIdentifier().getRepository()) @@ -865,8 +856,8 @@ public final class JavaCompileAction extends SpawnAction { return this; } - public Builder setFileWithPathsForCoverage(Artifact fileWithExecPathsForCoverage) { - this.fileWithPathsForCoverage = fileWithExecPathsForCoverage; + public Builder setMetadata(Artifact metadata) { + this.metadata = metadata; return this; } @@ -1012,5 +1003,3 @@ public final class JavaCompileAction extends SpawnAction { } } } - - |