aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLászló Csomor <laszlocsomor@users.noreply.github.com>2019-01-08 09:04:53 +0100
committerGitHub <noreply@github.com>2019-01-08 09:04:53 +0100
commit8d4f7612b264849b4b0d7961ab5532f6879d9239 (patch)
treee49160c5a44e656daac23055033175456e8304f7 /README.md
parent6dd0b9cbd67478e20361933a994ca01fc1758f43 (diff)
downloadbazel-skylib-8d4f7612b264849b4b0d7961ab5532f6879d9239.tar.gz
maprule: an improved version of genrule() (#86)
maprule() is an improved version of native.genrule(), with the following advantages: - Maprule can process source files in parallel, creating separate actions for each of them. - Maprule does not require declaring all output files. Instead you declare templates for the output files yielded for each source. Therefore N source files and M templates yield N*M outputs. - Maprule supports both Bash and cmd.exe syntax for its commands via the specialized rules bash_maprule and cmd_maprule. - Maprule's cmd attribute does deliberately not support $(location) expression nor Make Variables, in order to avoid issues and challenges with quoting. (In case of cmd.exe passing empty arguments is impossible). These paths can be passed as envvars instead. - Maprule's add_env attribute does support $(location) expressions (and some extra placeholders) and is the idiomatic way to pass execpaths of labels in "tools" or "srcs" (the shared sources available for all actions) to the command. See https://github.com/bazelbuild/bazel/issues/4319
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/README.md b/README.md
index 97a9e5f..fe7c869 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,8 @@ Each of the `.bzl` files in the `lib` directory defines a "module"&mdash;a
`struct` that contains a set of related functions and/or other symbols that can
be loaded as a single unit, for convenience.
+Skylib also provides build rules under the `rules` directory.
+
## Getting Started
### `WORKSPACE` file
@@ -68,6 +70,10 @@ s = shell.quote(p)
* [unittest](lib/unittest.bzl)
* [versions](lib/versions.bzl)
+## List of rules (in rules/)
+
+* [`cmd_maprule` and `bash_maprule`](lib/maprule.bzl)
+
## Writing a new module
Steps to add a module to Skylib: