Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
Make `ModuleComponentSelector` the source of truth for version constraints

This commit pushes `VersionConstraint` as a primary concept in `ModuleComponentSelector`. It replaces the (now)

deprecated `getVersion` call, which didn't reflect all possible constraints on a version. This change has several


- version constraints now need to be "serializable"

- version constraints now consist of a preferred version and a list of rejected versions

- only a single item in the rejection list is supported

- Gradle module metadata parsing now generates a prefer/reject list

- Gradle module metadata writing does **not** yet support writing prefer/reject

- the module metadata binary format has been bumped to support prefer/reject in module descriptors

- metadata rules can say `useTarget(VersionConstraint)`

Issue #3312

    • -5
    • +6
  1. … 93 more files in changeset.
Use component id rather than module version id in the 'required by' paths in resolve exceptions. This provides a better description for local components, and also allows for components that don't have a module version id.

    • -3
    • +4
  1. … 13 more files in changeset.
Added more detail to the 'could not find any matches for selector' error message, to distinguish between:

1. No versions were found.

2. Some candidate versions were found but none matched the selector (and what those versions were).

3. Some matching versions were found by all were rejected by component selection rules (and what those versions were).

Changed ModuleVersionResolveException constructor so that it does not pass the provided message through String.format().

    • -9
    • +70
  1. … 22 more files in changeset.
Moved some exception and result types out of org.gradle.api.internal.artifacts into org.gradle.internal.resolve

    • -0
    • +74
  1. … 109 more files in changeset.