DirectoryBuildCacheServiceTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Move FileAccessTracker to :files

    • -1
    • +1
    ./DirectoryBuildCacheServiceTest.groovy
  1. … 25 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.

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

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

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

    • -1
    • +2
    ./DirectoryBuildCacheServiceTest.groovy
  1. … 103 more files in changeset.
Mark files accessed when storing them

Prior to this commit files were only marked accessed when loading them.

This relied on the implicit knowledge that the file's modification

timestamp was used to keep track of access. Now that we use a separate

journal we need to mark it accessed when it's created as well.

    • -5
    • +67
    ./DirectoryBuildCacheServiceTest.groovy
  1. … 1 more file in changeset.
Clean up least recently used entries in artifacts file store

The files in the artifacts file store cache are now automatically

cleaned up based on a least recently used strategy. The structure in

the cache is as follows:

- modules-2

- files-2.1

- groupId

- artifactId

- version

- hash1 (*)

- file

- hash2 (*)

- file

The cache now keeps track of files accessed inside the marked hash

directories. The cleanup action then deletes all such files that have

not been accessed in the last 30 days.

    • -1
    • +3
    ./DirectoryBuildCacheServiceTest.groovy
  1. … 15 more files in changeset.
Clean up partial files after errors and during GC

Previously '.part' files were left behind after local cache failures, because we expected they would be useful in debugging these cases. That never happened, so we are now removing them even if there's an error, and also during garbage collection.

Signed-off-by: Lóránt Pintér <lorant@gradle.com>

    • -2
    • +2
    ./DirectoryBuildCacheServiceTest.groovy
  1. … 5 more files in changeset.
Move 'org.gradle.caching' to build-cache

+review REVIEW-6562

    • -0
    • +71
    ./DirectoryBuildCacheServiceTest.groovy
  1. … 150 more files in changeset.