ComponentSelectorSerializerTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Rework `forSubgraph` as implied by `strictly`

This commit removes a dedicated `forSubgraph` flag

on version constraints, so that it is _implied_ by

strict version constraints. This simplifies the behavior

of `strictly`, making it closer to the intuitive semantics,

while maintaining the ability to fail the build if a

consumer brings an incompatible version in the graph.

As a consequence, _strict dependencies_ now express that

the producer preference overrides whatever is found in

its own dependency graph. It is closer to the "nearest

first" semantics of Maven, while not having its drawbacks

(ordering in particular).

    • -3
    • +2
    ./ComponentSelectorSerializerTest.groovy
  1. … 77 more files in changeset.
Rework `forSubgraph` as implied by `strictly`

This commit removes a dedicated `forSubgraph` flag

on version constraints, so that it is _implied_ by

strict version constraints. This simplifies the behavior

of `strictly`, making it closer to the intuitive semantics,

while maintaining the ability to fail the build if a

consumer brings an incompatible version in the graph.

As a consequence, _strict dependencies_ now express that

the producer preference overrides whatever is found in

its own dependency graph. It is closer to the "nearest

first" semantics of Maven, while not having its drawbacks

(ordering in particular).

    • -3
    • +2
    ./ComponentSelectorSerializerTest.groovy
  1. … 79 more files in changeset.
Rework `forSubgraph` as implied by `strictly`

This commit removes a dedicated `forSubgraph` flag

on version constraints, so that it is _implied_ by

strict version constraints. This simplifies the behavior

of `strictly`, making it closer to the intuitive semantics,

while maintaining the ability to fail the build if a

consumer brings an incompatible version in the graph.

As a consequence, _strict dependencies_ now express that

the producer preference overrides whatever is found in

its own dependency graph. It is closer to the "nearest

first" semantics of Maven, while not having its drawbacks

(ordering in particular).

    • -3
    • +2
    ./ComponentSelectorSerializerTest.groovy
  1. … 77 more files in changeset.
Rework `forSubgraph` as implied by `strictly`

This commit removes a dedicated `forSubgraph` flag

on version constraints, so that it is _implied_ by

strict version constraints. This simplifies the behavior

of `strictly`, making it closer to the intuitive semantics,

while maintaining the ability to fail the build if a

consumer brings an incompatible version in the graph.

As a consequence, _strict dependencies_ now express that

the producer preference overrides whatever is found in

its own dependency graph. It is closer to the "nearest

first" semantics of Maven, while not having its drawbacks

(ordering in particular).

    • -3
    • +2
    ./ComponentSelectorSerializerTest.groovy
  1. … 77 more files in changeset.
Rework `forSubgraph` as implied by `strictly`

This commit removes a dedicated `forSubgraph` flag

on version constraints, so that it is _implied_ by

strict version constraints. This simplifies the behavior

of `strictly`, making it closer to the intuitive semantics,

while maintaining the ability to fail the build if a

consumer brings an incompatible version in the graph.

As a consequence, _strict dependencies_ now express that

the producer preference overrides whatever is found in

its own dependency graph. It is closer to the "nearest

first" semantics of Maven, while not having its drawbacks

(ordering in particular).

    • -3
    • +2
    ./ComponentSelectorSerializerTest.groovy
  1. … 77 more files in changeset.
Rework `forSubgraph` as implied by `strictly`

This commit removes a dedicated `forSubgraph` flag

on version constraints, so that it is _implied_ by

strict version constraints. This simplifies the behavior

of `strictly`, making it closer to the intuitive semantics,

while maintaining the ability to fail the build if a

consumer brings an incompatible version in the graph.

As a consequence, _strict dependencies_ now express that

the producer preference overrides whatever is found in

its own dependency graph. It is closer to the "nearest

first" semantics of Maven, while not having its drawbacks

(ordering in particular).

    • -3
    • +2
    ./ComponentSelectorSerializerTest.groovy
  1. … 77 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -2
    • +3
    ./ComponentSelectorSerializerTest.groovy
  1. … 19 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -2
    • +3
    ./ComponentSelectorSerializerTest.groovy
  1. … 19 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -2
    • +3
    ./ComponentSelectorSerializerTest.groovy
  1. … 20 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -2
    • +3
    ./ComponentSelectorSerializerTest.groovy
  1. … 20 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -2
    • +3
    ./ComponentSelectorSerializerTest.groovy
  1. … 19 more files in changeset.
Add `strong()` API to version constraints

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

    • -2
    • +2
    ./ComponentSelectorSerializerTest.groovy
  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.

    • -2
    • +2
    ./ComponentSelectorSerializerTest.groovy
  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.

    • -2
    • +2
    ./ComponentSelectorSerializerTest.groovy
  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.

    • -2
    • +2
    ./ComponentSelectorSerializerTest.groovy
  1. … 27 more files in changeset.
Revert "Deduplicate attributes when writing result to disk"

This reverts commit a9ec4b4afa2a2b2ef208ed7b6d16fa72a6f0c757.

    • -46
    • +0
    ./ComponentSelectorSerializerTest.groovy
  1. … 1 more file in changeset.
Deduplicate attributes when writing result to disk

Serializing attributes (and reading them) can be quite expensive.

In project like Android projects, there are many attributes serialized

and they often have the same values. This prevents overhead by keeping

the serialized values de-duplicated.

    • -0
    • +46
    ./ComponentSelectorSerializerTest.groovy
  1. … 1 more file in changeset.
Deduplicate attributes when writing result to disk

Serializing attributes (and reading them) can be quite expensive.

In project like Android projects, there are many attributes serialized

and they often have the same values. This prevents overhead by keeping

the serialized values de-duplicated.

    • -0
    • +46
    ./ComponentSelectorSerializerTest.groovy
  1. … 1 more file in changeset.
Support requested capabilities on external dependencies

This commit adds support for having requested capabilities

part of the module component selector, for external dependencies.

This means that if a component is using Gradle metadata, we can

read requested capabilities and honor them during selection.

This reworks where requested capabilities are stored, and in

particular moves them to the `ComponentSelector`, making them

properly part of the identity of a dependency. As such, two

dependencies requiring two different variants by using distinct

capabilities will now properly appear as two different dependencies

in the dependency graph, instead of two variants of the same

dependency.

    • -7
    • +19
    ./ComponentSelectorSerializerTest.groovy
  1. … 63 more files in changeset.
Split off value snapshotting and attributes related methods of TestUtil

    • -3
    • +3
    ./ComponentSelectorSerializerTest.groovy
  1. … 64 more files in changeset.
Ensure that 'preferredVersion' always provides a useful value

Recent versions of the build scan plugin depend on `VersionConstraint.preferredVersion`

to return a string representation of the version constraint. This was broken with the

recent introduction of `requiredVersion`, where `preferredVersion` only returned a

value when explicitly set with `prefers(version)`.

This change restores the previous functionality: a `requires` version constraint implies

a `prefers` constraint, and a `strictly` constraint implies a `requires` constraint.

    • -1
    • +1
    ./ComponentSelectorSerializerTest.groovy
  1. … 18 more files in changeset.
Separate 'prefer' and 'require' in dependency versions

When we introduced the ability to declare a 'preferred' version on

a dependency declaration, this was implemented such that declaring

a "required" dependency version using `org:foo:1.0` was effectively

the same as declaring a "preferred" version `org:foo { prefer '1.0' }`.

In order to differentiate between the behaviour of required and

preferred dependency versions, this commit introduces a separate

model for these constraint types. This model is published to

Gradle `.module` metadata files, and is retained internally

throughout dependency resolution.

At this stage, the behaviour of required and preferred versions

is identical. A later commit will introduce the behavioural

difference.

    • -5
    • +9
    ./ComponentSelectorSerializerTest.groovy
  1. … 36 more files in changeset.
Retain separate versions for 'strictly' and 'prefers'

Previously, a `strictly` version constraint was translated into a separate

'prefer' and 'reject' constraint: this is how it was processed internally,

as well as how it was represented in a `.module` file.

With this change, strict version constraints are logically retained as a

first class version constraint:

- `.module` files can have versions declared with `strictly`

- Strict constraints are only translated to a reject version selector

as part of resolution (not when parsing the constraint)

    • -14
    • +9
    ./ComponentSelectorSerializerTest.groovy
  1. … 25 more files in changeset.
Improved name and documentation of attribute container serializer

    • -1
    • +1
    ./ComponentSelectorSerializerTest.groovy
  1. … 10 more files in changeset.
Improve readability of reject selectors for strict constraints

- Use Maven-style open ranges `(,)` instead of Ivy-style `],[`

- Concatenate multiple ranges with `&` instead of `-`

    • -1
    • +1
    ./ComponentSelectorSerializerTest.groovy
  1. … 7 more files in changeset.
Normalize `ModuleIdentifier`

This commit reworks the `ComponentModuleIdentifier`/`ComponentModuleSelector`/`ModuleVersionSelector`

classes to use `ModuleIdentifier` under the hood, instead of storing denormalized strings. This has

the advantage that we can reduce the use of the module identifier factory, which is called very

often during dependency resolution. Sharing instances reduces the need for conversions, and makes

comparisons faster.

    • -2
    • +3
    ./ComponentSelectorSerializerTest.groovy
  1. … 164 more files in changeset.
Add a non lossy AttributeContainer serializer

This will be required for supporting the serialization of a fully

realised ModuleComponentResolveMetadata.

Issue #5653

    • -1
    • +1
    ./ComponentSelectorSerializerTest.groovy
  1. … 8 more files in changeset.
Add a non lossy AttributeContainer serializer

This will be required for supporting the serialization of a fully

realised ModuleComponentResolveMetadata.

Issue #5653

    • -1
    • +1
    ./ComponentSelectorSerializerTest.groovy
  1. … 8 more files in changeset.
Revert changes from PR5628

This reverts the following commits:

10a25358953dfb28b09cf04356945517d5cc560e

54d19a74ab2d29673219d9c6d27388b93c55eada

d0eb19dbf28df1a108742ba177eda56301e1fab4

dcf5f65b49db17fb625ecab7498b060ab8191b9b

99847ad25f9e0ab7b1f65beb976dcb59cbadd1b9

f2f412141e1ab29e0cfafc72fd962ae645508720

99b45c8d7f0e94d2d41c43c731ca1329d6f07606

    • -1
    • +1
    ./ComponentSelectorSerializerTest.groovy
  1. … 40 more files in changeset.