From 425ba588a696db553eb2f025a03eed591e378e05 Mon Sep 17 00:00:00 2001 From: Florian Weikert Date: Thu, 30 Jun 2016 14:08:21 +0000 Subject: Skylark documentation update: callback functions have to list the required attributes as their parameters (instead of using an attribute map). -- MOS_MIGRATED_REVID=126298988 --- .../devtools/build/lib/rules/SkylarkRuleClassFunctions.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/google') 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 dcd9035b8f..400af91b50 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 @@ -214,9 +214,11 @@ public class SkylarkRuleClassFunctions { + "It is a dictionary mapping from string to a template name. " + "For example: {\"ext\": \"%{name}.ext\"}.
" + "The dictionary key becomes an attribute in ctx.outputs. " - // TODO(bazel-team): Make doc more clear, wrt late-bound attributes. - + "It may also be a function (which receives ctx.attr as argument) " - + "returning such a dictionary."), + + "Similar to computed dependency rule attributes, you can also specify the name of a " + + "function that returns the dictionary. This function can access all rule " + + "attributes that are listed as parameters in its function signature." + + "For example, outputs = _my_func with def _my_func(srcs, deps):" + + " has access to the attributes 'srcs' and 'deps' (if defined)."), @Param(name = "executable", type = Boolean.class, defaultValue = "False", doc = "whether this rule is marked as executable or not. If True, " + "there must be an action that generates ctx.outputs.executable."), -- cgit v1.2.3