DefaultPropertyTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
When a strict `Property` is read, finalize all properties whose values are used to calculate the property's final value.

  1. … 42 more files in changeset.
Rework the contract between provider implementations and instant execution serialization so that a provider is responsible for determining the state that should be serialized, rather than blurring this across the provider and serializer.

  1. … 24 more files in changeset.
Serialize the result of `Provider.flatMap()` to the instant execution cache when the value to be mapped is produced by a task.

  1. … 15 more files in changeset.
Move instantiation of the various Property instances behind a factory interface.

  1. … 18 more files in changeset.
Refactor the property implementations so as to push as much knowlegde of the property lifecycle up to `AbstractProject`.

  1. … 17 more files in changeset.
Add `HasConfigurableValue.disallowUnsafeRead()` to allow plugins to switch lazy instances to 'strict' behaviour wrt reads.

In this commit, a strict `Property` disallows reads until the owning project's `afterEvaluate` starts. This is not implemented for `FileCollection` yet.

  1. … 35 more files in changeset.
Remove an unnecessary interface.

  1. … 6 more files in changeset.
Change `Provider.map()` and `Provider.flatMap()` to allow `null` to be returned by the mapping function.

  1. … 16 more files in changeset.
Report the chain of properties from which a mapped `Provider` has come from, when the value is missing.

  1. … 31 more files in changeset.
Report the chain of properties from which the value of a `ListProperty`, `SetProperty` and `MapProperty` come from, when the value is missing.

  1. … 21 more files in changeset.
When a property has no value, include the chain of properties from which the value is derived in the error message.

This is intended to help with diagnostics, as the user can see where the value should have come from. In this change, the diagnostics only works when `Property<T>` instances are connected together directly, stopping at the first `Provider<T>` which is not such a type.

  1. … 35 more files in changeset.
Include the property display name, if defined, in error messages when a `Property` value is set using a value or provider whose type is not assignable to the property type.

Also validate and sanitize the values used to set a `Property` convention.

  1. … 9 more files in changeset.
Fail rather than emitting a deprecation warning when the value of a `Property` typed task property is changed after the task starts execution.

Also include the property display name, if attached, in the 'cannot change the value' error messages.

  1. … 25 more files in changeset.
Generate a basic display name for `Property` instances created as the value for a read-only managed property. Use the display name in 'this property has no value' error messages to help with problem diagnosis.

The display name could include some more context, could be used in more error messages, and be applied to more things. This commit is simply an incremental improvement and later changes will improve diagnostics further.

  1. … 25 more files in changeset.
Renamed class and associated unit test.

    • -0
    • +258
    ./DefaultPropertyTest.groovy
  1. … 9 more files in changeset.