-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support rich versions (strictly & prefer) #471
Comments
Implementation should be quite easy, setting the version happens in a single place, where we have the However, there are some design decisions to tackle first because there are multiple ways to implement this:
For now, I'm biased towards option 4, but maybe someone has an objection to that, or an idea for the 3 other options, or a different option mind? |
I started implementing option4, but there's something I'm not super happy with. While it reads okay(ish?) for dependencies {
api(Something.whatever) {
version { strictly() }
}
} it reads less nicely when the version parameter is omitted for the dependencies {
api(Something.whatever) {
version { prefer() }
}
} Instead of an extension for Here are a few examples of how these could look like… dependencies { // Let's call it option 5.
api(Something.whatever).strictVersion()
api(Something.whatever).preferDeclaredVersion()
api(Something.whatever).preferNoTransitiveUpgrade()
} as extensions for dependencies { // and this is option 6.
api(Something.whatever) { strictVersion() }
api(Something.whatever) { preferDeclaredVersion() }
api(Something.whatever) { preferNoTransitiveUpgrade() }
} |
For option 1, where we would use variants of the version placeholder, I have been thinking that we could use |
I just discovered that option 5 cannot work. dependencies { // This is option 1
api(Something.whatever.strictVersion())
api(Something.whatever.preferDeclaredVersion())
api("com.example.something:something:_") // Require (default, allows transitive upgrades)
api("com.example.something:something:_!") // Prefer (avoids upgrades if possible)
api("com.example.something:something:_!!") // Strictly
} dependencies { // This is option 7
api(Something.whatever) {
version { strictVersion() } // Variant A
}
api(Something.whatever) {
version { strictlyDeclaredVersion() } // Variant B
}
api(Something.whatever) {
version {
preferDeclaredVersion()
reject("1.0.0")
}
}
api("com.example.something:something:_")
api("com.example.something:something:_") {
version { preferDeclaredVersion() }
}
api("com.example.something:something:_") {
version { strictVersion() } // Variant A
}
api("com.example.something:something:_") {
version { strictlyDeclaredVersion() } // Variant B
}
} |
I was considering implementing option 1, but while Gradle let us do what we want with |
It turns out using That said, I'm concerned about how these fit in regarding version ranges, like when defining a range for |
No description provided.
The text was updated successfully, but these errors were encountered: