DefaultProjectLayoutTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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`.

  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`.

  1. … 39 more files in changeset.
Move unit tests to where they belong

    • -423
    • +0
    ./DefaultProjectLayoutTest.groovy
  1. … 1 more file in changeset.
Move unit tests to where they belong

    • -418
    • +0
    ./DefaultProjectLayoutTest.groovy
  1. … 1 more file in changeset.
Move unit tests to where they belong

    • -423
    • +0
    ./DefaultProjectLayoutTest.groovy
  1. … 1 more file in changeset.
Move unit tests to where they belong

    • -418
    • +0
    ./DefaultProjectLayoutTest.groovy
  1. … 1 more file in changeset.
Add `ConfigurableFileCollection.finalizeValue()` to allow the value of the file collection to be finalized.

The initial implementation is too eager, in that it calculates all of the files of the collection. Instead, it should calculate and finalize all of the roots of the collection. Later commits will improve this.

  1. … 14 more files in changeset.
Add `ConfigurableFileCollection.finalizeValue()` to allow the value of the file collection to be finalized.

The initial implementation is too eager, in that it calculates all of the files of the collection. Instead, it should calculate and finalize all of the roots of the collection. Later commits will improve this.

  1. … 14 more files in changeset.
Add `ConfigurableFileCollection.finalizeValue()` to allow the value of the file collection to be finalized.

The initial implementation is too eager, in that it calculates all of the files of the collection. Instead, it should calculate and finalize all of the roots of the collection. Later commits will improve this.

  1. … 14 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Added `getLocationOnly()` to file system properties, to provide lazy access to just the location of the file system element, rather than both the location and the content of the file system element.

This can be used when mapping the location of a task output to produce an input to some other task, without implying a dependency on the producing task. For example, an IDE project file generation task may need to know where some output will end up (so need to know its location) but does not use the content of the output.

  1. … 9 more files in changeset.
Add support for using the various `Property` types with a read-only abstract property on a generated type (in addition to the existing `ConfigurableFileCollection` support).

  1. … 8 more files in changeset.
Add support for using the various `Property` types with a read-only abstract property on a generated type (in addition to the existing `ConfigurableFileCollection` support).

  1. … 8 more files in changeset.
Change some `FileCollection` construction in various core services to delegate to `FileCollectionFactory`. Also merge some `FileCollection` implementations that do the same thing.

  1. … 14 more files in changeset.
Change some `FileCollection` construction in various core services to delegate to `FileCollectionFactory`. Also merge some `FileCollection` implementations that do the same thing.

  1. … 14 more files in changeset.
spelling: resolvable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

  1. … 9 more files in changeset.
Rework task dependency inference so that `Provider` implementations use the same `TaskDependencyContainer` interface that most other things use to declare their producer task to the task resolution infrastructure, rather than having special knowledge sprinkled around various places.

Cleaned up a bunch of `Provider` and `Property` implementations so that more logic is reused rather than reimplemented.

  1. … 30 more files in changeset.
Support propagation of the producer task for provider instances that are created using `Provider.map()`.

Now, when a provider represents a task or task output, whether mapped or not, that task is taken as the producer of the value and the mapping function is not called. Otherwise, the value of the provider is unpacked and resolved, as it previously was.

Rework the protocol by which providers communicate their build dependencies to consumers.

  1. … 34 more files in changeset.
Remove deprecated `ProperyVar`, `DirectoryVar` and `PropertyState` interfaces and related methods.

    • -22
    • +22
    ./DefaultProjectLayoutTest.groovy
  1. … 18 more files in changeset.
Moved the some `FileCollection` implementations for efficiently handling task file inputs out of the native plugins and behind the `TaskFileVarFactory` service, where they can be reused, at least internally for now.

There are 2 implementations which are intended to be used for task input properties: a `ConfigurableFileCollection` that allows build logic to configure a bunch of input files, such as C/C++ source files, and a `FileCollection` that represents some task inputs that are calculated from other inputs, such as the headers of a C/C++ compile task. Both implementations do some in-memory caching during task execution to make snapshotting and task action execution faster.

Improved the implementations a little and added some unit test coverage. The implementations could be further improved, reused in a bunch more places and better integrated into input file snapshotting. This change does just enough so they can be used in the native compile tasks need.

  1. … 14 more files in changeset.
Fix left over comment from gradle/gradle#3234

  1. … 9 more files in changeset.
Added conveniences to the Groovy DSL for setting a property of type `PropertyState<Directory>` or `PropertyState<RegularFile>` using a `File` instance.

  1. … 9 more files in changeset.
Added `Provider.getOrElse(T)` that returns the value of the provider or a default value, and `Provider.map(Transformer)` that returns a provider that maps the value of the provider using the given transformer function. This allows a new value to be derived lazily from some calculated value.

Changed the signature of `ProviderFactory.provider(Callable<T>)` to `provider(Callable<? extends T>)`.

  1. … 16 more files in changeset.
Added some validation to `PropertyState.set(Provider)` to fail when the given provider produces values that are not assignable to the property type.

  1. … 12 more files in changeset.