From 492472fc8232775109a7bc9fae28dd2d4c752e63 Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 9 Feb 2016 21:53:57 +0000 Subject: Add instrumented file provider support to Skylark rules. RELNOTES: Add instrumented file provider support to Skylark rules. -- MOS_MIGRATED_REVID=114255963 --- site/docs/skylark/rules.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'site') 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 ---------------- -- cgit v1.2.3