Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Reuse the in-memory caching strategy for `NamedObjectInstantiator`, rather than using a custom implementation.

  1. … 4 more files in changeset.
Reuse the in-memory caching strategy for `NamedObjectInstantiator`, rather than using a custom implementation.

  1. … 4 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

  1. … 25 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

  1. … 27 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

  1. … 27 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

  1. … 27 more files in changeset.
Allow `RegularFileProperty` and `DirectoryProperty` types to be used on artifact transform parameter objects, and take care of fingerprinting and building the files before running the transform.

Reuse the mechanism that allows instances of generated classes to describe their state to the isolation infrastructure for other core Gradle types, such as `ConfigurableFileCollection`, `Provider` and `Property` and remove the custom isolation logic for these core types.

  1. … 38 more files in changeset.
Allow `RegularFileProperty` and `DirectoryProperty` types to be used on artifact transform parameter objects, and take care of fingerprinting and building the files before running the transform.

Reuse the mechanism that allows instances of generated classes to describe their state to the isolation infrastructure for other core Gradle types, such as `ConfigurableFileCollection`, `Provider` and `Property` and remove the custom isolation logic for these core types.

  1. … 38 more files in changeset.
Special case the isolation for generated `Named` types, to make this faster for variant selecting.

  1. … 29 more files in changeset.
Special case the isolation for generated `Named` types, to make this faster for variant selecting.

  1. … 29 more files in changeset.
Support isolation of a 'managed' type (a Gradle provided implementation of an interface or abstract class with no fields) without serialization.

The implementation is shared for types generated by `NamedObjectFactory` and `ClassGenerator`.

    • -5
    • +41
    ./NamedObjectInstantiatorTest.groovy
  1. … 23 more files in changeset.
Support isolation of a 'managed' type (a Gradle provided implementation of an interface or abstract class with no fields) without serialization.

The implementation is shared for types generated by `NamedObjectFactory` and `ClassGenerator`.

    • -5
    • +41
    ./NamedObjectInstantiatorTest.groovy
  1. … 23 more files in changeset.
Allow values created using `ObjectFactory.named()` to be used with `@Input` task properties, and in other places where value snapshots are used to provide isolation, such as the parameters to artifact transforms.

This change makes these types known to the value snapshot infrastructure, to allow the infrastructure to be used for variant attribute values, which make heavy use of named values.

  1. … 8 more files in changeset.
Added some unit test coverage.

    • -5
    • +14
    ./NamedObjectInstantiatorTest.groovy
Changed contract for `ObjectFactory.named()` so that it throws `ObjectInstantiationException` on failure, for consistency with `newInstance()`.

  1. … 3 more files in changeset.
Removed `DefaultObjectFactory` singleton.

    • -0
    • +14
    ./NamedObjectInstantiatorTest.groovy
  1. … 3 more files in changeset.
Split the generation and creation of named object instances out of `DefaultObjectFactory`. This separation will allow `DefaultObjectFactory` to later be contextualised with scoped services to be injected into the objects that it creates, as currently it is a global service due to the generation of named object types.

    • -213
    • +0
    ./DefaultObjectFactoryTest.groovy
    • -0
    • +251
    ./NamedObjectInstantiatorTest.groovy
  1. … 2 more files in changeset.
Allow users to create instances of class using injected factories

This gives a way to instantiate objects from the public API,

delegating to the Instantiator.

Issue: #728

  1. … 3 more files in changeset.
Disallow instance fields on abstract classes passed to `ObjectFactory.named()`.

    • -0
    • +33
    ./NamedWithFields.java
  1. … 5 more files in changeset.
Added some unit test coverage.

Allow `ObjectFactory.named()` to be used for abstract classes as well as interfaces.

    • -0
    • +31
    ./AbstractNamed.java
  1. … 3 more files in changeset.
Generate a factory for `Named` type implementations.

  1. … 1 more file in changeset.
Create `Named` object implementations using classes generated by ASM rather than JVM proxies.

Extracted some shared infrastructure out of the various places that we generate implementations.

  1. … 6 more files in changeset.
Added a public service `ObjectFactory` that can be used to create objects of various kinds for use in the Gradle model. For now, the only kind of object that can be created is immutable instances of `Named` and it sub-types. These are intended to be used for variant attribute values.

This service is available for injection into plugins and tasks (and anywhere else service injection is available). There is also a `Project.getObjects()` method for access.

Other kinds of construction methods can be added to this service later.

Also added a `Project.getProviders()` method for access to a `ProviderFactory`, so we don't have to smear all of its methods onto `Project`.

    • -0
    • +94
    ./DefaultObjectFactoryTest.groovy
  1. … 8 more files in changeset.