DefaultComponentMetadataHandlerTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Revert "Revert "Merge branch 'release'""

This reverts commit 67b8bb8f18f854f45a2f5ec52cc9c8a25981e2f2.

This restores the merge attempt from earlier.

    • -2
    • +2
    ./DefaultComponentMetadataHandlerTest.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
    ./DefaultComponentMetadataHandlerTest.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
    ./DefaultComponentMetadataHandlerTest.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
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 16 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

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

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

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

    • -4
    • +3
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 32 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).

    • -2
    • +2
    ./DefaultComponentMetadataHandlerTest.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.

    • -3
    • +2
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 60 more files in changeset.
Move in-memory caches to persistent-cache project

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

    • -4
    • +6
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 64 more files in changeset.
Move ValueSnapshotter and friends to snapshots project

    • -1
    • +1
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 54 more files in changeset.
Remove unused improve pom support flags

    • -1
    • +1
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 19 more files in changeset.
Support mixing old style and class based rules

The recently addition of class based component metadata rules came with

a limitation in the way old style and class based rules could be mixed.

This commit removes the limitation by allowing mixed addition of each

type of rules, while preserving the execution order based on addition

order.

Fixes #6568

    • -33
    • +72
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 8 more files in changeset.
Add pom support feature to cache key for metadata rules

The IMPROVED_POM_SUPPORT feature preview has a direct impact on metadata

resolution. As such, changing that value must invalidate the component

metadata rule cache.

    • -1
    • +1
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 5 more files in changeset.
Refactor ModuleResolveMetadata

Reorganize code in packages, move serialization related code closer to

classes to reduce need of public methods.

    • -2
    • +2
    ./DefaultComponentMetadataHandlerTest.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.

    • -2
    • +2
    ./DefaultComponentMetadataHandlerTest.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.

    • -2
    • +4
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 164 more files in changeset.
Enable service injection in ComponentMetadataRule

This is currently limited to the RepositoryResourceAccessor and is not

available for flat dir repositories.

Fixes #5565

    • -55
    • +9
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 43 more files in changeset.
Create and wire in a ComponentMetadataRuleExecutor

This enables ComponentMetadataRule execution to be cached

Update the CrossBuildCachingRuleExecutor to work with a set of rule

instead of a single one. This means we cache or miss on a chain of rules

instead of single rules.

Fixes #5526

    • -18
    • +28
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 32 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

    • -2
    • +2
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 53 more files in changeset.
Rework generics around RuleAction adapter and validator

The class itself does not need to be generic, only the methods.

    • -1
    • +1
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 8 more files in changeset.
Implement class based rules handling

This includes introducing a type wrapping ComponentMetadataDetails and

IvyModuleDescriptor to be used as the action target.

Issue #5261

    • -0
    • +98
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 6 more files in changeset.
Fix component metadata rules not applied on user provided metadata

This commit fixes the fact that component metadata rules were not applied

on "user provided" metadata. User provided metadata comes from a component

metadata supplier, and is only used during selection. If, for whatever

reason, metadata rules needed to change the "shallow" metadata at this

point, then we would fail resolution because those rules were not applied.

This is done by creating an adapter which is just going to apply the rules

that make sense on shallow metadata, which is just for now the status and

the status scheme, but is going to include more in the future (in particular

the component attributes).

    • -2
    • +2
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 13 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
    • +4
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 17 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
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 45 more files in changeset.
Provide additional services to constructor calls in tests

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

    • -1
    • +1
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 14 more files in changeset.
Initial implementation of component metadata rules allowing modification of variant attributes

This commit introduces metadata rules that support modification of variant attributes. Variant attributes

are specific to each variant and can be found in module metadata. Those are NOT component level attributes,

which could be used during dependency resolution. This will be added in a subsequent commit.

    • -2
    • +3
    ./DefaultComponentMetadataHandlerTest.groovy
  1. … 49 more files in changeset.
Instantiate mutable Maven metadata through dependency injecting instantiator

This commit prepares the ability to inject services into mutable Maven metadata. This will be

required to inject the immutable attributes factory, as well as the object instantiator and

possibly other services to the immutable Maven resolve metadata. This commit reduces the

number of constructors of `DefaultMavenModuleResolveMetadata`, to make it easier to maintain.

Some tests still create mutable module resolve metadata directly. Ideally, they should also

use the factory.

    • -2
    • +1
    ./DefaultComponentMetadataHandlerTest.groovy