Skip to content
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

ignore failOnDynamicVersions() to fetch latest versions #593

Merged
merged 2 commits into from Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -131,6 +131,12 @@ class Resolver {
copy.setCanBeResolved(true)
}

// https://github.com/ben-manes/gradle-versions-plugin/issues/592
// allow resolution of dynamic latest versions regardless of the original strategy
if(copy.resolutionStrategy.metaClass.hasProperty(copy.resolutionStrategy, "failOnDynamicVersions")) {
copy.resolutionStrategy.metaClass.setProperty(copy.resolutionStrategy, "failOnDynamicVersions", false)
}

// Resolve using the latest version of explicitly declared dependencies and retains Kotlin's
// inherited stdlib dependencies from the super configurations. This is required for variant
// resolution, but the full set can break consumer capability matching.
Expand Down
Expand Up @@ -136,6 +136,30 @@ final class DependencyUpdatesSpec extends Specification {
checkUndeclaredVersions(reporter)
}

@Issue("https://github.com/ben-manes/gradle-versions-plugin/issues/592")
def 'Project configurations failOnDynamicVersions'() {
given:
def project = singleProject()
addRepositoryTo(project)
addDependenciesTo(project)
project.configurations.all {
resolutionStrategy {
failOnDynamicVersions()
}
}

when:
def reporter = evaluate(project)
reporter.write()

then:
checkUnresolvedVersions(reporter)
checkUpgradeVersions(reporter)
checkUpToDateVersions(reporter)
checkDowngradeVersions(reporter)
checkUndeclaredVersions(reporter)
}

@Unroll
def 'Single project (#revision, #outputFormat)'() {
given:
Expand Down