Great work on the metadata system!
I’ve been busy adding it to one of my pet projects. I specify some of my dependencies in ranges, e.g. [1.0,2.0[
This empowers Gradle to pick the most fitting version depending on the transitive dependencies of my dependencies, etc. Works awesomely!
Now, I want to publish my version ranges as the “required” version so that consuming projects can, too, empowered by Gradle pick the best fitting version - this works like a charm when enabling the metadata preview flag.
Now additionally, I want to publish the version that was actually resolved during the build of my project as a “preferred” version (since thats what the tests ran against, etc).
I’m using Gradle dependency locking, so I do not have the concrete version hardcoded anywhere in the build.gradle.
How do I achieve publishing the concrete resolved version as a prefered version?
The module.json should look something like:
{
"group": "org.slf4j",
"module": "slf4j-api",
"version": {
"requires": "[1.0,2.0[", <-- this is already there, awesome
"prefers": "1.7.28" <-- this is currently missing, the version is available from lock files
}
}
Best,
Napster