diff options
Diffstat (limited to 'src/main')
5 files changed, 15 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AbstractConfiguredTarget.java b/src/main/java/com/google/devtools/build/lib/analysis/AbstractConfiguredTarget.java index acaa4a8db6..cb7daee618 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AbstractConfiguredTarget.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AbstractConfiguredTarget.java @@ -186,6 +186,9 @@ public abstract class AbstractConfiguredTarget if (providerKey.equals(DefaultProvider.SKYLARK_CONSTRUCTOR.getKey())) { return getDefaultProvider(); } + if (providerKey.equals(OutputGroupProvider.SKYLARK_CONSTRUCTOR.getKey())) { + return OutputGroupProvider.get(this); + } SkylarkProviders skylarkProviders = getProvider(SkylarkProviders.class); if (skylarkProviders != null) { return skylarkProviders.getDeclaredProvider(providerKey); diff --git a/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java b/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java index 2c0fcfb178..bff4b1cd2c 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java @@ -112,6 +112,9 @@ public final class MergedConfiguredTarget extends AbstractConfiguredTarget { getAllProviders(base, aspects, ExtraActionArtifactsProvider.class)); TransitiveInfoProviderMap.Builder aspectProviders = TransitiveInfoProviderMap.builder(); + if (mergedOutputGroupProvider != null) { + aspectProviders.add(mergedOutputGroupProvider); + } if (mergedSkylarkProviders != null) { aspectProviders.add(mergedSkylarkProviders); } @@ -123,7 +126,8 @@ public final class MergedConfiguredTarget extends AbstractConfiguredTarget { for (Map.Entry<Class<? extends TransitiveInfoProvider>, TransitiveInfoProvider> entry : aspect.getProviders().entrySet()) { Class<? extends TransitiveInfoProvider> providerClass = entry.getKey(); - if (SkylarkProviders.class.equals(providerClass) + if (OutputGroupProvider.class.equals(providerClass) + || SkylarkProviders.class.equals(providerClass) || ExtraActionArtifactsProvider.class.equals(providerClass)) { continue; } diff --git a/src/main/java/com/google/devtools/build/lib/analysis/OutputGroupProvider.java b/src/main/java/com/google/devtools/build/lib/analysis/OutputGroupProvider.java index 397d7fdd1b..0606a1fda4 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/OutputGroupProvider.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/OutputGroupProvider.java @@ -58,7 +58,7 @@ import javax.annotation.Nullable; */ @Immutable public final class OutputGroupProvider extends SkylarkClassObject - implements SkylarkIndexable, Iterable<String> { + implements TransitiveInfoProvider, SkylarkIndexable, Iterable<String> { public static final String SKYLARK_NAME = "output_groups"; public static NativeClassObjectConstructor SKYLARK_CONSTRUCTOR = new Constructor(); @@ -127,7 +127,7 @@ public final class OutputGroupProvider extends SkylarkClassObject @Nullable public static OutputGroupProvider get(TransitiveInfoCollection collection) { - return (OutputGroupProvider) collection.get(SKYLARK_CONSTRUCTOR.getKey()); + return (OutputGroupProvider) collection.getProvider(OutputGroupProvider.class); } @Nullable diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java index bdf8e10543..16baad7e4c 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java @@ -131,7 +131,7 @@ public final class RuleConfiguredTargetBuilder { } OutputGroupProvider outputGroupProvider = new OutputGroupProvider(outputGroups.build()); - addNativeDeclaredProvider(outputGroupProvider); + addProvider(OutputGroupProvider.class, outputGroupProvider); addSkylarkTransitiveInfo(OutputGroupProvider.SKYLARK_NAME, outputGroupProvider); } diff --git a/src/main/java/com/google/devtools/build/lib/analysis/SkylarkProviders.java b/src/main/java/com/google/devtools/build/lib/analysis/SkylarkProviders.java index 0778ade163..99a4534ae9 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/SkylarkProviders.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/SkylarkProviders.java @@ -164,7 +164,10 @@ public final class SkylarkProviders implements TransitiveInfoProvider { throw new DuplicateException("Provider " + key + " provided twice"); } - resultBuilder.put(key, map.get(key)); + V v = map.get(key); + if (v != null) { + resultBuilder.put(key, v); + } } } return resultBuilder.build(); |