diff options
author | 2017-06-14 16:52:03 +0200 | |
---|---|---|
committer | 2017-06-16 09:26:23 +0200 | |
commit | 4cbe5f36d32d462d9dd269232a520f8ac33cba65 (patch) | |
tree | 2677f2067c6154a1e79748da76cff87e74d06550 /src/main/java/com/google | |
parent | a5b43c4c9a9a5679e05fd255ca28bde9457c5abe (diff) |
ctx.empty_action now allows depset as inputs
RELNOTES: None.
PiperOrigin-RevId: 158977418
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java index eb990c52e3..a25a46090c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java @@ -459,7 +459,10 @@ public class SkylarkRuleImplementationFunctions { ), @Param( name = "inputs", - type = SkylarkList.class, + allowedTypes = { + @ParamType(type = SkylarkList.class), + @ParamType(type = SkylarkNestedSet.class), + }, generic1 = Artifact.class, named = true, positional = false, @@ -471,15 +474,18 @@ public class SkylarkRuleImplementationFunctions { private static final BuiltinFunction createEmptyAction = new BuiltinFunction("empty_action") { @SuppressWarnings("unused") - public Runtime.NoneType invoke(SkylarkRuleContext ctx, String mnemonic, SkylarkList inputs) + public Runtime.NoneType invoke(SkylarkRuleContext ctx, String mnemonic, Object inputs) throws EvalException, ConversionException { ctx.checkMutable("empty_action"); RuleContext ruleContext = ctx.getRuleContext(); + NestedSet<Artifact> inputSet = inputs instanceof SkylarkNestedSet + ? ((SkylarkNestedSet) inputs).getSet(Artifact.class) + : convertInputs((SkylarkList) inputs); Action action = new PseudoAction<>( generateUuid(ruleContext), ruleContext.getActionOwner(), - convertInputs(inputs), + inputSet, generateDummyOutputs(ruleContext), mnemonic, SpawnInfo.spawnInfo, |