gradle
gradle copied to clipboard
Fix attribute bug for component metadata rules
Previously, any action which modifies the result of getAttributes from the action passed into 'withVariant' or 'allVariants', or any of the other methods in 'ComponentMetadataDetailsAdapter' which delegate to those methods, would always modify the attributes of all variants, regardless of whether a specific variant was specified. This is fixed by ensuring the result of 'getAttributes()' returns a unique mutable attribute container for any individual variant whose parent is the component's attributes.
Along the way, implements a 'ImmutableAttributesFactory#join' method which joins two attribute containers in a parent-child relationship where any updates in the parent or child are reflected in the joined container. This implementation was based on the parent functionality already implemented for 'DefaultMutableAttributeContainer'.
Also added '@Deprecated' annotations to 'ImmutableAttributes' to give immediate feedback to developers using these classes that these instances cannot be mutated. This is similar to how Guava immutable types handle an immutable implementation of a mutable interface.
- [ ] Write Tests
@bot-graddle test this
@bot-gradle test this
@bot-gradle test and merge
OK, I've already triggered a build for you.