From ab5ca78269caac5553b97464161e763fed988585 Mon Sep 17 00:00:00 2001 From: laurentlb Date: Fri, 21 Jul 2017 16:24:52 +0200 Subject: Add links to examples in the documentation. RELNOTES: None. PiperOrigin-RevId: 162738376 --- site/docs/skylark/rules.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'site/docs/skylark/rules.md') 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: -- cgit v1.2.3