DefaultArtifactResolutionCacheTest.groovy

Clone Tools
  • last updated 13 mins ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Introduce a checksum file cache service

This service is responsible for caching the checksums computed from

local file system. Because it's also used for dependency verification

writing and checking, this cache uses the existing infrastructure which

makes sure that if a file is updated locally, we expire the entry in

the cache.

This is done because there are lots of places in the code where we

used the legacy `HashUtil` class, which has no caching whatsoever.

It's, however, quite common to have a build which generates sha1

checksums multiple times for the same file. For example, during

publication.

    • -2
    • +2
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 102 more files in changeset.
Introduce a checksum file cache service

This service is responsible for caching the checksums computed from

local file system. Because it's also used for dependency verification

writing and checking, this cache uses the existing infrastructure which

makes sure that if a file is updated locally, we expire the entry in

the cache.

This is done because there are lots of places in the code where we

used the legacy `HashUtil` class, which has no caching whatsoever.

It's, however, quite common to have a build which generates sha1

checksums multiple times for the same file. For example, during

publication.

    • -2
    • +2
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 102 more files in changeset.
Introduce a checksum file cache service

This service is responsible for caching the checksums computed from

local file system. Because it's also used for dependency verification

writing and checking, this cache uses the existing infrastructure which

makes sure that if a file is updated locally, we expire the entry in

the cache.

This is done because there are lots of places in the code where we

used the legacy `HashUtil` class, which has no caching whatsoever.

It's, however, quite common to have a build which generates sha1

checksums multiple times for the same file. For example, during

publication.

    • -2
    • +2
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 102 more files in changeset.
Introduce a checksum file cache service

This service is responsible for caching the checksums computed from

local file system. Because it's also used for dependency verification

writing and checking, this cache uses the existing infrastructure which

makes sure that if a file is updated locally, we expire the entry in

the cache.

This is done because there are lots of places in the code where we

used the legacy `HashUtil` class, which has no caching whatsoever.

It's, however, quite common to have a build which generates sha1

checksums multiple times for the same file. For example, during

publication.

    • -2
    • +2
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 103 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 9 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 9 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 10 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 9 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 10 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 9 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 9 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 10 more files in changeset.
Update module cache content

Reference to file are now relative to the root of the module cache

instead of being absolute.

This should allow moving the full module cache around to be reused with

a different root path.

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 7 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 10 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 9 more files in changeset.
No more absolute path in metadata cache

Reference to file are now relative to the root of the module cache

instead of being absolute.

This allows moving the full module cache around to be reused with

a different root path.

The path are also normalized, so that they are portable across systems

where the name separator changes.

Issue #1338

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 9 more files in changeset.
Rename to ArtifactCacheLockingManager

The name CacheLockingManager suggested it was used to manage locking of

caches in general instead of just for the artifacts cache.

Resolves gradle/gradle-private#1338.

    • -2
    • +2
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 28 more files in changeset.
Track file access in AbstractCachedIndex

Instead of tracking access in DefaultCacheAwareExternalResourceAccessor

and CachingModuleComponentRepository this is now done in

AbstractCachedIndex which ensures it's done always when reading from

indexes of CachedItems and only does so when not already present in an

in-memory cache from a previous lookup.

    • -18
    • +5
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 39 more files in changeset.
Fixed unit test.

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
Some changes to caching of external resources:

- Moved the file store to live under `caches/modules-2` as the file store is protected by the lock on this directory. The external resource metadata is cached under this directory as well.

- Use a hash of the _content_ of the external resource to calculate the resource's location in the file store, so that entries never need to be overwritten. Previously a hash of the _location_ of the external resource was used. Also include the base name from the URL to allow a human to get some idea of what each file contains.

- Use custom serialization rather than Java serialization for the external resource metadata cache.

- Renamed a couple of metadata caches to better reflect their purpose.

    • -7
    • +46
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 15 more files in changeset.
Fixed tests for changes to method signatures.

    • -5
    • +6
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 3 more files in changeset.
Added ExternalResourceMetaData.contentType and use this to do content listing of HTTP resources instead of bolting directly on to the HTTP response.

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 11 more files in changeset.
Renamed package o.g.messaging.serialize to o.g.internal.serialize.

    • -1
    • +1
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 171 more files in changeset.
Renamed subprojects/core-impl to subprojects/dependency-management.

    • -0
    • +80
    ./DefaultArtifactResolutionCacheTest.groovy
  1. … 1384 more files in changeset.