diff options
author | 2016-06-30 14:08:21 +0000 | |
---|---|---|
committer | 2016-07-01 07:07:59 +0000 | |
commit | 425ba588a696db553eb2f025a03eed591e378e05 (patch) | |
tree | d103ae91360a5ccfd52b46cf94c1204b3c7053cc /src | |
parent | f6c24decc9cea46bfba41efb07f11b1ce7415cd0 (diff) |
Skylark documentation update: callback functions have to list the required attributes as their parameters (instead of using an attribute map).
--
MOS_MIGRATED_REVID=126298988
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java | 8 |
1 files changed, 5 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 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: <code>{\"ext\": \"%{name}.ext\"}</code>. <br>" + "The dictionary key becomes an attribute in <code>ctx.outputs</code>. " - // TODO(bazel-team): Make doc more clear, wrt late-bound attributes. - + "It may also be a function (which receives <code>ctx.attr</code> 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, <code>outputs = _my_func<code> with <code>def _my_func(srcs, deps):" + + "</code> 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 <code>ctx.outputs.executable</code>."), |