cleanup

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Replace usages of `FileResolver.resolveFile()` with `FileCollectionFactory.resolving()` or `FileOperations.immutable()`, so that `FileResolver` can be responsible only for converting scalar values to File-ish values.

    • -5
    • +2
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 41 more files in changeset.
Replace usages of `FileResolver.resolveFile()` with `FileCollectionFactory.resolving()` or `FileOperations.immutable()`, so that `FileResolver` can be responsible only for converting scalar values to File-ish values.

    • -5
    • +2
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 41 more files in changeset.
Replace usages of `FileResolver.resolveFile()` with `FileCollectionFactory.resolving()` or `FileOperations.immutable()`, so that `FileResolver` can be responsible only for converting scalar values to File-ish values.

    • -5
    • +2
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 41 more files in changeset.
Replace usages of `FileResolver.resolveFile()` with `FileCollectionFactory.resolving()` or `FileOperations.immutable()`, so that `FileResolver` can be responsible only for converting scalar values to File-ish values.

    • -5
    • +2
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 41 more files in changeset.
Fixes for previous commit.

    • -2
    • +3
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 16 more files in changeset.
Fixes for previous commit.

    • -2
    • +3
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 16 more files in changeset.
Fixes for previous commit.

    • -2
    • +3
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 16 more files in changeset.
Introduce a factory service to create instances of `TaskDependency`, to allow the implementations to be contextualized and to use types that aren't part of the (internal) core API.

Use this factory in `DefaultConfigurableFileCollection`.

    • -2
    • +3
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 39 more files in changeset.
Introduce a factory service to create instances of `TaskDependency`, to allow the implementations to be contextualized and to use types that aren't part of the (internal) core API.

Use this factory in `DefaultConfigurableFileCollection`.

    • -2
    • +3
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 39 more files in changeset.
Dogfood ImmutableFileCollection in tests (#4972)

Reduce the number of static factory methods from ImmutableFileCollection

Use layout.fileFor() in a smoke test

    • -2
    • +2
    ./DefaultBuildOutputCleanupRegistryTest.groovy
  1. … 32 more files in changeset.
Cleanup stale output files during execution (#2572)

We now keep a registry of all the outputs generated by Gradle which will be reset on each version change. If Gradle encounters an existing output file, then it will remove it if is not part of the registered outputs and owned by Gradle/the build. We do also not remove directories containing outputs from different tasks.

The check to delete the stale outputs happens now just before the task executes and not up-front as it did before.

The `build` directory and all delete targets of the `clean` task are registered as owned by Gradle and are considered safe to delete.

Currently, the set of recorded task output files is only growing if we do not change the Gradle version. In the future we can improve on this by also detecting that some directories where removed (e.g. by running a clean task) and reflect this in the registry.

Fixes #1168

Fixes #973

+review REVIEW-6557

    • -96
    • +0
    ./BuildOutputCleanupCacheTest.groovy
    • -16
    • +32
    ./DefaultBuildOutputCleanupRegistryTest.groovy
    • -94
    • +0
    ./DefaultBuildOutputDeleterTest.groovy
  1. … 30 more files in changeset.
Show stale output cleanup message on info level

    • -2
    • +1
    ./DefaultBuildOutputDeleterTest.groovy
  1. … 4 more files in changeset.
Clarify messages produced when deleting old output directories

+review REVIEW-6521

    • -1
    • +2
    ./DefaultBuildOutputDeleterTest.groovy
  1. … 4 more files in changeset.
Make sure the deleter doesn't do anything else

+review REVIEW-6424

    • -0
    • +2
    ./DefaultBuildOutputDeleterTest.groovy
Add BuildOutputCleanup implementation

- Detect Gradle version changes by keeping a `built.bin` in the project cache dir

- Register a listener that triggers clean up at the end of the configuration phase

- The build output cleanup cache only invokes the deleter when the marker file is missing

- Provide a registry that plugins can contribute output files to

- In LifecycleBasePlugin (the base plugin), register the buildDir and clean task target files

- Use a build operation when cleaning stale output files

+review REVIEW-6424

    • -0
    • +96
    ./BuildOutputCleanupCacheTest.groovy
    • -0
    • +54
    ./DefaultBuildOutputCleanupRegistryTest.groovy
    • -0
    • +92
    ./DefaultBuildOutputDeleterTest.groovy
  1. … 16 more files in changeset.