LanguageTypeModelRuleExtractorTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Improve fully qualified representation of nested model types

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

nested type name.

    • -1
    • +3
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 24 more files in changeset.
Rename Buildable{ModelElement => ComponentSpec}

This rename better reflects the fact that (the former)

BuildableModelElement now extends ComponentSpec, and in the process

helps to eliminate the unnecessary concept of "model elements" in favor

of referring to everything in terms of components and component specs.

Javadoc in BuildableComponentSpec and certain parameters and member

variables in AbstractBuildableComponentSpec have also been updated and

renamed for clarity and consistency.

    • -2
    • +2
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 25 more files in changeset.
Replace `@BinaryType` and `@LanguageType` with `@ComponentType`

The original annotations have been retained for the purpose of

deprecation but they no longer work.

    • -21
    • +21
    ./LanguageTypeModelRuleExtractorTest.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.

    • -2
    • +2
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 11 more files 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.

    • -22
    • +0
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 14 more files in changeset.
Removed the various subtypes of `TypeBuilder`. These have been replaced by `TypeBuilder`.

    • -6
    • +0
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 10 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.

    • -16
    • +22
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
Removed `LanguageTypeBuilder.languageName` property, as a name is no longer required when registering a langauge source set.

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

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

    • -1
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 35 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

    • -2
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 16 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

    • -1
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 8 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

    • -4
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 11 more files in changeset.
Reworked the parameters to `ExtractedModelRule.apply()` so that per-application context, such as explicit bindings, can be provided.

+review REVIEW-5756

    • -2
    • +5
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 12 more files in changeset.
Moved some classes from o.g.model.internal.core to o.g.model.internal.inspect.

Also moved a class that was only used by a single test to live in that test class.

+review REVIEW-5756

    • -0
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 27 more files in changeset.
Moved a bunch of singletons off several prod classes to live on `ProjectRegistrySpec`.

+review REVIEW-5756

    • -2
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 30 more files in changeset.
Collect several more `RuleSource` validation problems rather than failing on first problem.

In particular, problems with `@Model` and type registration rules are collected.

Also defer validation for whether the subject of a `@Model` rule can be created or not, until we know the set of element types that can be constructed.

+review REVIEW-5739

    • -13
    • +30
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 18 more files in changeset.
More improvements to validation of a RuleSource type.

- Fixed NPE when a rule method has no parameters.

- Collect more kinds of validation failures, rather than failing on first of these kinds of failures.

- Validate that the first parameter of a `@Rules` metod is assignable to `RuleSource`

+review REVIEW-5739

    • -3
    • +3
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 19 more files in changeset.
Merge LanguageRegistry into LanguageSourceSetFactory

Introduce `LanguageRegistry getRegistrations()` in

`LanguageSourceSetFactory`.

Get rid of `languages` node and rules that used to propagate

language registrations to `LanguageSourceSetFactory`.

Along the way, `LanguageRegistration` used in `LanguageRegistry` has

been reduced to only contains necessary data.

It no longer needs the data used for factory registration.

Other changes are impacts, mostly in tests.

+review REVIEW-5734

    • -1
    • +2
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 10 more files in changeset.
Add type parameter to ModelAction

AbstractModelAction already had a type parameter, so ModelAction should

have one too.

+review REVIEW-5738

    • -1
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 36 more files in changeset.
Language type registration fail when language name is not set

with a decent error message

+review REVIEW-5729

    • -0
    • +8
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
More test coverage for LanguageSourceSets internal views support

+review REVIEW-5729

    • -1
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 5 more files in changeset.
Removed `LanguageSourceSet.source()` method, as this method is no longer required to mix in the configuration DSL.

+review REVIEW-5708

    • -5
    • +0
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
Remove unnecessary public API methods

+review REVIEW-5669

    • -5
    • +0
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 7 more files in changeset.
Allow A LanguageSourceSet of any registered type to be created via FunctionalSourceSet

- Adds languageRegistry to FSS

- LSS creation uses FSS's LanguageRegistry

- Don't push language factories into FSS

- Add a basDir property to FSS for initializing LSS's with a default source directory

- Remove language source set factory registration from ComponentRules

    • -0
    • +12
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 15 more files in changeset.
Moved test interfaces back to their tests themselves

Since IBM JDK 6 is not throwing errors about these anymore, might as

well move them back to the tests they belong to.

+review REVIEW-5658

    • -1
    • +2
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 21 more files in changeset.
Model actions don't get access automatically to node view

+review REVIEW-5629

    • -1
    • +1
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 29 more files in changeset.
Fixed tests

+review REVIEW-5620

    • -7
    • +16
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
Use DefaultModelSchemaStore.getInstance() in tests

+review REVIEW-5587

    • -3
    • +2
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
Use schema to determine managedness in `AbstractTypeBuilder`

+review REVIEW-5561

    • -1
    • +3
    ./LanguageTypeModelRuleExtractorTest.groovy
  1. … 11 more files in changeset.