* Use version catalog to drive Java platform This commit incorporates the use of the Gradle version catalog as well as the related plugins to automatically update the libs.version.toml versions file with updated dependencies. The UpdateProjectVersionPlugin is also updated to modify the spring boot version property in the `libs.versions.toml` versions file rather than gradle.properties. Resolves #523
45 lines
1.5 KiB
Groovy
45 lines
1.5 KiB
Groovy
|
|
def isNonStable = { String version ->
|
|
def unstableKeyword = ['alpha', 'beta', 'rc'].any { it -> version.contains(it) }
|
|
if (unstableKeyword) {
|
|
return true
|
|
}
|
|
def containsStableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
|
|
def containsStableSuffix = (version ==~ /^[0-9,.v-]+(-r)?$/)
|
|
return !containsStableKeyword && !containsStableSuffix
|
|
}
|
|
|
|
def trustedLibPrefixes = [
|
|
"org.springframework.",
|
|
"io.micrometer.",
|
|
"io.spring.dependency-management:",
|
|
"org.apache.pulsar:pulsar-client-reactive",
|
|
"io.projectreactor:reactor"
|
|
]
|
|
|
|
tasks.named("dependencyUpdates").configure {
|
|
checkConstraints = true
|
|
rejectVersionIf {
|
|
def isTrustedLib = trustedLibPrefixes.any { s -> it.candidate.toString().startsWith(s) }
|
|
if (isTrustedLib) {
|
|
def (candidateMajorMinorPatch, candidateMilestone) = it.candidate.version.tokenize('-')
|
|
def (candidateMajor, candidateMinor, candidatePatch) = candidateMajorMinorPatch.tokenize('.')
|
|
def (currentMajorMinorPatch, currentMilestone) = it.currentVersion.tokenize('-')
|
|
def (currentMajor, currentMinor, currentPatch) = currentMajorMinorPatch.tokenize('.')
|
|
return (candidateMajor.toInteger() < currentMajor.toInteger())
|
|
|| (candidateMinor.toInteger() < currentMinor.toInteger())
|
|
|| (candidatePatch.toInteger() < currentPatch.toInteger())
|
|
}
|
|
return isNonStable(it.candidate.version)
|
|
}
|
|
}
|
|
|
|
versionCatalogUpdate {
|
|
sortByKey = false
|
|
keep {
|
|
keepUnusedLibraries = true
|
|
keepUnusedVersions = true
|
|
keepUnusedPlugins = true
|
|
}
|
|
}
|