aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java
diff options
context:
space:
mode:
authorGravatar dslomov <dslomov@google.com>2017-07-28 22:34:10 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-07-31 16:32:11 +0200
commitc7567001e8d48483650a4e138b17cfb91cbf34b1 (patch)
tree1922eb47455d1ff1660b03d5b541eadf3284d388 /src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java
parent31dc6f1a281b0ae3690ea7be9c3ccc360fe22c10 (diff)
Expose to Skylark Strings instead of PathFragments from CppConfiguration.
The only way to use those was in the `ctx.action(...executable...)` parameter, made that accept string. Fixes #2931. RELNOTES: None. PiperOrigin-RevId: 163511248
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java
index 4360561628..2f87704d83 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkActionFactory.java
@@ -263,7 +263,7 @@ public class SkylarkActionFactory implements SkylarkValue {
type = Object.class,
allowedTypes = {
@ParamType(type = Artifact.class),
- @ParamType(type = PathFragment.class),
+ @ParamType(type = String.class),
},
named = true,
positional = false,
@@ -371,12 +371,12 @@ public class SkylarkActionFactory implements SkylarkValue {
} else {
builder.setExecutable(provider);
}
- } else if (executableUnchecked instanceof PathFragment) {
- builder.setExecutable((PathFragment) executableUnchecked);
+ } else if (executableUnchecked instanceof String) {
+ builder.setExecutable(PathFragment.create((String) executableUnchecked));
} else {
throw new EvalException(
null,
- "expected file or PathFragment for "
+ "expected file or string for "
+ "executable but got "
+ EvalUtils.getDataTypeName(executableUnchecked)
+ " instead");