NonTransformedModelDslBackingTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Introduce convenience methods on ModelRegistry

+review REVIEW-5685

    • -5
    • +9
    ./NonTransformedModelDslBackingTest.groovy
  1. … 24 more files in changeset.
Fix test

+review REVIEW-5689

    • -15
    • +10
    ./NonTransformedModelDslBackingTest.groovy
  1. … 5 more files in changeset.
Rename ModelRegistry.create() to register() +review REVIEW-5678

    • -2
    • +2
    ./NonTransformedModelDslBackingTest.groovy
  1. … 67 more files in changeset.
Introduce TestNodeInitializerRegistry

Simpler singleton access to a registry in tests.

+review REVIEW-5651

    • -3
    • +2
    ./NonTransformedModelDslBackingTest.groovy
  1. … 6 more files in changeset.
Revert direct path access for services

+review REVIEW-5645

    • -1
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 35 more files in changeset.
Mark services with `@Service`, and reference them via path in the model

Also fixes rule-cycles in Android plugin.

+review REVIEW-5640

    • -1
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 38 more files in changeset.
Get `NodeInitializerRegistry` from the model

+review REVIEW-5629

    • -1
    • +6
    ./NonTransformedModelDslBackingTest.groovy
  1. … 5 more files in changeset.
Fixed tests

+review REVIEW-5629

    • -3
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 2 more files in changeset.
Removes unnecessary use of ModelSchemaStore

+review REVIEW-5619

    • -1
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 4 more files in changeset.
Adds a ConstructableTypesRegistry to create types that are not strictly 'managed' - NodeInitializerExtractionStrategy's can be asked what types they support - Fails the build when NodeInitializerRegistry can not find an appropriate node initializer - Removes managed type check ModelDslBacking's

+review REVIEW-5619

    • -7
    • +4
    ./NonTransformedModelDslBackingTest.groovy
  1. … 40 more files in changeset.
Fixed test

    • -1
    • +3
    ./NonTransformedModelDslBackingTest.groovy
Reorganised managed model creation to have the schema provide the creation strategy.

This allows custom schema extraction strategies to have a say in how objects are to be created.

+review REVIEW-5536

    • -3
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 49 more files in changeset.
Rename org.gradle.model.collections.ManagedSet to org.gradle.model.ModelSet.

    • -2
    • +2
    ./NonTransformedModelDslBackingTest.groovy
  1. … 26 more files in changeset.
Improve efficiency of string to enum conversion for property setting.

Don't go looking for potential transforms until the dispatch fails and only go looking if property types match.

    • -2
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 16 more files in changeset.
Add support for beforeEach/afterEach rule methods to ManagedSet.

+review

    • -1
    • +2
    ./NonTransformedModelDslBackingTest.groovy
  1. … 15 more files in changeset.
Allow top level, managed, elements to be added to the model graph.

Example:

model {

thing(Thing) {

}

}

Works for both styles of model blocks.

+review

    • -19
    • +53
    ./NonTransformedModelDslBackingTest.groovy
  1. … 27 more files in changeset.
Allow model nodes to be 'ephemeral'.

Ephemeral nodes are not “stable”.

Non stable nodes are reset when the registry is stabilized, allowing the registry to be reused.

This mechanism will be used to allow the model registry to be scrubbed of nodes that hold build instance state in between reusing the model state between builds.

+review

    • -1
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 17 more files in changeset.
Pull the error for trying to create model nodes as scopes other than root “up”.

+review REVIEW-5353

    • -3
    • +2
    ./NonTransformedModelDslBackingTest.groovy
  1. … 26 more files in changeset.
Push the class to rule extractor into the registry, to allow nodes etc. to accept RuleSource classes.

While it bothers me slightly that we are pushing knowledge of a particular type of rule representation into the registry, it saves having to cart some extra stuff around.

+review REVIEW-5353

    • -1
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 38 more files in changeset.
Collection mutation rule specifies input taking mutation rule for particular model element

+review REVIEW-5353

    • -9
    • +12
    ./NonTransformedModelDslBackingTest.groovy
  1. … 68 more files in changeset.
Liberate some model registry test support from DefaultModelRegistryTest.

Includes some new/renamed API on ModelRegistry.

+review REVIEW-5350

    • -4
    • +4
    ./NonTransformedModelDslBackingTest.groovy
  1. … 21 more files in changeset.
Revert selective task closing work.

Too much breakage.

+review REVIEW-5350

    • -4
    • +4
    ./NonTransformedModelDslBackingTest.groovy
  1. … 67 more files in changeset.
Wire the model registry into the “task selector”, effectively enabling configure-on-demand for rule based task declarations.

Rather than eagerly “realize” the whole task container and its contents, we now only realize the container itself.

This means that we know of all the tasks that will exist without actually creating them.

If a task (declared by rules) is not needed for a build (i.e. not selected, not depended on) it will not be created.

However, our rule based plugins at this time contain coarse rules that don't allow this feature to be leveraged.

Benefits will only be seen right now for contrived domains.

    • -4
    • +4
    ./NonTransformedModelDslBackingTest.groovy
  1. … 63 more files in changeset.
Shuffled some stuff around, so that ManagedModelInitializer uses a ModelCreatorFactory to build nested elements for managed types.

    • -10
    • +3
    ./NonTransformedModelDslBackingTest.groovy
  1. … 4 more files in changeset.
Don't decorate the ManagedSet implementation used for node's private value, as the view is now always used to get at the collection, and this is decorated (enough).

    • -2
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 6 more files in changeset.
Attach generated implementation classes (weakly) to schema objects, instead of using a global cache.

This is done to avoid having to go through another cache and acquire a lock every time we need to instantiate a managed type.

This does make unit testing slightly more inconvenient in that a singleton schema store has to be used for all tests, but I deemed this an acceptable trade off.

+review REVIEW-5329

    • -1
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 19 more files in changeset.
Reinstate some previously ignored test coverage due to model registry changes.

+review REVIEW-5264

    • -6
    • +44
    ./NonTransformedModelDslBackingTest.groovy
  1. … 8 more files in changeset.
Ignore/fix a bunch of tests now that model elements can't be inserted at nested paths in the graph (i.e. they must be inserted via the parent).

The ignored tests will be fixed and unignored soon.

+review REVIEW-5264

    • -0
    • +2
    ./NonTransformedModelDslBackingTest.groovy
  1. … 6 more files in changeset.
Change model registry storage from being a table of opaque objects, to a graph of properties.

This doesn't quite satisfy the story goal of being able to target rules to nested properties, because we don't know about the nested properties until we create the objects. If we are using by-type bindings then we don't know that we need to create the parent object. To solve this we need to start populating the graph when something is registered (i.e. insert it in a kind of pending state, with its links also in a pending state) and then only populate the data when the node is “initialised”.

We are also only respecting one level of depth at the moment. That is, we treat (as far as the model graph is concerned) the properties of managed elements as unmanaged. Later stories will make this fully “transitive”.

+review

    • -1
    • +2
    ./NonTransformedModelDslBackingTest.groovy
  1. … 123 more files in changeset.
Introduce a builder for model creators. Bring back some test coverage.

+review REVIEW-5204

    • -3
    • +1
    ./NonTransformedModelDslBackingTest.groovy
  1. … 17 more files in changeset.