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 71b8d545e0ed64..0047976e01c5eb 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 @@ -285,6 +285,13 @@ public RuleConfiguredTargetBuilder addSkylarkTransitiveInfo( return this; } + /** + * Adds a "declared provider" defined in Skylark to the rule. + * Use this method for declared providers defined in Skyark. + * + * Use {@link #addNativeDeclaredProvider(SkylarkClassObject)} in definitions of + * native rules. + */ public RuleConfiguredTargetBuilder addSkylarkDeclaredProvider( SkylarkClassObject provider, Location loc) throws EvalException { SkylarkClassObjectConstructor constructor = provider.getConstructor(); @@ -298,6 +305,13 @@ public RuleConfiguredTargetBuilder addSkylarkDeclaredProvider( return this; } + /** + * Adds a "declared provider" defined in native code to the rule. + * Use this method for declared providers in definitions of native rules. + * + * Use {@link #addSkylarkDeclaredProvider(SkylarkClassObject, Location)} + * for Skylark rule implementations. + */ public RuleConfiguredTargetBuilder addNativeDeclaredProvider(SkylarkClassObject provider) { SkylarkClassObjectConstructor constructor = provider.getConstructor(); Preconditions.checkState(constructor.isExported());