Skip to content

Commit

Permalink
Set compile time classpath for Starlark java_binary for compilation_info
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 464293636
Change-Id: I78361c64f13192dcd6dfcc7019d7fef34be25471
  • Loading branch information
hvadehra authored and Copybara-Service committed Jul 30, 2022
1 parent 41d4ed0 commit 39125be
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,13 @@ public JavaInfo toJavaBinaryInfo(JavaInfo javaInfo, StarlarkThread thread) throw
if (javaInfo.getProvider(JavaCompilationInfoProvider.class) != null) {
builder.addProvider(JavaCompilationInfoProvider.class, javaInfo.getCompilationInfoProvider());
} else if (javaInfo.getProvider(JavaCompilationArgsProvider.class) != null) {
JavaCompilationArgsProvider compilationArgsProvider =
javaInfo.getProvider(JavaCompilationArgsProvider.class);
builder.addProvider(
JavaCompilationInfoProvider.class,
new JavaCompilationInfoProvider.Builder()
.setRuntimeClasspath(
javaInfo.getProvider(JavaCompilationArgsProvider.class).getRuntimeJars())
.setCompilationClasspath(compilationArgsProvider.getTransitiveCompileTimeJars())
.setRuntimeClasspath(compilationArgsProvider.getRuntimeJars())
.build());
}
if (javaInfo.getProvider(JavaGenJarsProvider.class) != null) {
Expand Down

0 comments on commit 39125be

Please sign in to comment.