Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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. … 63 more files in changeset.
Code style improvements

Support concurrent access in DefaultCachedMetadata

The code was optimized to have a singleton map as much as possible. But

lacked the necessary protections to move out of that case.

As soon as we move beyond a single mapping, we use a concurrent map

underneath and the map swap is now properly protected.

Revert introduction of context object

Since the strategy for isolating caches changed, this is not

necessary anymore.

    • -40
    • +0
    ./DefaultModuleMetadataCacheDetails.java
  1. … 2 more files in changeset.
Revert introduction of context object

Since the strategy for isolating caches changed, this is not

necessary anymore.

    • -40
    • +0
    ./DefaultModuleMetadataCacheDetails.java
  1. … 2 more files in changeset.
Use builders with expected size

This should in theory make things a bit faster.

Use builders with expected size

This should in theory make things a bit faster.

Make comparison of `ModuleComponentAtRepositoryKey` faster

to mitigate small performance regression due to the isolation

of component metadata rules.

  1. … 6 more files in changeset.
Make comparison of `ModuleComponentAtRepositoryKey` faster

to mitigate small performance regression due to the isolation

of component metadata rules.

  1. … 6 more files in changeset.
Use `int` instead of `HashCode`

As `HashCode` was only overhead.

  1. … 4 more files in changeset.
Use `int` instead of `HashCode`

As `HashCode` was only overhead.

  1. … 4 more files in changeset.
Fix isolation of processed metadata

Introduce a hash of the component metadata rules, so that we can

cache different processed metadata based on the hash. This is a

performance optimization, which allows setting different processed

metadata on the "cached metadata" instance, based on a rules hash.

The rule hash is more stable when using class-based rules. If not,

then we have instance based rules which are opaque to Gradle, meaning

that we're going to create as many instances of processed metadata

as there are rules instantiated.

    • -138
    • +0
    ./DefaultModuleMetadataCache.java
    • -0
    • +1
    ./DefaultModuleMetadataCacheDetails.java
    • -0
    • +138
    ./PersistentModuleMetadataCache.java
  1. … 12 more files in changeset.
Fix isolation of processed metadata

Introduce a hash of the component metadata rules, so that we can

cache different processed metadata based on the hash. This is a

performance optimization, which allows setting different processed

metadata on the "cached metadata" instance, based on a rules hash.

The rule hash is more stable when using class-based rules. If not,

then we have instance based rules which are opaque to Gradle, meaning

that we're going to create as many instances of processed metadata

as there are rules instantiated.

    • -138
    • +0
    ./DefaultModuleMetadataCache.java
    • -0
    • +1
    ./DefaultModuleMetadataCacheDetails.java
    • -0
    • +138
    ./PersistentModuleMetadataCache.java
  1. … 12 more files in changeset.
Introduce context object for caching of metadata

This will make it easier to add additional data without changing all method signatures.

    • -0
    • +39
    ./DefaultModuleMetadataCacheDetails.java
  1. … 3 more files in changeset.
Introduce context object for caching of metadata

This will make it easier to add additional data without changing all method signatures.

    • -0
    • +39
    ./DefaultModuleMetadataCacheDetails.java
  1. … 3 more files in changeset.
Revert per-project caches as it has a very large impact on performance

    • -78
    • +9
    ./ModuleRepositoryCacheProvider.java
  1. … 4 more files in changeset.
Revert per-project caches as it has a very large impact on performance

    • -78
    • +9
    ./ModuleRepositoryCacheProvider.java
  1. … 4 more files in changeset.
Make the in-memory dependency metadata caches per project

    • -9
    • +78
    ./ModuleRepositoryCacheProvider.java
  1. … 5 more files in changeset.
Make the in-memory dependency metadata caches per project

    • -9
    • +78
    ./ModuleRepositoryCacheProvider.java
  1. … 5 more files in changeset.
Use the same decorating pattern for `DefaultModuleArtifactCache`

    • -27
    • +1
    ./artifacts/DefaultModuleArtifactCache.java
    • -1
    • +24
    ./artifacts/InMemoryModuleArtifactCache.java
  1. … 1 more file in changeset.
Use the same decorating pattern for `DefaultModuleArtifactCache`

    • -27
    • +1
    ./artifacts/DefaultModuleArtifactCache.java
    • -1
    • +24
    ./artifacts/InMemoryModuleArtifactCache.java
  1. … 1 more file in changeset.
Decouple `InMemoryModuleArtifactsCache` from `DefaultModuleArtifactsCache`

    • -0
    • +69
    ./artifacts/AbstractArtifactsCache.java
    • -15
    • +6
    ./artifacts/DefaultModuleArtifactsCache.java
    • -39
    • +20
    ./artifacts/InMemoryModuleArtifactsCache.java
  1. … 1 more file in changeset.
Decouple `InMemoryModuleArtifactsCache` from `DefaultModuleArtifactsCache`

    • -0
    • +69
    ./artifacts/AbstractArtifactsCache.java
    • -15
    • +6
    ./artifacts/DefaultModuleArtifactsCache.java
    • -39
    • +20
    ./artifacts/InMemoryModuleArtifactsCache.java
  1. … 1 more file in changeset.
Decouple `InMemoryModuleVersionsCache` from `DefaultModuleVersionsCache`

    • -0
    • +62
    ./dynamicversions/AbstractModuleVersionsCache.java
    • -10
    • +2
    ./dynamicversions/DefaultModuleVersionsCache.java
    • -32
    • +18
    ./dynamicversions/InMemoryModuleVersionsCache.java
  1. … 1 more file in changeset.
Decouple `InMemoryModuleVersionsCache` from `DefaultModuleVersionsCache`

    • -0
    • +62
    ./dynamicversions/AbstractModuleVersionsCache.java
    • -10
    • +2
    ./dynamicversions/DefaultModuleVersionsCache.java
    • -32
    • +18
    ./dynamicversions/InMemoryModuleVersionsCache.java
  1. … 1 more file in changeset.
Decouple `InMemoryModuleMetadataCache` from `DefaultModuleMetadataCache`

Isolate the in-memory caching from the persistent caching, so that we can

later use a different in-memory cache for all projects.

    • -38
    • +18
    ./InMemoryModuleMetadataCache.java
  1. … 2 more files in changeset.
Decouple `InMemoryModuleMetadataCache` from `DefaultModuleMetadataCache`

Isolate the in-memory caching from the persistent caching, so that we can

later use a different in-memory cache for all projects.

    • -0
    • +67
    ./AbstractModuleMetadataCache.java
    • -38
    • +18
    ./InMemoryModuleMetadataCache.java
  1. … 2 more files in changeset.
Fix "platform owners" not being serialized

    • -3
    • +49
    ./ModuleComponentResolveMetadataSerializer.java
  1. … 5 more files in changeset.
Fix caching of component metadata rules in presence of `withDependencies`

This commit fixes several issues with component metadata rule `@CacheableRule`:

1. when using Gradle metadata, the original content hash wasn't set, leading

to incorrect keys in cache. The consequence is that we would fetch from cache

the wrong components.

2. there was a race condition between the component metadata serializer and

the graph resolution, which lead to rules being executed several times, and

actually multiple `DefaultConfigurationMetadata` created for the same components

3. a `ClassCastException` was visible as soon as one rule worked on dependencies

or dependency constraints, because we assume immutability, and that the rule

applicator was actually creating a mutable list

4. realized component metadata wasn't setting the `force` flag properly for

enforced platforms

This fixes #6978

    • -6
    • +2
    ./ModuleComponentResolveMetadataSerializer.java
  1. … 10 more files in changeset.
Avoid the creation of a string to build the path in the file store

This creates a significant amount of garbage. Assuming we read from the store

more often than we write to, this commit builds an array corresponding to the

path in the store, rather than a string.

  1. … 3 more files in changeset.