aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Snow Pettersen <aickck@gmail.com>2017-11-14 13:26:12 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-14 13:28:16 -0800
commite657679a35501c570c1bb02b8e020daee178474d (patch)
tree756922226c29cb94264dd0bb4e3bfd3f4d3b1f7b /src/main/java/com
parent213952285ea5bbe1dbcefbe7deef2f27a4ec6ac7 (diff)
Document parameter of repository_ctx.path
Closes #3972. PiperOrigin-RevId: 175726041
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContext.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContext.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContext.java
index dfa72257f8..52e8e431ad 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContext.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContext.java
@@ -138,11 +138,23 @@ public class SkylarkRepositoryContext {
@SkylarkCallable(
name = "path",
doc =
- "Returns a path from a string or a label. If the path is relative, it will resolve "
+ "Returns a path from a string, label or path. If the path is relative, it will resolve "
+ "relative to the repository directory. If the path is a label, it will resolve to "
+ "the path of the corresponding file. Note that remote repositories are executed "
+ "during the analysis phase and thus cannot depends on a target result (the "
- + "label should point to a non-generated file)."
+ + "label should point to a non-generated file). If path is a path, it will return "
+ + "that path as is.",
+ parameters = {
+ @Param(
+ name = "path",
+ allowedTypes = {
+ @ParamType(type = String.class),
+ @ParamType(type = Label.class),
+ @ParamType(type = SkylarkPath.class)
+ },
+ doc = "string, label or path from which to create a path from"
+ )
+ }
)
public SkylarkPath path(Object path) throws EvalException, InterruptedException {
return getPath("path()", path);