Skip to content

Commit

Permalink
Reject non-stable versions for dependencyUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Jun 2, 2024
1 parent eb520dd commit 2e5baaa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ dependencies {
testImplementation("org.skyscreamer:jsonassert:1.5.1")
}

def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}

tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down Expand Up @@ -106,7 +118,7 @@ spotless {
test {
useJUnitPlatform()
testLogging {
events "PASSED", "FAILED", "SKIPPED"
events "FAILED"
showStandardStreams = true
exceptionFormat "full"
}
Expand Down

0 comments on commit 2e5baaa

Please sign in to comment.