Remove `getVersionConstraint` from `Dependency` We will at some point deprecate `getVersion` on `Dependency`, which is nullable because it doesn't always make sense (ex: project dependencies). So instead of having version constraints on dependency, it will only be introduced on the relevant type (external dependencies only).
Read and write `prefers` and `rejects` version constraints in Gradle metadata file This commit changes the Gradle metadata file format to write version constraints instead of versions. Instead of writing a single (preferred) version, the `version` block in the Gradle metadata format for a dependency is now a proper `VersionConstraint`, with `prefers` and `rejects`.
The Gradle dependency metadata format spec has been adjusted.
Note that this commit does not introduce publishing of such metadata (at least, it doesn't prove that it works): it only adds support for the feature.