Skip to content

Commit

Permalink
[8.0.0] Wrap natively created JavaInfo instances for WORKSPACE mo…
Browse files Browse the repository at this point in the history
…de as well (#24454)

Manually verified this fixes `@rules_android`.

PiperOrigin-RevId: 699072317
Change-Id: I2b2a8c991f72ae132d998191350dc18f0cb097a5 (cherry picked from
commit d73753c)
  • Loading branch information
hvadehra authored Nov 22, 2024
1 parent 0cba5f5 commit 65a9cd0
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,34 @@ public JavaInfoProvider getProvider() {

static final class WorkspaceJavaInfo extends JavaInfo {

private WorkspaceJavaInfo(
JavaCcInfoProvider javaCcInfoProvider,
JavaCompilationArgsProvider javaCompilationArgsProvider,
JavaCompilationInfoProvider javaCompilationInfoProvider,
JavaGenJarsProvider javaGenJarsProvider,
JavaModuleFlagsProvider javaModuleFlagsProvider,
JavaPluginInfo javaPluginInfo,
JavaRuleOutputJarsProvider javaRuleOutputJarsProvider,
JavaSourceJarsProvider javaSourceJarsProvider,
ImmutableList<Artifact> directRuntimeJars,
boolean neverlink,
ImmutableList<String> javaConstraints,
Location creationLocation) {
super(
javaCcInfoProvider,
javaCompilationArgsProvider,
javaCompilationInfoProvider,
javaGenJarsProvider,
javaModuleFlagsProvider,
javaPluginInfo,
javaRuleOutputJarsProvider,
javaSourceJarsProvider,
directRuntimeJars,
neverlink,
javaConstraints,
creationLocation);
}

private WorkspaceJavaInfo(StructImpl javaInfo)
throws EvalException, TypeException, RuleErrorException {
super(javaInfo);
Expand Down Expand Up @@ -764,6 +792,20 @@ public JavaInfo build() {
neverlink,
javaConstraints,
creationLocation);
} else if (provider.getKey().equals(WORKSPACE_PROVIDER.getKey())) {
return new WorkspaceJavaInfo(
/* javaCcInfoProvider= */ null,
providerJavaCompilationArgs,
providerJavaCompilationInfo,
/* javaGenJarsProvider= */ null,
/* javaModuleFlagsProvider= */ null,
/* javaPluginInfo= */ null,
providerJavaRuleOutputJars,
providerJavaSourceJars,
runtimeJars,
neverlink,
javaConstraints,
creationLocation);
} else {
return new JavaInfo(
/* javaCcInfoProvider= */ null,
Expand Down

0 comments on commit 65a9cd0

Please sign in to comment.