aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/skylark/rules.md
diff options
context:
space:
mode:
authorGravatar laurentlb <laurentlb@google.com>2017-07-21 16:24:52 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-07-24 09:51:08 +0200
commitab5ca78269caac5553b97464161e763fed988585 (patch)
tree38b594453ef46593430687b82766a1f0cc050809 /site/docs/skylark/rules.md
parentddb1823246b2ef60cfdff2047abae35cdfb94392 (diff)
Add links to examples in the documentation.
RELNOTES: None. PiperOrigin-RevId: 162738376
Diffstat (limited to 'site/docs/skylark/rules.md')
-rw-r--r--site/docs/skylark/rules.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md
index d56789e11d..5b476760fa 100644
--- a/site/docs/skylark/rules.md
+++ b/site/docs/skylark/rules.md
@@ -173,14 +173,14 @@ A target can declare output files, which must be generated by the target's
actions. There are three ways to create output files:
* If the rule is marked `executable`, it creates an output file of the same name
- as the rule's. [See example](cookbook.md#outputs-executable)
+ as the rule's. [See example](https://github.com/bazelbuild/examples/blob/master/rules/executable/executable.bzl)
* The rule can declare default `outputs`, which are always generated.
- [See example](cookbook.md#outputs-default)
+ [See example](https://github.com/bazelbuild/examples/blob/master/rules/default_outputs/extension.bzl)
* The rule can have output or output list type attributes. In that case the
output files come from the actual attribute values.
- [See example](cookbook.md#outputs-custom)
+ [See example](https://github.com/bazelbuild/examples/blob/master/rules/custom_outputs/extension.bzl)
Each output file must have exactly one generating action. See the
[library](lib/ctx.html#outputs) for more context.
@@ -579,7 +579,7 @@ An executable rule is a rule that users can run using `bazel run`.
To make a rule executable, set `executable=True` in the
[rule function](lib/globals.html#rule). The `implementation` function of the
rule must generate the output file `ctx.outputs.executable`.
-[See example](cookbook.md#outputs-executable)
+[See example](https://github.com/bazelbuild/examples/blob/master/rules/executable/executable.bzl)
## Test rules
@@ -591,6 +591,8 @@ also end with `_test`. Test rules are implicitly executable, which means that
the `implementation` function of the rule must generate the output file
`ctx.outputs.executable`.
+[See example](https://github.com/bazelbuild/examples/blob/master/rules/test_rule/line_length.bzl)
+
Test rules inherit the following attributes: `args`, `flaky`, `local`,
`shard_count`, `size`, `timeout`. The defaults of inherited attributes cannot be
changed, but you can use a macro with default arguments: