DefaultProjectLayoutTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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.
Changed `Directory` and `RegularFile` so that they do not extend `Provider<File>` as these types represent some immutable location, rather than some calculated value.

Also added `FileSystemLocation` as a common supertype for these types to allow a consumer to declare that they accept a directory or a file or any file system element.

    • -54
    • +51
    ./DefaultProjectLayoutTest.groovy
  1. … 14 more files in changeset.
Merged some `PropertyState` implementations and moved some `Provider` implementations into a `Providers` class.

  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.

  1. … 14 more files in changeset.
Some fixes to the implementations of `Provider.isPresent()` and `getOrNull()` for the various instances created by `ProjectLayout` and related types. Extracted some reusable abstract classes to fix these in as few places as possible.

  1. … 3 more files in changeset.
Changed `Directory` so it represents a directory at a fixed location, rather than a directory whose location may or may not be known. Also added `RegularFile` to represent a file at a fixed location, added some `Provider` subtypes that represent some configurable directory or file variable and that provide conveniences for setting their value and deriving other locations relative to their value.

Changed the C++ plugins to use these types.

    • -4
    • +359
    ./DefaultProjectLayoutTest.groovy
  1. … 14 more files in changeset.