Simplified resolutionStrategy
See original GitHub issueUpdate: Released in v0.25.0
Hello Ben,
I propose to add a declarative filter for filtering version
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
instead of
resolutionStrategy {
componentSelection {
all {
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
reject("Release candidate")
}
}
}
}
Also I noticed that people are much more creative on how they name their unstable versions than on how they name their unstable versions.
So the README
should recommand something like:
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val regex = "^[0-9,.v-]+$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:26 (14 by maintainers)
Top Results From Across the Web
ResolutionStrategy (Gradle API 7.6)
Defines the sort order for components and artifacts produced by the configuration. Method Summary. All Methods Instance Methods Abstract ...
Read more >How to use Gradle resolutionStrategy to force dependency ...
This code snippet will find each dependency who has group name com.android.support and forcefully apply the version 28.0.0 , even to the ...
Read more >Customizing Dependency Resolution Behavior - API Manual
For more information and code samples see the ResolutionStrategy class in ... But it is easy for transitive dependency resolution to violate this...
Read more >Manage Gradle version conflicts with resolution strategy
Gradle version catalogs for an awesome dependency management ... Managing dependencies in a single module project is pretty simple, but when you ...
Read more >Reduced Target-Resolution Strategy for Rapid Multi-Observer ...
The strategy offers a simple and easy-to-replicate process and does not require any elaborate site/demand abstraction processes or ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
When I try the
examples/groovy
I get the error:It works if I explicitly qualify
candidate
, e.g.Perhaps this means that the closure’s delegate isn’t being set up?
Just for inspiration, in our project I use:
It is not catching every possible naming convention, but it works for our dependencies, is pretty easily extensible and offers updates to more stable version in case you use some alpha/beta because you take the risk and do not want to wait until it becomes stable.