diff options
Diffstat (limited to 'src')
3 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java index 052e0c170f..43887e6b41 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java @@ -904,7 +904,7 @@ public final class AndroidRuleClasses { .allowedFileTypes() .nonconfigurable("defines an aspect of configuration") .mandatoryProviders( - ImmutableList.of(ConfigFeatureFlagProvider.SKYLARK_CONSTRUCTOR.id()))) + ImmutableList.of(ConfigFeatureFlagProvider.id()))) // The resource extractor is used at the binary level to extract java resources from the // deploy jar so that they can be added to the APK. .add( diff --git a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagProvider.java b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagProvider.java index e076f1e9db..0481714ef4 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagProvider.java @@ -20,6 +20,7 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.packages.NativeClassObjectConstructor; import com.google.devtools.build.lib.packages.SkylarkClassObject; +import com.google.devtools.build.lib.packages.SkylarkProviderIdentifier; import com.google.devtools.build.lib.skylarkinterface.Param; import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; @@ -36,7 +37,7 @@ public class ConfigFeatureFlagProvider extends SkylarkClassObject { static final String SKYLARK_NAME = "FeatureFlagInfo"; /** Skylark constructor and identifier for ConfigFeatureFlagProvider. */ - public static final NativeClassObjectConstructor<ConfigFeatureFlagProvider> SKYLARK_CONSTRUCTOR = + static final NativeClassObjectConstructor<ConfigFeatureFlagProvider> SKYLARK_CONSTRUCTOR = new NativeClassObjectConstructor<ConfigFeatureFlagProvider>( ConfigFeatureFlagProvider.class, SKYLARK_NAME) {}; @@ -55,6 +56,10 @@ public class ConfigFeatureFlagProvider extends SkylarkClassObject { return new ConfigFeatureFlagProvider(value, isValidValue); } + public static SkylarkProviderIdentifier id() { + return SKYLARK_CONSTRUCTOR.id(); + } + /** Retrieves and casts the provider from the given target. */ public static ConfigFeatureFlagProvider fromTarget(TransitiveInfoCollection target) { return target.get(SKYLARK_CONSTRUCTOR); diff --git a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java index 4bd368415a..29ecacea1a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java @@ -154,7 +154,7 @@ public class ConfigRuleClasses { .undocumented("the feature flag feature has not yet been launched") .allowedFileTypes() .mandatoryProviders( - ImmutableList.of(ConfigFeatureFlagProvider.SKYLARK_CONSTRUCTOR.id())) + ImmutableList.of(ConfigFeatureFlagProvider.id())) .nonconfigurable(NONCONFIGURABLE_ATTRIBUTE_REASON)) .requiresConfigurationFragments(FeaturePolicyConfiguration.class) .setIsConfigMatcherForConfigSettingOnly() @@ -245,7 +245,7 @@ config_setting( @Override public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) { return builder - .setUndocumented(/* It's unusable as yet, as there are no ways to interact with it. */) + .setUndocumented(/* the feature flag feature has not yet been launched */) .requiresConfigurationFragments( ConfigFeatureFlagConfiguration.class, FeaturePolicyConfiguration.class) |