Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Split methods required in Worker

    • -3
    • +14
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 18 more files in changeset.
Remove deprecated Class.newInstance() (#6496)

`Class.newInstance()` was deprecated in Java 9.

    • -1
    • +2
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 34 more files in changeset.
Improve fully qualified representation of nested model types

Use `.` instead of `$` to separate the enclosing type name from the

nested type name.

    • -2
    • +4
    ./BinaryTasksModelRuleExtractorTest.groovy
    • -7
    • +9
    ./BinaryTypeModelRuleExtractorTest.groovy
    • -1
    • +3
    ./ComponentBinariesModelRuleExtractorTest.groovy
  1. … 22 more files in changeset.
Pass an immutable (and readable) view of the subject to `@Validate` rules.

Also added a new exception type to distinguish between mutating a read only view and mutating a closed view.

    • -0
    • +5
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 16 more files in changeset.
Fix test

    • -7
    • +0
    ./AbstractAnnotationModelRuleExtractorTest.groovy
    • -6
    • +4
    ./ComponentBinariesModelRuleExtractorTest.groovy
Reuse `isAnnotationPresent`

    • -2
    • +3
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Replace `@BinaryType` and `@LanguageType` with `@ComponentType`

The original annotations have been retained for the purpose of

deprecation but they no longer work.

    • -33
    • +30
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 64 more files in changeset.
Merged the `BinarySpec` and `LanguageSourceSet` type registries into the `ComponentSpec` registry.

The type registration annotations have not changed, however they all now act on the same registry. The annotations will be merged later.

    • -3
    • +6
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 11 more files in changeset.
Fix platform-base tests

    • -4
    • +5
    ./ComponentBinariesModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Removed some unnecessary or duplicate validation from type registration rule implementation:

- Implementation class does not necessarily need to extend some base class.

- Implementation class does not need to implement public or internal view types.

- Implementation classes does not necessarily need a no-args constructor.

    • -4
    • +0
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 14 more files in changeset.
Changed a number of usages of `ComponentSpec` to use more specific types.

    • -7
    • +7
    ./ComponentBinariesModelRuleExtractorTest.groovy
  1. … 8 more files in changeset.
Removed the various subtypes of `TypeBuilder`. These have been replaced by `TypeBuilder`.

    • -2
    • +2
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 10 more files in changeset.
Replaced most usages of `BinaryTypeBuilder` and `ComponentTypeBuilder` with the more general `TypeBuilder`.

    • -16
    • +16
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 48 more files in changeset.
Changed the contract for @ComponentType, @BinaryType and @LanguageType rule methods so that they may accept a `TypeBuilder` instead of the annotation-specific subtype of `TypeBuilder`.

This will allow the removal of the annotation-specific subtypes. These subtypes are all now empty.

    • -5
    • +2
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
Implement recursive rule application

Rules can be applied recursively to all elements of a given

type in the given scope by adding the `@Each` annotation to

the subject of the rule.

Rules are not applied to reference nodes nor to child elements

of reference nodes.

+review REVIEW-5808

    • -1
    • +4
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 10 more files in changeset.
Store rule definition in extracted rule

    • -2
    • +2
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 13 more files in changeset.
Collect rule source problems in specific class

We want to collect other types of validation errors later, thus the

rule-specific errors need to be moved out of ValidationProblemCollector.

+review REVIEW-5761

    • -2
    • +3
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 18 more files in changeset.
Avoid converting `ModelType` to `Type` and immediately back to `ModelType`.

    • -1
    • +1
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 2 more files in changeset.
Revert "Promote o.g.model/{internal/core/rule/describe=>}/ModelRuleDescriptor"

This reverts commit de9e06338062d7ff2933717e1c30fbf0fb6c50d2 following a

review in which we determined that letting the indirect cycle persist is

a lesser evil that promoting ModelRuleDescriptor to public status.

Note again that the original commit, nor this reversion of it has any

impact on Classycle errors, as it appears to be incapable of detecting

this kind of (very common) cycle.

    • -5
    • +2
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 85 more files in changeset.
Promote o.g.model/{internal/core/rule/describe=>}/ModelRuleDescriptor

Much like the previous commit, this change resolves an indirect package

cycle. Unlike the previous commit, however, it does so by promoting a

previously intenal type (ModelRuleDescriptor) to public API status.

There are several exception types resident in org.gradle.model that

depend on ModelRuleDescriptor and expose that dependency through their

constructors. This alone provides a rationale for promoting

ModelRuleDescriptor to public status, and resolving the cycle is now an

additional motivation.

Note that while the package structure within on the internal side was

org.gradle.model.internal.core.rule.describe, ModelRuleDescriptor has

been promoted here directly to org.gradle.model, i.e. the

core.rule.describe subpackaging has not been mirrored into the public

package structure. The reason for doing this is to avoid introducing a

dependency from a higher level package (org.gradle.model) to a

subpackage. In general, package dependencies should always flow upward

from subpackages to parent packages in a given hierarchy, and not the

other way around. There are many counterexamples of this throughout the

codebase today, but that is no reason to perpetuate the practice.

    • -2
    • +5
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 83 more files in changeset.
Moved registration of `BinarySpec.tasks` from `BinaryBasePlugin` to `BaseBinarySpec`.

Also use the descriptor of a `BinarySpec` or `ComponentSpec` as the descriptor for its children, consistent with the approach used for the children of a struct.

    • -2
    • +2
    ./BinaryTasksModelRuleExtractorTest.groovy
  1. … 15 more files in changeset.
Changed `@LanguageType` and `@BinaryType` rule extractors so that they apply only the relevant plugin, rather than applying the universe.

    • -3
    • +3
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
`ModelAction` no longer needs to be parameterized.

    • -1
    • +1
    ./BinaryTasksModelRuleExtractorTest.groovy
    • -1
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 34 more files in changeset.
Treat `@RuleInput` properties on `RuleSource` types as references to implicit inputs for all rules on the rule source.

Moved responsibility for applying a rule to a particular scope up from `ModelRegistry` to `ModelRuleExtractor`. Now, all `RuleAction` instances applied to a `ModelRegistry` are applied relative to the root element, and it is the caller's responsibility to scope the action as required before registering it.

+review REVIEW-5756

    • -1
    • +1
    ./AbstractAnnotationModelRuleExtractorTest.groovy
    • -2
    • +1
    ./BinaryTasksModelRuleExtractorTest.groovy
    • -2
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 14 more files in changeset.
Reworked interaction between rule source extractor and the extracted rules, to allow implicit inputs and other state to be attached to rule actions.

+review REVIEW-5756

    • -7
    • +9
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 17 more files in changeset.
Moved invoker off `MethodRuleDefinition`, replaced by the contextualized invoker provided during rule application.

+review REVIEW-5756

    • -3
    • +4
    ./AbstractAnnotationModelRuleExtractorTest.groovy
  1. … 5 more files in changeset.
Reworked when type registration rules are executed, so that they behave like real rules, and are executed as required.

This means better error reporting, plus the other benefits of rules execution. Downside is that the result is not reused across projects or build invocations, whereas it previously was. However this is currently true of rules in general, and there's a good chance the jvm can optimise this particular kind of rules given they are usually super simple.

+review REVIEW-5756

    • -9
    • +22
    ./AbstractAnnotationModelRuleExtractorTest.groovy
    • -1
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 7 more files in changeset.
Changed type registration so that rule method is invoked when the rule source is applied, rather then when it is inspected.

+review REVIEW-5756

    • -0
    • +7
    ./AbstractAnnotationModelRuleExtractorTest.groovy
    • -3
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 10 more files in changeset.
Fixed the `@ComponentBinaries` annotation so that it works for any `ComponentSpec`, not just those in `components`.

Changed the test plugins to use this to define the binaries for test suites.

    • -0
    • +5
    ./AbstractAnnotationModelRuleExtractorTest.groovy
    • -10
    • +5
    ./ComponentBinariesModelRuleExtractorTest.groovy
  1. … 8 more files in changeset.
Use contextualized `RuleInvoker` to run `@ComponentBinaries` rule methods.

+review REVIEW-5756

    • -3
    • +0
    ./ComponentBinariesModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.