attributes

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Desugar producer attribute if the requesting attribute is desugared (#11372)

This can be the case if an attribute on a dependency is published

and the resolved target of the dependency is a local project.

For example, a published platform dependency to a local java-platform

project.

We support 'Named' and 'Enum' for desugaring as that are the only

non-primitve types we currently allow to be published in Gradle

Module Metadata.

  1. … 3 more files in changeset.
Desugar producer attribute if the requesting attribute is desugared

This can be the case if a attribute on a dependency is published

and the resolved target of the dependency is a local project.

For example, a published platform dependency to a local java-platform

project.

  1. … 3 more files in changeset.
Desugar producer attribute if the requesting attribute is desugared

This can be the case if a attribute on a dependency is published

and the resolved target of the dependency is a local project.

For example, a published platform dependency to a local java-platform

project.

We support 'Named' and 'Enum' for desugaring as that are the only

non-primimitve types we currently allow to be published in Gradle

Module Metadata.

  1. … 3 more files in changeset.
Desugar producer attribute if the requesting attribute is desugared

This can be the case if a attribute on a dependency is published

and the resolved target of the dependency is a local project.

For example, a published platform dependency to a local java-platform

project.

  1. … 3 more files in changeset.
Desugar producer attribute if the requesting attribute is desugared

This can be the case if a attribute on a dependency is published

and the resolved target of the dependency is a local project.

For example, a published platform dependency to a local java-platform

project.

We support 'Named' and 'Enum' for desugaring as that are the only

non-primimitve types we currently allow to be published in Gradle

Module Metadata.

  1. … 3 more files in changeset.
This is a follow up on #10004

It missed one code path for the translation of values, resulting in some

issues for kotlin projects attempting to publish resolved version to

Ivy.

    • -1
    • +1
    ./DefaultImmutableAttributesFactory.java
  1. … 1 more file in changeset.
Proper transformation of deprecated usage values

This is a follow up on #10004

It missed one code path for the translation of values, resulting in some

issues for kotlin projects attempting to publish resolved version to

Ivy.

    • -1
    • +1
    ./DefaultImmutableAttributesFactory.java
  1. … 1 more file in changeset.
Conversion rule for deprecated org.gradle.usage values

The org.gradle.usage attributes has all values ending in -jars, -classes

and -resources deprecated. This commit replaces their usage with a

cleaned up value and adds the matching org.gradle.libraryelements value.

    • -2
    • +9
    ./DefaultImmutableAttributesFactory.java
  1. … 1 more file in changeset.
Conversion rule for deprecated org.gradle.usage values

The org.gradle.usage attributes has all values ending in -jars, -classes

and -resources deprecated. This commit replaces their usage with a

cleaned up value and adds the matching org.gradle.libraryelements value.

    • -2
    • +9
    ./DefaultImmutableAttributesFactory.java
  1. … 1 more file in changeset.
Conversion rule for deprecated org.gradle.usage values

The org.gradle.usage attributes has all values ending in -jars, -classes

and -resources deprecated. This commit replaces their usage with a

cleaned up value and adds the matching org.gradle.libraryelements value.

    • -2
    • +10
    ./DefaultImmutableAttributesFactory.java
    • -0
    • +69
    ./UsageCompatibilityHandler.java
  1. … 1 more file in changeset.
Conversion rule for deprecated org.gradle.usage values

The org.gradle.usage attributes has all values ending in -jars, -classes

and -resources deprecated. This commit replaces their usage with a

cleaned up value and adds the matching org.gradle.libraryelements value.

    • -2
    • +9
    ./DefaultImmutableAttributesFactory.java
  1. … 1 more file in changeset.
Apply `Anonymous type can be replaced with lambda` inspection the whole project

  1. … 666 more files in changeset.
Apply `Explicit type can be replaced with <>` inspection the whole project

    • -1
    • +1
    ./DefaultImmutableAttributesFactory.java
  1. … 908 more files in changeset.
Simplify handling of attributes

Make the copy path conditional, thus preserving the contract of

`attributes` and its link to the `attributesFactory`.

Allows to get rid of the added `AttributeContainerInternal.isImmutable`.

    • -5
    • +0
    ./DefaultMutableAttributeContainer.java
  1. … 3 more files in changeset.
Make AbstractModuleDependency.copyTo safe

Copy mutable attributes

Fix copying capabilities

Signed-off-by: Dan Sanduleac <sanduleac.dan@gmail.com>

    • -0
    • +5
    ./DefaultMutableAttributeContainer.java
  1. … 5 more files in changeset.
Replace anonymous classes with lambdas

  1. … 711 more files in changeset.
Replace anonymous classes with lambdas

  1. … 695 more files in changeset.
Add missing @Override to public api types

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -0
    • +1
    ./DefaultMutableAttributeContainer.java
  1. … 340 more files in changeset.
Special case the isolation for generated `Named` types, to make this faster for variant selecting.

  1. … 29 more files in changeset.
Special case the isolation for generated `Named` types, to make this faster for variant selecting.

  1. … 29 more files in changeset.
Move value snapshot implementations to snapshots project

    • -1
    • +1
    ./DefaultImmutableAttributesFactory.java
  1. … 95 more files in changeset.
Move isolation base classes to snapshots project

    • -2
    • +2
    ./DefaultImmutableAttributesFactory.java
  1. … 44 more files in changeset.
Optimize attribute matching

Attribute coercion is a pretty expensive process. But we very often coerce the same

attributes to the same other attribute types. The consequence is that we do the same

amount of work repeatedly. Knowing that attributes are interned thanks to the

attribute factory, and that their lifetime is bound to a single build, we can use

a coercion cache that uses a simple map, to make it faster. The map, however, needs

to be a concurrent map because we have no guarantee that this method cannot be

called concurrently.

In addition, the multiple candidate matcher is now aware that it's pretty usual

to find the same attributes everywhere, so it optimizes for this case when collecting

the candidate values, by avoiding the creation of a hash set.

  1. … 2 more files in changeset.
Move all hashing-related stuff to base-services

- Renamed existing Hasher -> PrimitiveHasher

- Renamed BuildCacheHasher -> Hasher (this is the one that prefixes hashed data with the length of the data to avoid collisions)

  1. … 72 more files in changeset.
Fix change detection for Lambda task actions

  1. … 9 more files in changeset.
Fix concat for attributes with same name, different type

When 2 containers contain attributes with the same name and different

types, the `concat` and `safeConcat` methods of `ImmutableAttributesFactory`

now treat these attributes as equal for the purposes of merging.

Previously, these methods would produce an `AttributeContainer`

containing both attributes.

This was a violation of the `AttributeContainer` contract which states:

"It is not allowed to have two attributes with the same name but

different types in the container"

    • -3
    • +4
    ./DefaultImmutableAttributesFactory.java
  1. … 1 more file in changeset.
Enforce isolation of ComponentMetadataRule

This means that passed in parameters must be snapshotable as defined by

the ValueSnapshotter

Added support for Attribute to ValueSnapshotter

    • -0
    • +40
    ./AttributeDefinitionSnapshot.java
  1. … 53 more files in changeset.
Fail whenever 2 dependencies/constraints disagree on the value of an attribute

This commit adds a sanity check: in case 2 dependencies disagree on the value

of an attribute, we don't know what to choose. We could, in the future, make

use of the compatibility rules to perform a better choice, but for now we just

fail resolution whenever this happens.

    • -0
    • +42
    ./AttributeMergingException.java
    • -0
    • +26
    ./DefaultImmutableAttributesFactory.java
  1. … 2 more files in changeset.
Use dependency attributes when selecting variants of a single component

This commit makes sure that attributes defined on a dependency are used whenever

a component has multiple variants, and we need to select one of the variants.

However, this doesn't work yet when an attribute on a dependency overrides the

consumer attributes (the attributes defined on a configuration). In this case,

we will rightfully select the variant, but as soon as we try to get the artifacts

of this variant, we will fail, because we're selecting _again_ the variant, but

the only thing we have at this point is the selected component and the consumer

attributes (we have lost the dependency attributes).

    • -0
    • +6
    ./DefaultImmutableAttributesFactory.java
  1. … 10 more files in changeset.
Revert "Revert "Speed up attribute matching""

    • -96
    • +31
    ./DefaultImmutableAttributes.java
    • -2
    • +14
    ./DefaultImmutableAttributesFactory.java
    • -69
    • +0
    ./SchemaUpdatingAttributeFactory.java
  1. … 11 more files in changeset.