From c1b1eedc14856997d2bf68be5d94f937fb21d3a3 Mon Sep 17 00:00:00 2001 From: Dmitry Lomov Date: Thu, 26 Nov 2015 11:18:12 +0000 Subject: Implements 'extra_deps' for Skylark aspects. -- MOS_MIGRATED_REVID=108779139 --- .../build/lib/rules/SkylarkRuleClassFunctions.java | 47 ++++++++++++++++++---- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/google/devtools/build') diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java index df27c88169..7d32b7705b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java @@ -356,20 +356,45 @@ public class SkylarkRuleClassFunctions { type = SkylarkList.class, generic1 = String.class, defaultValue = "[]" + ), + @Param( + name = "extra_deps", + type = SkylarkList.class, + generic1 = String.class, + defaultValue = "[]" ) }, - useEnvironment = true + useEnvironment = true, + useAst = true ) private static final BuiltinFunction aspect = new BuiltinFunction("aspect") { public SkylarkAspect invoke( - BaseFunction implementation, SkylarkList attributeAspects, Environment funcallEnv) - throws ConversionException { - ImmutableList.Builder builder = ImmutableList.builder(); + BaseFunction implementation, + SkylarkList attributeAspects, + SkylarkList extraDeps, + FuncallExpression ast, + Environment funcallEnv) throws EvalException { + ImmutableList.Builder attributeListBuilder = ImmutableList.builder(); for (Object attributeAspect : attributeAspects) { - builder.add(STRING.convert(attributeAspect, "")); + attributeListBuilder.add(STRING.convert(attributeAspect, "attr_aspects")); + } + ImmutableList.Builder