Skip to content

Commit

Permalink
Propagate java_outputs in flavors of java_proto_library and inclu…
Browse files Browse the repository at this point in the history
…de `compileJdeps`.

PiperOrigin-RevId: 376700982
  • Loading branch information
kevin1e100 authored and copybara-github committed May 31, 2021
1 parent 1f52e9a commit f1b37b5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ void addProviders(ConfiguredAspect.Builder aspect) throws InterruptedException {
.setClassJar(outputJar)
.setCompileJar(compileTimeJar)
.addSourceJar(sourceJar)
.setCompileJdeps(
generatedCompilationArgsProvider
.getCompileTimeJavaDependencyArtifacts()
.getSingleton())
.build())
.build();
JavaSourceJarsProvider sourceJarsProvider =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public ConfiguredTarget create(final RuleContext ruleContext)
JavaSourceJarsProvider.merge(
ruleContext.getPrerequisites("deps", JavaSourceJarsProvider.class));

JavaRuleOutputJarsProvider outputJarsProvider =
JavaRuleOutputJarsProvider.merge(
ruleContext.getPrerequisites("deps", JavaRuleOutputJarsProvider.class));

NestedSetBuilder<Artifact> filesToBuild = NestedSetBuilder.stableOrder();

filesToBuild.addAll(sourceJarsProvider.getSourceJars());
Expand All @@ -85,7 +89,7 @@ public ConfiguredTarget create(final RuleContext ruleContext)
JavaInfo.Builder.create()
.addProvider(JavaCompilationArgsProvider.class, dependencyArgsProviders)
.addProvider(JavaSourceJarsProvider.class, sourceJarsProvider)
.addProvider(JavaRuleOutputJarsProvider.class, JavaRuleOutputJarsProvider.EMPTY)
.addProvider(JavaRuleOutputJarsProvider.class, outputJarsProvider)
.addProvider(
JavaCcInfoProvider.class, createCcLinkingInfo(ruleContext, ImmutableList.of()))
.setJavaConstraints(ImmutableList.of("android"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ void addProviders(ConfiguredAspect.Builder aspect) throws InterruptedException {
.setClassJar(outputJar)
.setCompileJar(compileTimeJar)
.addSourceJar(sourceJar)
.setCompileJdeps(
generatedCompilationArgsProvider
.getCompileTimeJavaDependencyArtifacts()
.getSingleton())
.build())
.build();
JavaSourceJarsProvider sourceJarsProvider =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public ConfiguredTarget create(final RuleContext ruleContext)
JavaSourceJarsProvider.merge(
ruleContext.getPrerequisites("deps", JavaSourceJarsProvider.class));

JavaRuleOutputJarsProvider outputJarsProvider =
JavaRuleOutputJarsProvider.merge(
ruleContext.getPrerequisites("deps", JavaRuleOutputJarsProvider.class));

NestedSetBuilder<Artifact> filesToBuild = NestedSetBuilder.stableOrder();

filesToBuild.addAll(sourceJarsProvider.getSourceJars());
Expand All @@ -80,7 +84,7 @@ public ConfiguredTarget create(final RuleContext ruleContext)
JavaInfo.Builder.create()
.addProvider(JavaCompilationArgsProvider.class, dependencyArgsProviders)
.addProvider(JavaSourceJarsProvider.class, sourceJarsProvider)
.addProvider(JavaRuleOutputJarsProvider.class, JavaRuleOutputJarsProvider.EMPTY);
.addProvider(JavaRuleOutputJarsProvider.class, outputJarsProvider);

RuleConfiguredTargetBuilder result =
new RuleConfiguredTargetBuilder(ruleContext)
Expand Down

0 comments on commit f1b37b5

Please sign in to comment.