diff options
author | 2016-05-06 21:47:42 +0000 | |
---|---|---|
committer | 2016-05-09 07:10:10 +0000 | |
commit | 74558fcc8953dec64c2ba5920c8f7a7e3ada36ab (patch) | |
tree | cf51272440b2d6a9c617cbaa6693dee2272b9251 /src/main/java/com/google/devtools/build/lib/packages/AspectParameters.java | |
parent | d50ff62e9eb59bea86fbbdfc42264c0e240e914b (diff) |
Expose parameterized aspects to Skylark.
There are no syntactic changes within Skylark; the only difference is that aspects may have non-implicit attributes, so long as they have type 'string' and use the 'values' restriction. Such aspects may only be requested by rules which have attributes with types and names matching the non-implicit, non-defaulted attributes of the aspect.
This is not yet a complete match for native AspectParameters functionality since implicit attributes cannot yet be affected by attribute values, but that will be added later.
Implicit aspects are still required to have default values. Non-implicit aspect attributes are considered "required" unless they have a default value. An error will occur if they are applied to a rule that does not "cover" all required attributes by having attributes of matching name and type. While non-implicit aspect attributes with a default are not required, they will still take on the value of a rule attribute with the same name and type if it is present.
Aspects with non-implicit, non-defaulted ("required") attributes cannot be requested on the command line, only by a rule.
RELNOTES: Expose parameterized aspects to Skylark.
--
MOS_MIGRATED_REVID=121711715
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/AspectParameters.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/AspectParameters.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AspectParameters.java b/src/main/java/com/google/devtools/build/lib/packages/AspectParameters.java index 0cf175e130..6862f106ce 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/AspectParameters.java +++ b/src/main/java/com/google/devtools/build/lib/packages/AspectParameters.java @@ -58,7 +58,7 @@ public final class AspectParameters { } /** - * Returns collection of values for specified key, or null if key is missing. + * Returns collection of values for specified key, or an empty collection if key is missing. */ public ImmutableCollection<String> getAttribute(String key) { return attributes.get(key); |