aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar laurentlb <laurentlb@google.com>2017-12-13 13:10:51 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-13 13:12:52 -0800
commit0cd5bff59a319eb6230d680e2c2e61bd893fc3c9 (patch)
tree7872d5f832ec905ddafd5e16129d72e18ef14203 /src/main/java/com/google/devtools
parent918f32784eff50166cc6d0d5ac2f9dad7c5525ee (diff)
Add more links to examples in the documentation.
RELNOTES: None. PiperOrigin-RevId: 178946746
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java31
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java4
2 files changed, 22 insertions, 13 deletions
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 <a href=\"ctx.html#actions\">ctx.actions</a>."
)
-
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. <br>"
+ "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 <a href=\"ctx.html#outputs\">ctx.outputs</a>.",
+ + "available through <a href=\"ctx.html#outputs\">ctx.outputs</a>. "
+ + "<a href=\"https://github.com/bazelbuild/examples/tree/master/rules/"
+ + "computed_dependencies/hash.bzl\">See example of use</a>",
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 <a href=\"#expand_template\">expand_template</a>. "
- + "<a href=\"https://github.com/laurentlb/examples/blob/master/rules/executable/executable.bzl\">"
+ + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/executable/executable.bzl\">"
+ "See example of use</a>",
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. "
+ + "<a href=\"https://github.com/bazelbuild/examples/tree/master/rules/"
+ + "actions_run/execute.bzl\">See example of use</a>",
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. "
+ + "<a href=\"https://github.com/bazelbuild/examples/tree/master/rules/"
+ + "shell_command/size.bzl\">See example of use</a>",
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. <code>{KEY}</code>). "
- + "<a href=\"https://github.com/laurentlb/examples/blob/master/rules/expand_template/hello.bzl\">"
+ + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/expand_template/hello.bzl\">"
+ "See example of use</a>",
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 <a href=\"globals.html#rule\">rule</a> or "
- + "<a href=\"globals.html#aspect\">aspect</a>."
+ + "<a href=\"globals.html#aspect\">aspect</a>. "
+ + "<a href=\"https://github.com/bazelbuild/examples/tree/master/rules/"
+ + "attributes/printer.bzl\">See example of use</a>."
)
public final class SkylarkAttr implements SkylarkValue {