From 61dcfc77ceced86883e156d45a4c675d6d11278c Mon Sep 17 00:00:00 2001 From: brandjon Date: Mon, 26 Feb 2018 08:38:43 -0800 Subject: Revamp docs for default outputs / output groups - collapsed these into one section - removed the term "implicit outputs" - add explanation for what these are first, then how to control them - update docs for DefaultInfo - also update docs for test/executable args of rule() RELNOTES: None PiperOrigin-RevId: 187026641 --- .../skylark/SkylarkRuleClassFunctions.java | 62 ++++++++++++++-------- 1 file changed, 39 insertions(+), 23 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java') diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java index 6f7a1bfd62..5e30bb4abe 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java @@ -232,23 +232,33 @@ public class SkylarkRuleClassFunctions { name = "DefaultInfo", returnType = Provider.class, doc = - "A provider that is provided by every rule, even if it is not returned explicitly. " - + "A DefaultInfo accepts the following parameters:" + "A provider that gives general information about a target's direct and transitive files. " + + "Every rule type has this provider, even if it is not returned explicitly by the " + + "rule's implementation function." + + "

The DefaultInfo constructor accepts the following parameters:" + "

" - + "Each instance of the default provider contains the following standard " - + "fields: " + + "Each DefaultInfo instance has the following fields: " + "
    " - + "
  • files
  • " - + "
  • files_to_run
  • " - + "
  • data_runfiles
  • " - + "
  • default_runfiles
  • " + + "
  • files" + + "
  • files_to_run" + + "
  • data_runfiles" + + "
  • default_runfiles" + "
" + + "See the rules page for more information." ) private static final Provider defaultInfo = DefaultInfo.PROVIDER; @@ -256,12 +266,12 @@ public class SkylarkRuleClassFunctions { name = "OutputGroupInfo", returnType = Provider.class, doc = - "Provides information about output groups the rule provides.
" + "A provider that indicates what output groups a rule has.
" + "Instantiate this provider with
" + "
"
             + "OutputGroupInfo(group1 = <files>, group2 = <files>...)
" - + "See Output Groups " - + "for more information." + + "See Requesting output files" + + " for more information." ) private static final Provider outputGroupInfo = OutputGroupInfo.SKYLARK_CONSTRUCTOR; @@ -374,10 +384,14 @@ public class SkylarkRuleClassFunctions { type = Boolean.class, defaultValue = "False", doc = - "Whether this rule is a test rule. " - + "If True, the rule must end with _test (otherwise it must " - + "not), and there must be an action that generates " - + "ctx.outputs.executable." + "Whether this rule is a test rule, that is, whether it may be the subject of a " + + "blaze test or blaze run command. All test rules are " + + "automatically considered executable; it is " + + "unnecessary (and discouraged) to explicitly set executable = True " + + "for a test rule." + + "

Test rules must have names ending in the suffix \"_test\"; " + + "non-test rules must not use this suffix. (Note that this applies only to the " + + "name of the rule, not its targets.)" ), @Param( name = "attrs", @@ -418,9 +432,11 @@ public class SkylarkRuleClassFunctions { type = Boolean.class, defaultValue = "False", doc = - "whether this rule is marked as executable or not. If True, " - + "there must be an action that generates " - + "ctx.outputs.executable." + "Whether this rule is considered executable, that is, whether it may be the subject of " + + "a blaze run command. Executable rules automatically get a " + + "predeclared output that is addressable as ctx.outputs.executable. " + + "See the Rules page for more " + + "information." ), @Param( name = "output_to_genfiles", -- cgit v1.2.3