aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar fwe <fwe@google.com>2017-04-05 12:14:55 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-04-05 15:22:46 +0200
commit2753264d75256b2ff61e13101e1d893cb5b41288 (patch)
tree9e10280657ab1bf8b6076910a3f2890b70a606a7 /src
parentd16f8e063d205743391bcb2a10f615781b0b087e (diff)
Skylark: Add documentation to new_file().
Fixes #1892. PiperOrigin-RevId: 152245566
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
index 435217403e..76ac1a99bf 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
@@ -855,9 +855,17 @@ public final class SkylarkRuleContext implements SkylarkValue {
}
@SkylarkCallable(
+ name = "new_file",
doc =
"Creates a file object with the given filename, in the current package. "
- + DOC_NEW_FILE_TAIL
+ + DOC_NEW_FILE_TAIL,
+ parameters = {
+ @Param(
+ name = "filename",
+ type = String.class,
+ doc = "The path of the new file, relative to the current package."
+ )
+ }
)
public Artifact newFile(String filename) throws EvalException {
checkMutable("new_file");
@@ -877,9 +885,24 @@ public final class SkylarkRuleContext implements SkylarkValue {
return ruleContext.getPackageRelativeArtifact(filename, root);
}
- @SkylarkCallable(doc =
- "Creates a new file object in the same directory as the original file. "
- + DOC_NEW_FILE_TAIL)
+ @SkylarkCallable(
+ name = "new_file",
+ doc =
+ "Creates a new file object in the same directory as the original file. "
+ + DOC_NEW_FILE_TAIL,
+ parameters = {
+ @Param(
+ name = "sibling_file",
+ type = Artifact.class,
+ doc = "A file that lives in the same directory as the newly created file."
+ ),
+ @Param(
+ name = "basename",
+ type = String.class,
+ doc = "The base name of the newly created file."
+ )
+ }
+ )
public Artifact newFile(Artifact baseArtifact, String newBaseName) throws EvalException {
checkMutable("new_file");
PathFragment original = baseArtifact.getRootRelativePath();