diff options
author | 2016-02-17 16:13:46 +0000 | |
---|---|---|
committer | 2016-02-17 19:38:20 +0000 | |
commit | ab049e0e35e7f4dd8b9ea8280e888f20d6cb84a9 (patch) | |
tree | 13db67e64effad59e1f1a68fdc6056358fb57243 /src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java | |
parent | 3157412cf6839b1890d6fa5b801753ca3118555d (diff) |
Reinstate mutable maps, again.
--
MOS_MIGRATED_REVID=114860576
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java index 377652bf41..d9ce457863 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java @@ -70,6 +70,7 @@ import com.google.devtools.build.lib.packages.SkylarkAspectClass; import com.google.devtools.build.lib.packages.TargetUtils; import com.google.devtools.build.lib.packages.TestSize; import com.google.devtools.build.lib.rules.SkylarkAttr.Descriptor; +import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; import com.google.devtools.build.lib.skylarkinterface.SkylarkSignature; import com.google.devtools.build.lib.skylarkinterface.SkylarkSignature.Param; import com.google.devtools.build.lib.skylarkinterface.SkylarkValue; @@ -86,6 +87,7 @@ import com.google.devtools.build.lib.syntax.FunctionSignature; import com.google.devtools.build.lib.syntax.Printer; import com.google.devtools.build.lib.syntax.Runtime; import com.google.devtools.build.lib.syntax.SkylarkCallbackFunction; +import com.google.devtools.build.lib.syntax.SkylarkDict; import com.google.devtools.build.lib.syntax.SkylarkList; import com.google.devtools.build.lib.syntax.SkylarkNestedSet; import com.google.devtools.build.lib.syntax.SkylarkSignatureProcessor; @@ -269,7 +271,8 @@ public class SkylarkRuleClassFunctions { doc = "Whether this rule is a test rule. " + "If True, the rule must end with <code>_test</code> (otherwise it must not), " + "and there must be an action that generates <code>ctx.outputs.executable</code>."), - @Param(name = "attrs", type = Map.class, noneable = true, defaultValue = "None", doc = + @Param(name = "attrs", type = SkylarkDict.class, noneable = true, defaultValue = "None", + doc = "dictionary to declare all the attributes of the rule. It maps from an attribute name " + "to an attribute object (see <a href=\"attr.html\">attr</a> module). " + "Attributes starting with <code>_</code> are private, and can be used to add " @@ -278,7 +281,7 @@ public class SkylarkRuleClassFunctions { + "<code>deprecation</code>, <code>tags</code>, <code>testonly</code>, and " + "<code>features</code> are implicitly added and might be overriden."), // TODO(bazel-team): need to give the types of these builtin attributes - @Param(name = "outputs", type = Map.class, callbackEnabled = true, noneable = true, + @Param(name = "outputs", type = SkylarkDict.class, callbackEnabled = true, noneable = true, defaultValue = "None", doc = "outputs of this rule. " + "It is a dictionary mapping from string to a template name. " + "For example: <code>{\"ext\": \"%{name}.ext\"}</code>. <br>" @@ -407,7 +410,7 @@ public class SkylarkRuleClassFunctions { doc = "List of attribute names. The aspect propagates along dependencies specified by " + " attributes of a target with this name" ), - @Param(name = "attrs", type = Map.class, noneable = true, defaultValue = "None", + @Param(name = "attrs", type = SkylarkDict.class, noneable = true, defaultValue = "None", doc = "dictionary to declare all the attributes of the aspect. " + "It maps from an attribute name to an attribute object " + "(see <a href=\"attr.html\">attr</a> module). " @@ -751,6 +754,7 @@ public class SkylarkRuleClassFunctions { /** * A Skylark value that is a result of 'aspect(..)' function call. */ + @SkylarkModule(name = "aspect", doc = "", documented = false) public static final class SkylarkAspect implements SkylarkValue { private final BaseFunction implementation; private final ImmutableList<String> attributeAspects; @@ -893,10 +897,12 @@ public class SkylarkRuleClassFunctions { return aspectDefinition; } + @Override public Label getExtensionLabel() { return extensionLabel; } + @Override public String getExportedName() { return exportedName; } |