aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2017-02-18 04:18:59 +0000
committerGravatar Irina Iancu <elenairina@google.com>2017-02-20 09:43:16 +0000
commit7bd3c81a05f97c6018bf6d1d4dfcd4e150f91407 (patch)
tree2ced1db6ec9883b465e8d83e27294ff0de6869ae /src/main/java/com/google/devtools/build/lib
parent1bf8ca380e61f476adc6afc6d5ee45671c861039 (diff)
Update doc wrt set vs depset.
-- PiperOrigin-RevId: 147908180 MOS_MIGRATED_REVID=147908180
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
index cff3298ce9..e7efcd301c 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
@@ -51,12 +51,12 @@ import javax.annotation.Nullable;
+ "tests, but on the contrary they support fast union. Depsets are designed to be used as "
+ "a collection of items (such as file names) generated by Bazel targets. "
+ "Depsets can be created using the <a href=\"globals.html#depset\">depset</a> function, "
- + "and they support the <code>|</code> operator to extend the depset with more elements or "
- + "to nest other depsets inside of it. Examples:<br>"
+ + "and they support the <code>+</code> operator to extend the depset with more elements or "
+ + "to nest other depsets inside of it (the <code>|</code> is equivalent). Examples:<br>"
+ "<pre class=language-python>s = depset([1, 2])\n"
- + "s = s | [3] # s == {1, 2, 3}\n"
- + "s = s | depset([4, 5]) # s == {1, 2, 3, {4, 5}}\n"
+ + "s = s + [3] # s == {1, 2, 3}\n"
+ + "s = s + depset([4, 5]) # s == {1, 2, 3, {4, 5}}\n"
+ "other = depset([\"a\", \"b\", \"c\"], order=\"postorder\")</pre>"
+ "Note that in these examples <code>{..}</code> is not a valid literal to create depsets. "
@@ -97,7 +97,9 @@ import javax.annotation.Nullable;
+ "<code>union()</code> if either both depsets have the same <code>order</code> or one of "
+ "the depsets has <code>stable</code> order. In the latter case the iteration order will "
+ "be determined by the outer depset, thus ignoring the <code>order</code> parameter of "
- + "nested depsets."
+ + "nested depsets.<br>"
+ + "The function <code>set</code> is a deprecated alias for <code>depset</code>. Please "
+ + "update legacy code and use only <code>depset</code>."
)
@Immutable
public final class SkylarkNestedSet implements SkylarkValue, SkylarkQueryable {