Skip to content

Commit

Permalink
Use gradle-versions-plugin to check for dependency updates.
Browse files Browse the repository at this point in the history
+ This plugin adds the "dependencyUpdates" Gradle task.
+ Configure to only offer stable versions.
+ Plugin website: https://github.com/ben-manes/gradle-versions-plugin
  • Loading branch information
johnjohndoe committed Oct 21, 2020
1 parent a11bb4a commit 4a15cdc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ plugins {
id "idea"
id "org.jetbrains.intellij" version "0.4.13"
id "com.github.johnrengelman.shadow" version "5.1.0"
id "com.github.ben-manes.versions" version "0.33.0"
}

apply from: "gradle/versions.gradle"

sourceCompatibility = javaVersion
targetCompatibility = javaVersion

Expand Down
14 changes: 14 additions & 0 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Gradle Versions Plugin

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

0 comments on commit 4a15cdc

Please sign in to comment.