Skip to content

Commit

Permalink
Include --system in Javac extra action protos
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 365514257
  • Loading branch information
cushon authored and copybara-github committed Mar 29, 2021
1 parent 1e7e519 commit facc7d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ static class JavaCompileExtraActionInfoSupplier
/** The list of bootclasspath entries to specify to javac. */
private final NestedSet<Artifact> bootclasspathEntries;

/** An argument to the javac >= 9 {@code --system} flag. */
@Nullable private final Artifact system;

/** The list of classpath entries to search for annotation processors. */
private final NestedSet<Artifact> processorPath;

Expand All @@ -98,6 +101,7 @@ static class JavaCompileExtraActionInfoSupplier
Artifact outputJar,
NestedSet<Artifact> classpathEntries,
NestedSet<Artifact> bootclasspathEntries,
@Nullable Artifact system,
NestedSet<Artifact> processorPath,
NestedSet<String> processorNames,
ImmutableList<Artifact> sourceJars,
Expand All @@ -106,6 +110,7 @@ static class JavaCompileExtraActionInfoSupplier
this.outputJar = outputJar;
this.classpathEntries = classpathEntries;
this.bootclasspathEntries = bootclasspathEntries;
this.system = system;
this.processorPath = processorPath;
this.processorNames = processorNames;
this.sourceJars = sourceJars;
Expand All @@ -125,6 +130,9 @@ public void extend(ExtraActionInfo.Builder builder, ImmutableList<String> argume
.addAllProcessor(processorNames.toList())
.addAllProcessorpath(Artifact.toExecPaths(processorPath.toList()))
.setOutputjar(outputJar.getExecPathString());
if (system != null) {
info.setSystem(system.getExecPathString());
}
info.addAllArgument(arguments);
builder.setExtension(JavaCompileInfo.javaCompileInfo, info.build());
}
Expand Down Expand Up @@ -218,6 +226,7 @@ public JavaCompileAction build() {
outputs.output(),
classpathEntries,
bootClassPath.bootclasspath(),
bootClassPath.system(),
plugins.processorClasspath(),
plugins.processorClasses(),
sourceJars,
Expand Down
1 change: 1 addition & 0 deletions src/main/protobuf/extra_actions_base.proto
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ message JavaCompileInfo {
repeated string processorpath = 7;
repeated string bootclasspath = 8;
repeated string argument = 9;
optional string system = 10;
}

// Provides access to data that is specific to python rules.
Expand Down

0 comments on commit facc7d5

Please sign in to comment.