From 0cd5bff59a319eb6230d680e2c2e61bd893fc3c9 Mon Sep 17 00:00:00 2001 From: laurentlb Date: Wed, 13 Dec 2017 13:10:51 -0800 Subject: Add more links to examples in the documentation. RELNOTES: None. PiperOrigin-RevId: 178946746 --- .../lib/analysis/skylark/SkylarkActionFactory.java | 31 +++++++++++++--------- .../build/lib/analysis/skylark/SkylarkAttr.java | 4 ++- 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java index 1bb4701ada..687dd08d0e 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java @@ -70,15 +70,14 @@ import java.util.Map; import java.util.UUID; import javax.annotation.Nullable; -/** - * Provides a Skylark interface for all action creation needs. - */ +/** Provides a Skylark interface for all action creation needs. */ @SkylarkModule( - name = "actions", - category = SkylarkModuleCategory.BUILTIN, - doc = "Module providing functions to create actions." + name = "actions", + category = SkylarkModuleCategory.BUILTIN, + doc = + "Module providing functions to create actions. " + + "Access this module using ctx.actions." ) - public class SkylarkActionFactory implements SkylarkValue { private final SkylarkRuleContext context; private final SkylarkSemantics skylarkSemantics; @@ -111,7 +110,9 @@ public class SkylarkActionFactory implements SkylarkValue { + "You must create an action that generates the file.
" + "Files cannot be created outside of the current package. " + "Files that are specified in rule's outputs do not need to be declared and are " - + "available through ctx.outputs.", + + "available through ctx.outputs. " + + "See example of use", parameters = { @Param( name = "filename", @@ -238,7 +239,7 @@ public class SkylarkActionFactory implements SkylarkValue { + "to a file. This is used to generate files using information available in the " + "analysis phase. If the file is large and with a lot of static content, consider " + "using expand_template. " - + "" + + "" + "See example of use", parameters = { @Param(name = "output", type = Artifact.class, doc = "the output file.", named = true), @@ -283,7 +284,10 @@ public class SkylarkActionFactory implements SkylarkValue { @SkylarkCallable( name = "run", - doc = "Creates an action that runs an executable.", + doc = + "Creates an action that runs an executable. " + + "See example of use", parameters = { @Param( name = "outputs", @@ -455,7 +459,10 @@ public class SkylarkActionFactory implements SkylarkValue { @SkylarkCallable( name = "run_shell", - doc = "Creates an action that runs a shell command.", + doc = + "Creates an action that runs a shell command. " + + "See example of use", parameters = { @Param( name = "outputs", @@ -773,7 +780,7 @@ public class SkylarkActionFactory implements SkylarkValue { + "dictionary appears in the template, it is replaced with the associated value. " + "There is no special syntax for the keys. You may for example use curly braces " + "to avoid conflicts (e.g. {KEY}). " - + "" + + "" + "See example of use", parameters = { @Param( diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java index 1dea86cf91..a2a02cc0b9 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java @@ -75,7 +75,9 @@ import javax.annotation.Nullable; doc = "Module for creating new attributes. " + "They are only for use with rule or " - + "aspect." + + "aspect. " + + "See example of use." ) public final class SkylarkAttr implements SkylarkValue { -- cgit v1.2.3