-
Notifications
You must be signed in to change notification settings - Fork 200
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
Breaking change in 0.23.0? #331
Comments
I have the same problem (tested with Gradle 5.6 and 5.6.1): |
The version itself runs for me. However, if I apply the latest "Old" resolution strategydependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ["alpha", "beta", "rc", "cr", "m", "preview", "b", "ea"].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]$qualifier[.\d-+]*/
}
if (rejected) {
selection.reject("Release candidate")
}
}
}
} Output
"New" resolution strategydependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all {
def isNonStable = { String version ->
["alpha", "beta", "rc", "cr", "m", "preview", "b", "ea"].any { qualifier ->
version ==~ /(?i).*[.-]\$qualifier[.\\d-+]*/
}
}
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
selection.reject("Release candidate")
}
}
}
} Output
|
Sorry, this was unintentional. I’ll have a fix out by the end of the weekend. cc @ghus-raba |
Sorry, there is extra escape in the readme. It was fixed in #332. There should be
Can you post your Line 56 in e3f310e
Line 79 in e3f310e
|
@ghus-raba I accidentally exposed the property instead of using the method, not being super great at Groovy and doing things ad hoc over weekends. In 894fbdf, I showed documentation which used dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
} |
Ok, then renaming the property back to be same as method should do the trick. I think I changed it because of a codenarc warning. Although it changed from Closure to Action, so it might not work out of the box. Then if we want to keep it working, we would have to revert back to Closure and handle it in Resolver a bit differently. |
I think the change from Closure to Action is compatible enough if the types are inferred by the build scripts. If the 99% case works and one plugin integration has to revise, then I think it's a fine break. If it leaks into the general case then a little adapter code can probably be done at the task prior to the Resolver (e.g. adapt from the Closure to Action before going downstream). |
If you still need a project to try out the behavior you are invited to use mine. |
Released version 0.24. The direct assignment of the
This deprecated usage will show up as a build warning like other Gradle feature deprecations, where a detailed message is shown when running with |
Do you know why the Failed to resolve :app:debugAndroidTestCompileClasspath
... |
I tested version The following dependencies exceed the version found at the milestone revision level:
- com.android.tools.build:gradle [3.5.0 <- 2.3.0] while The following dependencies are using the latest milestone version:
- com.android.tools.build:gradle:3.5.0 You can try out the behavior on this temporary branch. |
I think that is because dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
def isNonStable = { String version ->
['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier ->
version ==~ /(?i).*[.-]$qualifier[.\d-+]*/
}
}
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
selection.reject('Release candidate')
}
}
}
} |
In regards to the configuration resolution failures, that seems to be an Android / Gradle bug. See #326 - they don't the handle detached configurations, e.g. like ours created by |
Applying your snippet produces the expected output. 👍 Thanks for your quick response. |
Massive thanks for the quick response and fix, and I will migrate away from the deprecated configuration straight away. |
@johnjohndoe BTW both dependencyUpdates.resolutionStrategy {
componentSelection {
all {
def isNonStable = { String version ->
['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier ->
version ==~ /(?i).*[.-]$qualifier[.\d-+]*/
}
}
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
reject('Release candidate')
}
}
}
} |
@ghus-raba Thanks. Looks good to me. I updated my branch. Please update the README. |
I've just picked up the new version of your library and we now get the following error when running
useLatestVersions
:Could not set unknown property
'resolutionStrategy' for task ':dependencyUpdates' of type com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask.
If we change our gradle config from
dependencyUpdates.resolutionStrategy
todependencyUpdates.resolutionStrategyAction
things work as before.Just wondering if this was an intentional change or not before we roll this fix out across our projects?
The text was updated successfully, but these errors were encountered: