ModuleMetadataStoreTest.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.

  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.

  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

  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.

  1. … 16 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

  1. … 30 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

  1. … 32 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

  1. … 32 more files in changeset.
Replace another usage of the `NamedObjectInstantiator` singleton with an injected service.

  1. … 32 more files in changeset.
Further deduplication of serialized metadata

Maven dependency metadata de-duplication now happens as well when

serializing untransformed metadata.

Fixes #8311

  1. … 7 more files in changeset.
Remove unused field

Remove unused field

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.

  1. … 18 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.

  1. … 18 more files in changeset.
Split off value snapshotting and attributes related methods of TestUtil

  1. … 64 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.
Improve test readability

  1. … 2 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.

  1. … 164 more files in changeset.
Don't clean up metadata descriptors

Metadata descriptors are small (about 4 KB) and thus don't need to be

cleaned up.

    • -21
    • +21
    ./ModuleMetadataStoreTest.groovy
  1. … 4 more files in changeset.
Track artifact cache file access in PersistentIndexedCache

This commit introduces the `FileAccessJournal` interface and provides

two implementations:

ModificationTimeFileAccessJournal::

Reads and sets `File.lastModified()`.

IndexedCacheBackedFileAccessJournal::

Uses a PersistentIndexedCache to store the access timestamp.

The latter is now used in DefaultCacheLockingManager for the artifact

cache. All other PersistentCaches still use the former.

  1. … 30 more files in changeset.
Mark cached files accessed when resolved via index

Both CachingModuleComponentRepository and

DefaultCacheAwareExternalResourceAccessor use an index to resolve

cached artifacts. Both now notify the underlying FileStore which now

implements FileAccessTracker. The new AccessTrackingFileStore interface

combines both interfaces so the GroupedAndNamedUniqueFileStore

subclasses (ArtifactIdentifierFileStore and ExternalResourceFileStore)

can be injected into dependent components.

    • -22
    • +22
    ./ModuleMetadataStoreTest.groovy
  1. … 32 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.

  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. … 45 more files in changeset.
Provide additional services to constructor calls in tests

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

  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.

  1. … 49 more files in changeset.
Removed the legacy `ModuleDescriptorState` type from the various metadata types. All data is now contained in properties on the relevant metadata types, rather than spread or duplicated across the metadata and the descriptor types.

  1. … 23 more files in changeset.
Moved the module level exclude rule definitions and branch property for Ivy metadata from the legacy `ModuleDescriptorState` onto the relevant metadata types. The Maven metadata has no module level excludes or branch property, so don't persist these for Maven modules.

Incremented the cache layout version to reflect the changes to the persisted metadata.

  1. … 26 more files in changeset.
Some simplifications to the Ivy and Maven metadata parsing. Don't extract and persist the `description` and `publicationDate` properties for Ivy and Maven as these values are not required for dependency resolution. Incremented the cache version to reflect this change.

Removed some dead code that attempted to include a `description` in a generated ivy.xml, as there is no way to specify this in the Gradle DSL.

Moved some Maven metadata properties from constructor parameters to mutable properties.

  1. … 17 more files in changeset.
Cache module version identifiers

In a similar way to module identifiers, use the module identifier factory to cache the module version identifiers.

It allows faster comparisons as we will hit `a==b` much more often and don't have to go the `equals` route. There

are still places where the factory is not used, but it doesn't seem to have a huge impact on performance.

  1. … 49 more files in changeset.
Turn `ModuleExclusions` into a build scoped service

  1. … 53 more files in changeset.
Pass module identifier factory down to the module metadata serializer

  1. … 4 more files in changeset.