diff options
author | janakr <janakr@google.com> | 2018-06-19 10:30:15 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-19 10:31:48 -0700 |
commit | 123d78472da1428298e8300e6b3de469e25e3af1 (patch) | |
tree | cdf0a29414ea299624e9ece95d4bbe2bb7ac5821 /src/main/java/com/google/devtools/build/lib/packages | |
parent | 191238f51dc9575c90baa20dd7ee4fd2b8cf2bec (diff) |
Make things easier to serialize: make constants constant, tag some lambdas. Get rid of a useless tag, because the Function being tagged is a concrete class, so won't be serializable. Will deal with it in a follow-up. Implement equality for BazelInfo.
PiperOrigin-RevId: 201199255
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/Attribute.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java index b22a3d69bc..91a26c2f1e 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java @@ -1061,9 +1061,12 @@ public final class Attribute implements Comparable<Attribute> { * dependencies through this attribute. */ public Builder<TYPE> aspect(NativeAspectClass aspect) { - return this.aspect(aspect, input -> AspectParameters.EMPTY); + return this.aspect(aspect, EMPTY_FUNCTION); } + @AutoCodec @AutoCodec.VisibleForSerialization + static final Function<Rule, AspectParameters> EMPTY_FUNCTION = input -> AspectParameters.EMPTY; + public Builder<TYPE> aspect(SkylarkDefinedAspect skylarkAspect, Location location) throws EvalException { SkylarkRuleAspect skylarkRuleAspect = new SkylarkRuleAspect(skylarkAspect); |