collections

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Move file collection APIs out of core (#6525)

This change breaks out code that directly relates to handling `FileCollection`s and their build dependencies (called `TaskDependency` at this time) into a separate subproject (`:files`). This is so that other modules can build on just this module instead of having to depend on the oversized `:core`.

As part of the change `Provider`s have been moved to `:base-services`. In a possible followup step `:base-services` could be split into a module that captures the very basic concepts of Gradle's data model: it's all about `DomainObjectCollection`s that can be configured via `Action`s, transformed via `Transformer`s, lazyness can be provided via `Provider`s and rich mutable data types can be created via `Property` objects.

Another addition to `:base-serivces` is the directed graph traversal algorithms used in many parts of Gradle.

    • -95
    • +0
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
    • -124
    • +0
    ./DefaultConfigurableFileCollection.java
    • -179
    • +0
    ./DefaultConfigurableFileTree.java
    • -54
    • +0
    ./DefaultDirectoryFileTreeFactory.java
    • -68
    • +0
    ./DefaultDirectoryWalkerFactory.java
    • -258
    • +0
    ./DefaultFileCollectionResolveContext.java
  1. … 429 more files in changeset.
Remove SimpleFileCollection

#6274

  1. … 2 more files in changeset.
Use immutable file collections whenever possible (#5797)

- Stop DefaultProject implementing FileOperations/ProcessOperations

- Stop BasicScript implementing FileOperations/ProcessOperations

- FileResovler.resolveUri() is not nullable

    • -1
    • +9
    ./DefaultConfigurableFileCollection.java
  1. … 37 more files in changeset.
Wire `FileCollection` to task dependency when constructed from `TaskProvider`

See https://github.com/gradle/gradle-native/issues/737

    • -0
    • +3
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 4 more files in changeset.
Follow dependencies through mapped Providers

    • -3
    • +2
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 5 more files in changeset.
Dogfood ImmutableFileCollection on production code (#4988)

This reverts commit 13eaebc2b1244511dcbff4c59cd41253e3b69642.

  1. … 87 more files in changeset.
Revert "Dogfood ImmutableFileCollection on production code (#4988)"

This reverts commit 834632674ca29b6fd190857947338b2b54a9bb62.

The commit caused a bug in incremental compilation, causing changes

to go undetected.

  1. … 87 more files in changeset.
Dogfood ImmutableFileCollection on production code (#4988)

Use ImmutableFileCollection in production code

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

  1. … 32 more files in changeset.
Add ImmutableFileCollection (#4913)

Add `ProjectLayout.filesFor()` to obtain (immutable) `FileCollection`.

Add `ProjectLayout.mutableFilesFor()` to obtain (mutable) `ConfigurableFileCollection`.

    • -0
    • +150
    ./ImmutableFileCollection.java
  1. … 6 more files in changeset.
Favor using FileCollection.iterator() over FileCollection.getFiles()

In some cases it's cheaper to create the iterator than a full-blown Set.

    • -1
    • +1
    ./DefaultFileCollectionResolveContext.java
  1. … 28 more files in changeset.
Remove AbstractFileCollection.getBuildDependencies()

Instead of returning a new DefaultTaskDependency every time, which is wasteful, let's force implementors to think about what the dependencies of their file collection are.

Also simplified TaskDependencies.EMPTY a bit and used it instead of the aforementioned new DefaultTaskDependency inherited from AbstractFileCollection.

  1. … 4 more files in changeset.
Introduce `DirectoryElementVisitor` to detect broken symbolic links

    • -0
    • +29
    ./DirectoryElementVisitor.java
    • -0
    • +54
    ./FailOnBrokenSymbolicLinkVisitor.java
  1. … 6 more files in changeset.
Declare optional `DefaultFileOperations` arguments as `@Nullable`

`DefaultFileOperations` is used by the `kotlin-dsl` and Kotlin won't

allow non nullable parameters to be given null arguments.

    • -5
    • +6
    ./DefaultConfigurableFileCollection.java
  1. … 4 more files in changeset.
When a `Provider` is resolved to a `FileCollection`, fail rather than ignore when the provider has no value.

    • -4
    • +2
    ./DefaultFileCollectionResolveContext.java
  1. … 1 more file in changeset.
Introduce the binary container to XCTest plugin

Signed-off-by: Daniel Lacasse <daniel@gradle.com>

    • -0
    • +7
    ./DefaultFileCollectionResolveContext.java
  1. … 11 more files in changeset.
Discover task dependencies via Buildable task inputs

When registering task input files that implement Buildable and Iterable<File>,

now task dependencies are discovered via getBuildDependencies().

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

    • -4
    • +1
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 1 more file in changeset.
Polish based on review feedback

    • -1
    • +1
    ./DefaultConfigurableFileCollection.java
  1. … 3 more files in changeset.
Added an internal mechanism for the task executor and input property snapshotting to collaborate with rich input file property types, such as `FileCollection`, so that the property value implementation can finalize the property value early the task execution and cache state during task execution to make input calculation, snapshots and querying faster.

The value implementation can implement `LifecycleAwareTaskProperty` to be notified of when it is permitted to finalize the value and cache state and when it should release that state.

    • -3
    • +19
    ./DefaultConfigurableFileCollection.java
  1. … 12 more files in changeset.
Cache more file patterns

The caching file pattern factory was not passed around everywhere

it should be, resulting in many patterns being created from scratch.

Still there are plenty of places where we don't have the necessary

context to pass the factory and we *always* create the default exclude

specs, which are quite numerous. For this reason, the normal pattern

spec factory now caches the default excludes, which do not need any

sophistocated cache policy, since they are unlikely to ever change.

We should re-evaluate if we can make our String->Spec conversion cheaper.

Also if we can't make it cheaper, we should try to remove the spec

factory from the PatternSet API and instead pass it in as a parameter

when we actually want to walk the tree.

fixup patterns

    • -5
    • +11
    ./DefaultFileCollectionResolveContext.java
  1. … 3 more files in changeset.
Remove canonicalization from DirectoryFileTree

This removes some configuration time overhead and makes

input/output snapshotting consistent with regards to changes

in symlink. We now always ignore the fact that a file/directory

was replaced by a symlink (but the content stayed the same). There

might be some tasks that actually need to make a difference between

a file and a link to a file, but for those we should provide an

opt-in to canonical snapshotting, as it is quite expensive to do it

consistently (i.e. canonicalize every file in the whole tree).

  1. … 1 more file in changeset.
WIP

    • -1
    • +5
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 4 more files in changeset.
Extracted `DirectoryProperty` and `RegularFileProperty` as replacements for `DirectoryVar` and `RegularFileVar`.

Changed `AbstractTask.newOutputDirectory()`, `newInputFile()` and `newOutputFile()` to return the new types, which is a breaking change.

    • -3
    • +3
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 26 more files in changeset.
Do not check permission's of files if they've been excluded (#2758)

Do not check permission's of files if they've been excluded

  1. … 3 more files in changeset.
Fix some issues using `Path` to express task input and output locations.

    • -1
    • +3
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 6 more files in changeset.
Added APIs that allow a specific task output directory or output file to be wired in as an input for another task, in a way that allows the task dependencies to be inferred and that deals with later changes to the configured locations of those outputs. This is intended to be a more robust, performant and descriptive alternative to using `File` property types and calls to `Task.dependsOn`

Specifically, added factory methods on `DefaultTask` to allow a task implementation class to create `DirectoryVar` instances that represent an output directory, and `RegularFileVar` instances that represent an output file or directory. When used as an output directory or file property, these instances carry dependency information about the producing task. When used as an input file property, the producing task is tracked as a dependency of the consuming task.

Similar support for input files is done using `ConfigurableFileCollection` and friends, as has been possible for quite a while. There is intentionally no concept of an input directory in these changes. However, it is possible to view a `Directory` or `DirectoryVar` as a `FileTree` which can be wired in as a task input.

    • -3
    • +6
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 14 more files in changeset.
Fixed `Project.file()` and `Project.files()` to properly handle `Directory` and `RegularFile`. Also fixed `Project.files()` when presented a `Path` instance. Added some test coverage and updated the Javadocs on `Project`.

    • -0
    • +3
    ./DefaultFileCollectionResolveContext.java
  1. … 6 more files in changeset.
Exclude Path in BuildDependenciesOnlyFileCollectionResolveContext

    • -2
    • +3
    ./BuildDependenciesOnlyFileCollectionResolveContext.java
  1. … 1 more file in changeset.
Remove deprecated constructors on DirectoryFileTree (#1776)

    • -1
    • +2
    ./DefaultFileCollectionResolveContext.java
  1. … 18 more files in changeset.
Use directory walker for reproducible archives

Instead of sorting the files after reading them from disk we

use `ReproducibleDirectoryWalker` to directly read them from disk in

a reproducible way independent of the file system.

This has the advantage that we do not add some special handling for

zipTree and tarTree. It probably has some performance impact when

having walking the file system but the impact should actually be

less than sorting afterwards since we sort smaller lists and we do

not need to keep all the file names in an archive in memory.

    • -0
    • +79
    ./AbstractDirectoryWalker.java
    • -0
    • +37
    ./ReproducibleDirectoryWalker.java
  1. … 25 more files in changeset.