aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGreg <gregestren@users.noreply.github.com>2019-08-23 14:52:24 -0400
committeraiuto <aiuto@google.com>2019-08-23 14:52:24 -0400
commit3f7b196d2a57194ef025e32509e5966d73c5ea15 (patch)
tree11a706fd000843c164a4846bdc6687e916105055 /docs
parentab87410a8bbfbe7306e21365d56461a20f5f4154 (diff)
downloadbazel-skylib-3f7b196d2a57194ef025e32509e5966d73c5ea15.tar.gz
Update selects documentation. (#170)
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/selects_doc.md107
1 files changed, 94 insertions, 13 deletions
diff --git a/docs/selects_doc.md b/docs/selects_doc.md
index e26ed4c..55711c9 100755
--- a/docs/selects_doc.md
+++ b/docs/selects_doc.md
@@ -1,3 +1,7 @@
+<!-- Generated with Stardoc: http://skydoc.bazel.build -->
+
+<a name="#selects.with_or"></a>
+
## selects.with_or
<pre>
@@ -6,6 +10,20 @@ selects.with_or(<a href="#selects.with_or-input_dict">input_dict</a>, <a href="#
Drop-in replacement for `select()` that supports ORed keys.
+Example:
+
+ ```build
+ deps = selects.with_or({
+ "//configs:one": [":dep1"],
+ ("//configs:two", "//configs:three"): [":dep2or3"],
+ "//configs:four": [":dep4"],
+ "//conditions:default": [":default"]
+ })
+ ```
+
+ Key labels may appear at most once anywhere in the input.
+
+
### Parameters
<table class="params-table">
@@ -32,19 +50,6 @@ Drop-in replacement for `select()` that supports ORed keys.
optional. default is <code>""</code>
<p>
Optional custom error to report if no condition matches.
-
- Example:
-
- ```build
- deps = selects.with_or({
- "//configs:one": [":dep1"],
- ("//configs:two", "//configs:three"): [":dep2or3"],
- "//configs:four": [":dep4"],
- "//conditions:default": [":default"]
- })
- ```
-
- Key labels may appear at most once anywhere in the input.
</p>
</td>
</tr>
@@ -52,6 +57,8 @@ Drop-in replacement for `select()` that supports ORed keys.
</table>
+<a name="#selects.with_or_dict"></a>
+
## selects.with_or_dict
<pre>
@@ -85,3 +92,77 @@ macros.
</table>
+<a name="#selects.config_setting_group"></a>
+
+## selects.config_setting_group
+
+<pre>
+selects.config_setting_group(<a href="#selects.config_setting_group-name">name</a>, <a href="#selects.config_setting_group-match_any">match_any</a>, <a href="#selects.config_setting_group-match_all">match_all</a>)
+</pre>
+
+Matches if all or any of its member `config_setting`s match.
+
+Example:
+
+ ```build
+ config_setting(name = "one", define_values = {"foo": "true"})
+ config_setting(name = "two", define_values = {"bar": "false"})
+ config_setting(name = "three", define_values = {"baz": "more_false"})
+
+ config_setting_group(
+ name = "one_two_three",
+ match_all = [":one", ":two", ":three"]
+ )
+
+ cc_binary(
+ name = "myapp",
+ srcs = ["myapp.cc"],
+ deps = select({
+ ":one_two_three": [":special_deps"],
+ "//conditions:default": [":default_deps"]
+ })
+ ```
+
+
+### Parameters
+
+<table class="params-table">
+ <colgroup>
+ <col class="col-param" />
+ <col class="col-description" />
+ </colgroup>
+ <tbody>
+ <tr id="selects.config_setting_group-name">
+ <td><code>name</code></td>
+ <td>
+ required.
+ <p>
+ The group's name. This is how `select()`s reference it.
+ </p>
+ </td>
+ </tr>
+ <tr id="selects.config_setting_group-match_any">
+ <td><code>match_any</code></td>
+ <td>
+ optional. default is <code>[]</code>
+ <p>
+ A list of `config_settings`. This group matches if *any* member
+ in the list matches. If this is set, `match_all` must not be set.
+ </p>
+ </td>
+ </tr>
+ <tr id="selects.config_setting_group-match_all">
+ <td><code>match_all</code></td>
+ <td>
+ optional. default is <code>[]</code>
+ <p>
+ A list of `config_settings`. This group matches if *every*
+ member in the list matches. If this is set, `match_any` must be not
+ set.
+ </p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+