Skip to content

Commit

Permalink
Allow only stable versions for dependencyUpdates (#8350)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov authored Jun 2, 2024
1 parent 568aef5 commit f00e90a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ dependencyRules {
}
}

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

// reject all non stable versions
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}

allprojects {
apply plugin: 'java-library'
apply plugin: 'java-test-fixtures'
Expand Down Expand Up @@ -248,6 +261,7 @@ allprojects {
options.encoding = 'UTF-8'

}

/*
* Pass some system properties provided on the gradle command line to test executions for
* convenience.
Expand Down

0 comments on commit f00e90a

Please sign in to comment.