aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2015-09-12 18:39:54 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-09-14 15:39:20 +0000
commit15da9be94f3ff6771e38442f0bc8f1316faa4e47 (patch)
tree8bf519ae60601a18010791bce5547655b2505805 /src/main/java/com/google/devtools/build
parent361d2e2f7448038355b337ee4f7191a28c20755a (diff)
Clarify Skylark doc for ctx.files and ctx.file
-- MOS_MIGRATED_REVID=102921160
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
index d3909fbcf8..bd0f257d64 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
@@ -302,7 +302,9 @@ public final class SkylarkRuleContext {
+ "to the attribute names. The struct value is always a <code>file</code> or "
+ "<code>None</code>. If an optional attribute is not specified in the rule "
+ "then the corresponding struct value is <code>None</code>. If a label type is not "
- + "marked as <code>single_file=True</code>, no corresponding struct field is generated.")
+ + "marked as <code>single_file=True</code>, no corresponding struct field is generated. "
+ + "It is a shortcut for:"
+ + "<pre class=language-python>list(ctx.attr.<ATTR>.files)[0]</pre>")
public SkylarkClassObject getFile() {
return fileObject;
}
@@ -314,7 +316,9 @@ public final class SkylarkRuleContext {
doc = "A <code>struct</code> containing files defined in label or label list "
+ "type attributes. The struct fields correspond to the attribute names. The struct "
+ "values are <code>list</code> of <code>file</code>s. If an optional attribute is "
- + "not specified in the rule, an empty list is generated.")
+ + "not specified in the rule, an empty list is generated."
+ + "It is a shortcut for:"
+ + "<pre class=language-python>[f for t in ctx.attr.<ATTR> for f in t.files]</pre>")
public SkylarkClassObject getFiles() {
return filesObject;
}