Document `repo_mapping` for native repository rules
Progress toward
I manually verified this bootstrapped the new documentation for native repository rules using ./scripts/serve-docs.sh
RELNOTES: None.
@@ -16,6 +16,7 @@ package com.google.devtools.build.lib.rules.repository;
import static com.google.devtools.build.lib.packages.Attribute.attr;
import static com.google.devtools.build.lib.packages.Type.STRING;
+import static com.google.devtools.build.lib.packages.Type.STRING_DICT;
import com.google.devtools.build.lib.analysis.BaseRuleClasses.RootRule;
import com.google.devtools.build.lib.analysis.RuleDefinition;
@@ -43,6 +44,16 @@ public class WorkspaceBaseRule implements RuleDefinition {
attr("generator_location", STRING)
.undocumented("internal")
.nonconfigurable("internal attributes are non-configurable"))
+ /* <!-- #BLAZE_RULE($workspace_base_rule).ATTRIBUTE(repo_mapping) -->
+ A dictionary from local repository name to global repository name. This allows controls over
+ workspace dependency resolution for dependencies of this repository.
+
+ <p>For example, an entry <code>"@foo": "@bar"</code> declares that, for any time this
+ repository depends on <code>"@foo"</code> (such as a dependency on
+ <code>"@foo//some:target"</code>), it should actually resolve that dependency within
+ globally-declared <code>"@bar"</code> (<code>"@bar//some:target"</code>).
+ <!-- #END_BLAZE_RULE.ATTRIBUTE --> */
+ .add(attr("repo_mapping", STRING_DICT))
.build();
}
