AbstractFileCollectionTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix mapping the contents of a `FileTree` that contains a file (rather than a directory) as a root to an Ant `FileSet`.

This fixes the Checkstyle task when source files are added directly to the task sources.

    • -392
    • +0
    ./AbstractFileCollectionTest.groovy
  1. … 15 more files in changeset.
Rename file collection visitor type and visit method.

  1. … 33 more files in changeset.
Some refactoring of file collection visitor.

  1. … 19 more files in changeset.
Change file collection `visitLeafCollections()` so that visitor receives a 'source' object and `Iterable<File>` that describes a file collection, instead of a `FileCollection` instance.

Change visiting of the outputs of artifact transforms so that an empty collection is visited when its 'spec' is requested by the visitor. The 'source' object can be used to carry details about the output variant to the instant execution serializer.

  1. … 25 more files in changeset.
Rework visiting a `Configuration` so that its contents are treated as a sequence of collections, rather than a single monolithic collection of files. This will allow visitors such as continuous build or instant execution some finer-grained visibility into the contents of the `Configuration`.

In this commit, the collections do not carry any useful information and the granularity is per artifact, which is too fine-grained. Later commits will address this.

  1. … 27 more files in changeset.
Merge `FileCollection.registerWatchPoints()` into `visitLeafCollections()`, so that a visitor can optionally receive the 'spec' or definition for each participant in a file collection.

This will also later be used by instant execution to serialize some file collection participants as files and some as definitions.

  1. … 19 more files in changeset.
Allow a `FileCollection` visitor to skip visiting the output of artifact transforms, and use this when serializing file collections to the instant execution cache.

This is only intended to be a basic step towards allow visitors better control over what to visit and in what form to visit. In this step, the API is specific to artifact transforms but will be made more general in later changes.

    • -1
    • +14
    ./AbstractFileCollectionTest.groovy
  1. … 22 more files in changeset.
Change `FileCollection` implementations so that they all expose their task dependencies via `TaskDependencyContainer` rather than a mix of `Buildable` and `TaskDependencyContainer`.

  1. … 15 more files in changeset.
Add `FileCollection.getElements()`, which returns a view of the collection elements as a `Provider<Set<FileSystemLocation>>`. This can then be used, for example, as an input to a `Property`.

    • -41
    • +12
    ./AbstractFileCollectionTest.groovy
  1. … 7 more files in changeset.
Replace 'Matchers' with 'CoreMatchers'

So we do not require 'org.hamcrest:hamcrest-library' as additional

dependency anymore. Which was only available for most of the tests

because it leaked onto the test compile classpath.

  1. … 162 more files in changeset.
Rename FileCollectionVisitor to FileCollectionLeafVisitor

Better naming should clarify what the visitor is supposed to do.

  1. … 13 more files in changeset.
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.

  1. … 443 more files in changeset.
Remove FileCollection.add

#6273

    • -10
    • +0
    ./AbstractFileCollectionTest.groovy
  1. … 6 more files in changeset.
Remove FileCollection.asType()

#6270

    • -178
    • +142
    ./AbstractFileCollectionTest.groovy
  1. … 4 more files in changeset.
Remove FileCollection.stopExecutionIfEmpty()

#6269

    • -23
    • +0
    ./AbstractFileCollectionTest.groovy
  1. … 5 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. … 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.

    • -35
    • +43
    ./AbstractFileCollectionTest.groovy
  1. … 5 more files in changeset.
Deprecate FileCollection.asType()

The method was used to add some special conversions for `FileCollection` in Groovy. In an attempt to remove Groovy-specific functionality from public API the method is now deprecated. The type conversions, while not widely used to start with, will mostly keep working because `FileCollection` implements `Iterable<File>` which Groovy know how to convert to other collections.

    • -24
    • +36
    ./AbstractFileCollectionTest.groovy
  1. … 4 more files in changeset.
Use the same `FileCollectionSnapshotter` implementation for both declared and discovered input files.

    • -0
    • +12
    ./AbstractFileCollectionTest.groovy
  1. … 18 more files in changeset.
Fix unit test

+review REVIEW-5956

Fixing broken test and cleaning up casting in AbstractFileTree

+review REVIEW-5641

  1. … 1 more file in changeset.
Adding explicit support for FileCollection.plus(Iterable<FileCollection>) to fix https://discuss.gradle.org/t/gradle-2-8-rc-1-is-now-available-for-testing/11953/11

+review REVIEW-5641

    • -13
    • +89
    ./AbstractFileCollectionTest.groovy
  1. … 7 more files in changeset.
Converting AbstractFileCollectionTest to Spock

+review REVIEW-5641

    • -0
    • +374
    ./AbstractFileCollectionTest.groovy
  1. … 1 more file in changeset.