Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Introduce a service that takes care of inspecting a type for properties, methods and other metadata. This is a step towards using a single mechanism to discover these things efficiently rather than doing so in a bunch of different ways and multiple times.

In this commit, refactor `ClassInspector` into this service and add some in-memory caching. This class was already used for class generation.

Use this service directly in `ConventionAwareHelper` and remove some ad hoc static caching. This avoids inspecting a type that has just been inspected for class generation when an instance is first created.

Also use this service in `OptionsReader`. While this wasn't a performance problem, this change means more consistent behaviour in how annotations are validated and work with Kotlin and Groovy classes (over time).

  1. … 21 more files in changeset.
Cleanup for #8650 (#8663)

* Improve test for hasTypeVariable

* Move resolving type variables to model core

* Add more test coverage for resolving type variables

  1. … 5 more files in changeset.
Add more test coverage for resolving type variables

Move resolving type variables to model core

    • -0
    • +45
    ./org/gradle/internal/reflect/JavaReflectionUtilTest.groovy
    • -0
    • +55
    ./org/gradle/internal/reflect/JavaReflectionUtilTestMethods.java
  1. … 5 more files in changeset.
Defer service lookups until they are required when creating a decorated object instance.

  1. … 6 more files in changeset.
Defer service lookups until they are required when creating a decorated object instance.

  1. … 6 more files in changeset.
Don't inspect generated types for annotated properties, instead inspect the public type. This avoids some unnecessary work.

Also fix a typo in a couple of validation messages.

  1. … 9 more files in changeset.
Don't inspect generated types for annotated properties, instead inspect the public type. This avoids some unnecessary work.

Also fix a typo in a couple of validation messages.

  1. … 9 more files in changeset.
Remove some assumptions about which annotations are used for injecting services from the property inspection infrastructure, and instead have an injection scheme describe the annotations it supports to the property inspection scheme.

Also remove some caching from the factories of these schemes, as the schemes are all global services now.

  1. … 16 more files in changeset.
Remove some assumptions about which annotations are used for injecting services from the property inspection infrastructure, and instead have an injection scheme describe the annotations it supports to the property inspection scheme.

Also remove some caching from the factories of these schemes, as the schemes are all global services now.

  1. … 16 more files in changeset.
Merge branch 'release'

  1. … 5 more files in changeset.
Simplify resolving type parameters

Using Guava's TypeToken simplifies things and supports full

resolution.

  1. … 1 more file in changeset.
A partial fix for class generation to handle service injection methods inherited from parameterized types and that use a type variable for their return type.

  1. … 3 more files in changeset.
Add failing test for problems with generic type parameters

The return type of the property is not correct, since bound type

parameters of the superclass are not taken into account.

Add failing test for problems with generic type parameters

The return type of the property is not correct, since bound type

parameters of the superclass are not taken into account.

Move the check that `@Input` should not be attached to properties whose type is a file-ish thing out of the implementation of `ValidateTaskProperties` and into the `TypeMetadata` so that the check is applied both at runtime and by `ValidateTaskProperties`. The check only has an effect at runtime for artifact transform parameters, because the result of these inspections are currently discarded at runtime for tasks and other things.

  1. … 17 more files in changeset.
Move the check that `@Input` should not be attached to properties whose type is a file-ish thing out of the implementation of `ValidateTaskProperties` and into the `TypeMetadata` so that the check is applied both at runtime and by `ValidateTaskProperties`. The check only has an effect at runtime for artifact transform parameters, because the result of these inspections are currently discarded at runtime for tasks and other things.

  1. … 17 more files in changeset.
Handle abstract properties with primitive type in generated classes.

  1. … 2 more files in changeset.
Handle abstract properties with primitive type in generated classes.

  1. … 2 more files in changeset.
Fix the calculation of the public type for a generated type when the public type is an interface.

  1. … 6 more files in changeset.
Fix the calculation of the public type for a generated type when the public type is an interface.

  1. … 6 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. … 34 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. … 34 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. … 6 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. … 6 more files in changeset.
Change wiring of the services that set up the instantiators and property walkers for various types so that this happens consistently and is modelled as a 'scheme' for each type.

Also explicitly declare the ignored annotations for a given scheme and disallow `@Console` and `@Internal` on artifact transform actions (but not parameters).

  1. … 20 more files in changeset.
Change wiring of the services that set up the instantiators and property walkers for various types so that this happens consistently and is modelled as a 'scheme' for each type.

Also explicitly declare the ignored annotations for a given scheme and disallow `@Console` and `@Internal` on artifact transform actions (but not parameters).

  1. … 20 more files in changeset.
Use a slightly more informative error message when a known but unsupported annotation is attached to an artifact transform parameters object.

  1. … 10 more files in changeset.
Use a slightly more informative error message when a known but unsupported annotation is attached to an artifact transform parameters object.

  1. … 10 more files in changeset.
Move the validation problems seen during property visiting from the individual property to the type metadata, so that other kinds of failures can be collected (eg an annotation on a non-getter method).

  1. … 24 more files in changeset.