From e0e7afafa3e31e06d9c3ad4e6203be73bd14c3f0 Mon Sep 17 00:00:00 2001 From: laszlocsomor Date: Wed, 30 Aug 2017 15:38:34 +0200 Subject: docs,Skylark: fix formatting in Args.html Also add a sentence explaining that "memory-efficient command lines" means Bazel constructs them lazily. PiperOrigin-RevId: 166986416 --- .../lib/analysis/skylark/SkylarkActionFactory.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/analysis/skylark') 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 dbbd77268e..52294c4414 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 @@ -759,27 +759,29 @@ public class SkylarkActionFactory implements SkylarkValue { name = "Args", category = SkylarkModuleCategory.BUILTIN, doc = - "module providing methods for building memory-efficient command lines.

" - + "See ctx.actions.run() or ." - + "ctx.actions.run_shell()" + "Module providing methods to build memory-efficient command lines.

" + + "The command lines are memory-efficient because Bazel doesn't fully construct them" + + " until just before executing the action. " + + "See ctx.actions.run() or " + + "ctx.actions.run_shell().
" + "Example:" + "
\n"
             + "# foo_deps and bar_deps are each a large depset of artifacts\n"
             + "args = ctx.actions.args()\n"
             + "args.add(\"--foo\")\n"
             + "args.add(foo_deps)\n"
-            + "args.add(\"--bar\")"
-            + "args.add(bar_deps, join_with=\":\")\n"
+            + "args.add(\"--bar\")\n"
+            + "args.add(bar_deps, join_with=\",\")\n"
             + "ctx.run(\n"
             + "  arguments = args,\n"
             + "  ...\n"
             + ")\n"
             + "# Expands to [\n"
-            + "#  \"--foo\",\""
-            + "# ...artfacts from foo_deps,\n"
-            + "#  \"--bar\",\n"
-            + "#  ...artifacts from bar_deps joined with ':',\n"
-            + "#]"
+            + "#   \"--foo\",\n"
+            + "#   ...artifacts from foo_deps,\n"
+            + "#   \"--bar\",\n"
+            + "#   ...artifacts from bar_deps joined with ',',\n"
+            + "# ]"
             + "
" ) static class Args { -- cgit v1.2.3