provider

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix merge issues.

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

    • -171
    • +0
    ./AbstractCollectionProperty.java
  1. … 429 more files in changeset.
Handle setting the value of a `Property<String>` using a `GString` from Groovy.

    • -0
    • +21
    ./ValueSanitizer.java
    • -0
    • +82
    ./ValueSanitizers.java
  1. … 6 more files in changeset.
Move factory method that creates `Property` instances from `DefaultProviderFactory` to `DefaultObjectFactory`.

Change `DefaultSourceDirectorySet` to use `ObjectFactory` to create property instances, rather than reaching in to some internal service.

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

  1. … 17 more files in changeset.
Allow SortedSetElementSource to handle changing values

  1. … 5 more files in changeset.
Fix `ListProperty` and `SetProperty` implementations to coerce `GString` values to `String` when the property element type is `String`, and remove work around from C++ model builder.

    • -64
    • +78
    ./AbstractCollectionProperty.java
  1. … 3 more files in changeset.
Add some convenience methods to add elements to a `ListProperty` using an array or `Iterable`.

  1. … 3 more files in changeset.
Allow providers with changing values

    • -0
    • +21
    ./ChangingValue.java
    • -0
    • +41
    ./ChangingValueHandler.java
  1. … 4 more files in changeset.
Allow domain object collections to accept provider of iterable

    • -216
    • +4
    ./AbstractCollectionProperty.java
    • -0
    • +23
    ./CollectionProviderInternal.java
    • -0
    • +415
    ./Collectors.java
    • -0
    • +25
    ./ValueCollector.java
  1. … 16 more files in changeset.
Spike worked during the parallel-by-default session at the world meeting

  1. … 21 more files in changeset.
Address review items

- Fix two other providers that were not presenting a useful toString()

- Clarify comment that toString() should not realize a Provider's value

  1. … 3 more files in changeset.
Follow dependencies through mapped Providers

  1. … 4 more files in changeset.
Refine toString() on Provider types

- For each type of provider, show useful information that doesn't require realizing anything

- For Lockable properties, we show lock/unlock and the value (if available)

- For Collection properties, we show undefined/empty/defined, List/Set and element type

- For buildable providers, we show the producing task

- For mapped/combined providers, we show the relationships in a function-like way

This causes chains of providers to look something like:

buildable(:installTest, property(interface org.gradle.api.file.Directory, defined))

which reads as "a buildable property (built by :installTest) has type Directory and has been defined"

  1. … 4 more files in changeset.
Remove toString() from Provider types

This causes providers to realize their value when debugging.

If the Provider's value needs to be calculated, toString() only reports the type and if an underlying provider has been set.

If the Provider has a fixed value, its safe to show its value in toString().

Properly support Providers for inputs and outputs (#4665)

Now static validation also works for nested Provider types.

Moreover, dependencies on output properties are detected without using `newInputFile()`.

  1. … 10 more files in changeset.
Fix possible NPE once the property is locked

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

  1. … 1 more file in changeset.
Introduce `LockableProperty` with unit tests

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

    • -0
    • +62
    ./AbstractLockableProperty.java
    • -0
    • +54
    ./LockableProperty.java
  1. … 5 more files in changeset.
Allow `ListProperty<T>` and `SetProperty<T>` properties to be set using any `Iterable<T>` or `Provider<Iterable<T>`, including through the Groovy DSL.

`ListProperty` and `SetProperty` no longer extend `Property`, as this type requires the same type to be used to set and query the property value.

Also added an (internal for now) lockable `SetProperty` implementation.

    • -20
    • +19
    ./AbstractCollectionProperty.java
    • -0
    • +24
    ./CollectionPropertyInternal.java
    • -0
    • +97
    ./LockableCollectionProperty.java
    • -0
    • +33
    ./LockableSetProperty.java
  1. … 19 more files in changeset.
Added a `SetProperty<T>` type as a convenience for dealing with properties of `Set<T>`.

    • -0
    • +341
    ./AbstractCollectionProperty.java
    • -0
    • +34
    ./DefaultSetProperty.java
  1. … 15 more files in changeset.
Added a `ListProperty` implementation whose value can be 'locked' so that it cannot be changed any further. Does not attempt to make the elements of the value immutable, however.

    • -0
    • +95
    ./LockableListProperty.java
  1. … 1 more file in changeset.
Revert "Remove deprecation warning (#3486)"

This reverts commit 017976da587c8858fdca29f65ca3d27030c8312f.

  1. … 1 more file in changeset.
Remove deprecation warning (#3486)

  1. … 1 more file in changeset.
WIP

  1. … 3 more files in changeset.
Revert "Remove deprecation warning (#3264)"

This reverts commit e79b448ab367dc7ca7c4a96060748de097c96559.

  1. … 1 more file in changeset.
Remove deprecation warning (#3264)

  1. … 1 more file in changeset.
Clean up ListProperty more

- Clarify JavaDoc for add(Provider)/addAll(Provider)

- Add helper method in DefaultListPropertyTest to assert expected state

- Add integration test for list property

  1. … 3 more files in changeset.
Clean up the `ListProvider` API

  1. … 2 more files in changeset.
Deprecated `PropertyState` interface, which is replaced by `Property`. Deprecated the `Project.property()`, `Script.property()` and `ProviderFactory.property()` methods, which are replaced by `ObjectFactory.property()`.

  1. … 19 more files in changeset.
Extracted public `Property` interface out of `PropertyState` as a first step in renaming. Changed other public APIs, except for the factory methods, to use `Property` instead of `PropertyState`.

Also moved factory method to create a `ListProperty<T>` from `ProviderFactory` to `ObjectFactory`.

  1. … 31 more files in changeset.