diff --git a/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/MergedConfiguredTarget.java b/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/MergedConfiguredTarget.java index 3166048ca1739d..197b20659c588c 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/MergedConfiguredTarget.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/MergedConfiguredTarget.java @@ -273,7 +273,7 @@ public Dict getProvidersDict() { } @VisibleForTesting - public ConfiguredTarget getBaseConfiguredTargetForTesting() { + public ConfiguredTarget getBaseConfiguredTarget() { return base; } } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java index 86f82de2b70770..14239ce2a6e945 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java @@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.configuredtargets.AbstractConfiguredTarget; +import com.google.devtools.build.lib.analysis.configuredtargets.MergedConfiguredTarget; import com.google.devtools.build.lib.analysis.platform.ConstraintValueInfo; import com.google.devtools.build.lib.analysis.starlark.StarlarkActionFactory; import com.google.devtools.build.lib.analysis.starlark.StarlarkRuleContext; @@ -297,6 +298,9 @@ public ProviderApi getBootClassPathInfo() { @Override public String getTargetKind(Object target, StarlarkThread thread) throws EvalException { checkPrivateAccess(thread); + if (target instanceof MergedConfiguredTarget) { + target = ((MergedConfiguredTarget) target).getBaseConfiguredTarget(); + } if (target instanceof AbstractConfiguredTarget) { return ((AbstractConfiguredTarget) target).getRuleClassString(); }