aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-02-09 21:53:57 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-02-10 10:26:16 +0000
commit492472fc8232775109a7bc9fae28dd2d4c752e63 (patch)
treea513de825efa68e329c1d0ec0ef77f11f3414785 /site
parent7cee125f30e3a483cef6cb0ec3117533af41ecef (diff)
Add instrumented file provider support to Skylark rules.
RELNOTES: Add instrumented file provider support to Skylark rules. -- MOS_MIGRATED_REVID=114255963
Diffstat (limited to 'site')
-rw-r--r--site/docs/skylark/rules.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md
index 12d6f96f4a..f248a5e3c6 100644
--- a/site/docs/skylark/rules.md
+++ b/site/docs/skylark/rules.md
@@ -357,6 +357,29 @@ binary should know about them.
Also note that if an action uses an executable, the executable's runfiles can
be used when the action executes.
+Instrumented files
+------------------
+
+Instrumented files are a set of files used by the coverage command. A rule can
+use the `instrumented_files` provider to provide information about which files
+should be used for measuring coverage.
+
+```skylark
+def rule_implementation(ctx):
+ ...
+ return struct(instrumented_files=struct(
+ # Optional: File extensions used to filter files from source_attributes.
+ # If not provided, then all files from source_attributes will be
+ # added to instrumented files, if an empty list is provided, then
+ # no files from source attributes will be added.
+ extensions=["ext1", "ext2"],
+ # Optional: Attributes that contain source files for this rule.
+ source_attributes=["srcs"],
+ # Optional: Attributes for dependencies that could include instrumented
+ # files.
+ dependency_attributes=["data", "deps"]))
+```
+
Executable rules
----------------