ComponentMetadataDetailsAdapterTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Inject PlatformSupport into component metadata handler

This gives access to the typed version for the 'category=platform'

attribute value.

    • -3
    • +3
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 8 more files in changeset.
Revert "Revert "Merge branch 'release'""

This reverts commit 67b8bb8f18f854f45a2f5ec52cc9c8a25981e2f2.

This restores the merge attempt from earlier.

    • -2
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 66 more files in changeset.
Revert "Merge branch 'release'"

This reverts commit c7fdc455dcb9a8016af0ae9bc8b4c43fde1e2d06, reversing

changes made to 9f70d52b74dbc8c71381781b6c155474031b3cf8.

The changes need a wrapper as there are API changes. Reverting for now.

    • -2
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 66 more files in changeset.
Changes in Gradle Module Metadata loading

We no longer define any configurations, like default or the maven ones.

In the past, we still had these defined which allowed partial legacy

selection. But it made no sense since all these configurations would not

have any dependencies for example.

Fixes #10980

    • -2
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 16 more files in changeset.
Changes in Gradle Module Metadata generation

We no longer define any configurations, like default or the maven ones.

In the past, we still had these defined which allowed partial legacy

selection. But it made no sense since all these configurations would not

have any dependencies for example.

    • -2
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 16 more files in changeset.
Introduce constraint inheritance API

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 40 more files in changeset.
Introduce constraint inheritance API

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 40 more files in changeset.
Introduce constraint inheritance API

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 40 more files in changeset.
Introduce constraint inheritance API

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 41 more files in changeset.
Add `inheritSubgraphConstraints()` API to dependencies

    • -1
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 61 more files in changeset.
Add `inheritSubgraphConstraints()` API to dependencies

    • -1
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 62 more files in changeset.
Add `inheritSubgraphConstraints()` API to dependencies

    • -1
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 63 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

    • -5
    • +3
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 30 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

    • -5
    • +3
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 32 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

    • -5
    • +3
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 32 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

    • -5
    • +3
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 32 more files in changeset.
Support requested capabilities on external dependencies

This commit adds support for having requested capabilities

part of the module component selector, for external dependencies.

This means that if a component is using Gradle metadata, we can

read requested capabilities and honor them during selection.

This reworks where requested capabilities are stored, and in

particular moves them to the `ComponentSelector`, making them

properly part of the identity of a dependency. As such, two

dependencies requiring two different variants by using distinct

capabilities will now properly appear as two different dependencies

in the dependency graph, instead of two variants of the same

dependency.

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 63 more files in changeset.
Initial support for optional features

This commit introduces initial support for optional features, by

implementing a way for a dependency declaration (currently *only* in

the DSL) to request variants of the target component that provide one

or more capabilities.

Previously to this change, selection was (simplified) done like this:

1. find the target component

2. select the variant of the target component which matches the requested

attributes

Now, selection introduces another step:

1. find the target component

2. filter variants by eliminating those which do not provide the requested

capabilities

3. select the variant in this list which matches the requested attributes

Several changes had to be implemented:

First, component metadata rules calling `addCapability` will now return

a component which capabilities _include_ the default capability.

Second, attribute filtering is done in a secondary step, which means that

if there are no variant matching the requested capabilities, we will immediately

fail.

    • -2
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 58 more files in changeset.
Allow the services required by a given class to be queried prior to creating any instances of that class. Use this to allow `ArtifactTransformDependencies` to be injected into artifact transforms using any of the service injection patterns (that is, via a constructor or a getter).

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 127 more files in changeset.
Replace most direct usages of `DirectInstantiator` with indirect usages via `InstantiatorFactory` or test fixtures instead. This means more consistent behaviour in unit tests because the objects under test will behave more similarly to how they do at runtime. This also allows the decision of how the instantiation should behave to live in as few places as possible, so this can be more easily evolved and contextualized.

    • -2
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 60 more files in changeset.
Split off value snapshotting and attributes related methods of TestUtil

    • -6
    • +8
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 64 more files in changeset.
Add support for backlinks in dependency graph

A module may declare the platform(s) it belongs to. If it does so, then we implicitly add an outgoing edge

to the platform, allowing us to resolve all dependencies belonging to the same platform consistently. This

allow us to implement _module alignment_, by telling that 2 modules belong to the same platform. In practice,

there are 2 possible cases:

1. the "platform" a module belongs to exists, in which case, an outgoing edge is added to a "published module",

and this module is expected to have constraints onto the other modules of the same platform.

2. the "platform" a module belongs to doesn't exist, for example because the publisher didn't define

such a thing. In that case, a platform can be constructed "adhoc", and we will try to use modules of the same

version as the platform whenever possible.

The second case is significantly more expensive as it forces us to create "virtual" dependencies, and for each

of them we need to check if the target modules exist.

    • -3
    • +5
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 18 more files in changeset.
Refactor ModuleResolveMetadata

Reorganize code in packages, move serialization related code closer to

classes to reduce need of public methods.

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 79 more files in changeset.
Refactor ModuleResolveMetadata

Reorganize code in packages, move serialization related code closer to

classes to reduce need of public methods.

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 79 more files in changeset.
Normalize `ModuleIdentifier`

This commit reworks the `ComponentModuleIdentifier`/`ComponentModuleSelector`/`ModuleVersionSelector`

classes to use `ModuleIdentifier` under the hood, instead of storing denormalized strings. This has

the advantage that we can reduce the use of the module identifier factory, which is called very

often during dependency resolution. Sharing instances reduces the need for conversions, and makes

comparisons faster.

    • -3
    • +4
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 164 more files 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

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 53 more files in changeset.
Intern strings when reading module metadata from cache

Dependency resolution of large dependency graphs involves a significant

number of comparisons of strings(group, artifact, version, ...). Most of

those come from the module metadata cache, and even if we use hashmaps,

we still need to perform `equals` comparisons on strings, when in most

of the cases they should be identical. This commit takes advantage of

knowing that to add a cost when we read module metadata (interning), but

realizing that the debt is paid when comparing strings during resolution.

The interner is build scoped (in order to avoid memory leaks), thread-safe,

and shared with the dependency notation converter, so that module selectors

created from strings found in the build scripts are using the same strings

as the ones from the module metadata cache.

Ideally, we should also do this for the strings used during parsing.

    • -2
    • +3
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 17 more files in changeset.
Honor constraint attribute during selection

This commit makes sure that attributes from all selectors are used during

selection, including the attributes from constraints. It does not, however,

make sure that those attributes are consistent (compatible).

    • -1
    • +2
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 13 more files in changeset.
Add reason to `DependencyMetadata`

This allows propagating reasons from `Dependency` to `DependencyMetadata`, which in turn can be used

as `ComponentSelectionReason` descriptions. Doing this lets us display the description in the dependency

insight report.

This commit, however, does **not** add support for serializing reasons, or publishing them. This means

that this only works for direct dependencies so far.

Signed-off-by: Cedric Champeau <cedric@gradle.com>

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 26 more files in changeset.
Rename 'experimental features' to 'feature previews'

The idea behind this is that we have a set of feature previews rather

than one cryptic experimental flag.

A feature preview collects a set of related functionality (e.g.

everything related to gradle metadata) that changes existing behavior

and thus could potentially break existing builds. The preview options

will be removed with the next major release (currently 5.0) and the new

behaviour will then become the default.

Signed-off-by: Jendrik Johannes <jendrik@gradle.com>

    • -1
    • +1
    ./ComponentMetadataDetailsAdapterTest.groovy
  1. … 45 more files in changeset.