Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Rename inheritStrictVersions() -> endorseStrictVersions() (#10755)

This name change more clearly communicates the semantics of the

feature from a users point of view.

This commit also removes all mentions of 'inheriting' AND 'forSubgraph'.

There have been some leftovers in documentation/comments that

would have been misleading in the future. To make sure we catch all,

this also updates all variable/method/package names.

    • -5
    • +4
    ./DefaultImmutableVersionConstraintTest.groovy
  1. … 70 more files in changeset.
Rename inheritStrictVersions() -> endorseStrictVersions()

This is more clearly communicating the semantics of the feature

from a users point of view.

The commit also removes all mentions of 'inheriting' AND 'forSubgraph'.

There have been some leftovers in documentation/comments that

will be misleading in the future. To make sure we catch all,

I also updated all variable/method/package names.

    • -5
    • +4
    ./DefaultImmutableVersionConstraintTest.groovy
  1. … 70 more files in changeset.
Rename inheritStrictVersions() -> endorseStrictVersions()

This is more clearly communicating the semantics of the feature

from a users point of view.

The commit also removes all mentions of 'inheriting' AND 'forSubgraph'.

There have been some leftovers in documentation/comments that

will be misleading in the future. To make sure we catch all,

I also updated all variable/method/package names.

    • -5
    • +4
    ./DefaultImmutableVersionConstraintTest.groovy
  1. … 70 more files in changeset.
Rename inheritStrictVersions() -> endorseStrictVersions()

This is more clearly communicating the semantics of the feature

from a users point of view.

The commit also removes all mentions of 'inheriting' AND 'forSubgraph'.

There have been some leftovers in documentation/comments that

will be misleading in the future. To make sure we catch all,

I also updated all variable/method/package names.

    • -5
    • +4
    ./DefaultImmutableVersionConstraintTest.groovy
  1. … 70 more files in changeset.
Support prefix and latest selectors in strictly

This was basically just about adding test coverage.

The assumed behavior is that `latest.release` would

accept _any_ version when used in a reject selector,

so that we can iterate on rejected versions until

we find a match.

    • -18
    • +10
    ./DefaultResolvedVersionConstraintTest.groovy
  1. … 5 more files in changeset.
Support prefix and latest selectors in strictly

This was basically just about adding test coverage.

The assumed behavior is that `latest.release` would

accept _any_ version when used in a reject selector,

so that we can iterate on rejected versions until

we find a match.

    • -18
    • +10
    ./DefaultResolvedVersionConstraintTest.groovy
  1. … 5 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).

    • -17
    • +12
    ./DefaultImmutableVersionConstraintTest.groovy
    • -24
    • +0
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 76 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).

    • -17
    • +12
    ./DefaultImmutableVersionConstraintTest.groovy
    • -24
    • +0
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 78 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).

    • -17
    • +12
    ./DefaultImmutableVersionConstraintTest.groovy
    • -24
    • +0
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 76 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).

    • -17
    • +12
    ./DefaultImmutableVersionConstraintTest.groovy
    • -24
    • +0
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 76 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).

    • -17
    • +12
    ./DefaultImmutableVersionConstraintTest.groovy
    • -24
    • +0
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 76 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).

    • -17
    • +12
    ./DefaultImmutableVersionConstraintTest.groovy
    • -24
    • +0
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 76 more files in changeset.
Add MutableVersionConstraint.notForSubgraph() DSL method

The main use case for this are component metadata rules.

    • -1
    • +11
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 3 more files in changeset.
Add MutableVersionConstraint.notForSubgraph() DSL method

The main use case for this are component metadata rules.

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

    • -11
    • +28
    ./DefaultImmutableVersionConstraintTest.groovy
    • -0
    • +14
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 18 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -11
    • +28
    ./DefaultImmutableVersionConstraintTest.groovy
    • -0
    • +14
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 18 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -11
    • +28
    ./DefaultImmutableVersionConstraintTest.groovy
    • -0
    • +14
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 19 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -11
    • +28
    ./DefaultImmutableVersionConstraintTest.groovy
    • -0
    • +14
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 19 more files in changeset.
Add `forSubgraph()` API to version constraints

    • -11
    • +28
    ./DefaultImmutableVersionConstraintTest.groovy
    • -0
    • +14
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 18 more files in changeset.
Add `strong()` API to version constraints

    • -10
    • +10
    ./DefaultImmutableVersionConstraintTest.groovy
  1. … 16 more files in changeset.
Provide special display message for 'reject all'

    • -0
    • +1
    ./DefaultImmutableVersionConstraintTest.groovy
  1. … 4 more files in changeset.
Add useful displayName to `VersionConstraint`

    • -0
    • +22
    ./DefaultImmutableVersionConstraintTest.groovy
  1. … 3 more files in changeset.
Support a dependency with both `require` and `prefer` versions

    • -1
    • +2
    ./DefaultResolvedVersionConstraintTest.groovy
  1. … 14 more files in changeset.
Maintain separate `prefer` and `require` versions for constraint

    • -41
    • +42
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 3 more files in changeset.
Don't implicitly add 'prefer' with 'require'

    • -1
    • +1
    ./DefaultImmutableVersionConstraintTest.groovy
    • -5
    • +5
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 10 more files in changeset.
Add `MutableVersionConstraint.require(version)`

By default, a dependency like 'org:foo:1.0' defines a 'require' version

constraint.

With this change, it is also possible to set the 'required' version for

a dependency from within `Configuration.withDependencies` or a component

metadata rule. This brings 'require' on par with 'prefer' and 'strictly'

for the purposes of configuration.

    • -1
    • +29
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 4 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.

    • -8
    • +8
    ./DefaultImmutableVersionConstraintTest.groovy
    • -5
    • +5
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 17 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.

    • -13
    • +24
    ./DefaultImmutableVersionConstraintTest.groovy
    • -3
    • +24
    ./DefaultMutableVersionConstraintTest.groovy
    • -2
    • +2
    ./DefaultResolvedVersionConstraintTest.groovy
  1. … 34 more files in changeset.
Simplify construction of DefaultMutableVersionConstraint

    • -1
    • +2
    ./DefaultImmutableVersionConstraintTest.groovy
    • -1
    • +1
    ./DefaultMutableVersionConstraintTest.groovy
  1. … 5 more files in changeset.
Strict constraints now reject both lower and higher versions

A strict version constraint is implemented by preferring any version in the

declared range, and rejecting other versions. Rejecting of lower versions happens

naturally through the `LatestModuleConflictResolver`.

With this change, the rejection of lower versions becomes explicit, instead of

building a range higher than a strict constraint and rejecting that, we instead

create a 'inverted' VersionSelector that will matches the exact complement of

the `strictly` version selector, and reject that.

This change will later permit us to remove the implicit 'reject all lower'

constraint in our resolution engine.

Strict version constraints are now rendered as 'strictly' in error messages.

    • -5
    • +7
    ./DefaultResolvedVersionConstraintTest.groovy
  1. … 9 more files in changeset.