CachingFileHasherTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Rename FileMetadata{Snapshot -> }

Snapshot doesn't add anything to the name.

  1. … 50 more files in changeset.
Determine symlink access in stat

This way we can use the information when deciding what to

watch.

  1. … 10 more files in changeset.
Determine symlink access in stat

This way we can use the information when deciding what to

watch.

  1. … 10 more files in changeset.
Determine symlink access in stat

This way we can use the information when deciding what to

watch.

  1. … 10 more files in changeset.
Rename DefaultFileMetadata{ -> Snapshot}

so it is consistent with the interface.

  1. … 9 more files in changeset.
Rename DefaultFileMetadata{ -> Snapshot}

so it is consistent with the interface.

  1. … 9 more files in changeset.
Force AbstractTestDirectoryProvider to use Class (#12431)

Closes https://github.com/gradle/gradle-private/issues/2988

This PR adds `className` to `AbstractTestDirectoryProvider` so there'll be no more `unknown-test-class`.

  1. … 407 more files in changeset.
Fix tests

  1. … 372 more files in changeset.
Move DefaultFileMetadata to impl package

  1. … 12 more files in changeset.
Revert "Revert "Merge pull request #9840 from gradle/lptr/files/simplify-file-matchers""

This reverts commit 669ec8c0211ad7e36ec4a91921e2da5da8619bef.

  1. … 324 more files in changeset.
Revert "Merge pull request #9840 from gradle/lptr/files/simplify-file-matchers"

This reverts commit 72dc39d9784910196e7840ac35317bc46ef4c4a1, reversing

changes made to 69ffd7ea87b343cb6f0f03b947b7605a5bea02b1.

  1. … 324 more files in changeset.
Move DefaultFileMetadata to :files

  1. … 11 more files in changeset.
Move API classes back to :base-serivces

  1. … 32 more files in changeset.
Divorce TaskHistoryStore and CrossBuildFileHashCache

These two should have never implemented one another.

  1. … 5 more files in changeset.
Simplify TaskHistoryStore API

Replaced two similar methods with one, and made PersistentIndexedCacheParameters immutable and nicer to instantiate.

  1. … 21 more files in changeset.
Use MD5 as the default hashing function

  1. … 38 more files in changeset.
Use our own hashing architecture, take 2 (#2817)

This replaces Guava's hashing. We need this for two reasons:

- it allows the addition of custom hash functions, like BLAKE2b which would not be possible with Guava's closed design

- it fixes a few performance issues that Guava only fixes in version 20 (which we can't upgrade to right now, because we still need to support Java 5 in places)

  1. … 159 more files in changeset.
Move FileHasher to base-services

+review REVIEW-6562

  1. … 74 more files in changeset.
Hash script sources separately

+review REVIEW-6562

  1. … 22 more files in changeset.
Fixed unit test for java 9 on linux.

Use `stat()` instead of `File` operations `CachingFileHasher.hash(File)`, which is almost always faster and often has a finer-grained resolution for last modified timestamp. Also changed `JarCache` to reuse `FileHasher` instead of reimplementing the same logic that determines whether a file has changed. This logic has moved on quite a bit since `JarCache` was implemented. Now, further improvements to accuracy or performance will be reused by `JarCache`.

Removed `sleep()` from functional tests as these should no longer be required thanks to the reuse.

  1. … 8 more files in changeset.
Changed `FileMetadataSnapshot` into an interface.

  1. … 6 more files in changeset.
Deal with the case when running tests where a build script is changed immediately after a build completes and the daemon which ran the build runs some other build before returning to run the first build again.

  1. … 3 more files in changeset.
Moved the specification of the maximum size of the in-memory cache for a persistent indexed cache, so that the client that creates the cache is responsible for providing the target maximum size.

This change allows in-memory caching and asynchronous cache writes to be reused for any cache, rather than to only a hard-coded set of 5 caches that the infrastructure happens to know about.

Also changed the strategy for maintaining the in-memory caches across builds. Rather than a hard-coded limit of 10 caches, the caches used during the current and previous build sessions are retained using hard references. All other caches are retained using soft references. This is an intentionally simple strategy, pending some more sophisticated infrastructure for invalidating the in-memory caches and their entries. It should behave better than the previous strategy when running builds that have many nested builds (eg composite builds or buildSrc builds) and when running several different builds on the same machine.

  1. … 18 more files in changeset.
Added an overload of `FileHasher.hash()` that accepts a `FileMetadataSnapshot`. Use this when snapshotting a file instead of creating a temporary `FileVisitDetails` wrapper.

  1. … 5 more files in changeset.
An attempt to detect file changes that occur between build invocations, when there is no significant delay between the invocations. For example, this often happens when testing or benchmarking a build, where the test or benchmark makes changes to the source or build files between the build invocations. This particular problem has caused grief to pretty much every single person who has ever written a functional test for Gradle or a plugin.

More precisely, this change attempts to detect file changes that happened immediately after the completion of the previous build. The approach may be over eager in re-hashing of the final outputs of the previous build, and may need some tweaking, for example, by applying the strategy only to input files.

  1. … 8 more files in changeset.
Spike compile avoidance using compile classpath aware hashing strategy

  1. … 54 more files in changeset.
Rename CachingFileSnapshotter to CachingFileHasher

To remain backwards compatible, we need to keep the original type so we don't change the return type of JavaCompile.getCachingFileSnapshotter().

+review REVIEW-6303

    • -0
    • +141
    ./CachingFileHasherTest.groovy
  1. … 6 more files in changeset.