Skip to content

Commit d4e8510

Browse files
authored
Merge pull request #303 from suntrix/dependency-updates
added plugin to help checking for dependency updates
2 parents f3ec8f6 + c8000a9 commit d4e8510

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
55
plugins {
66
kotlin("multiplatform") version "1.6.10" apply false
77
id("base")
8+
id("com.github.ben-manes.versions") version "0.42.0"
89
}
910

1011
buildscript {
@@ -268,3 +269,23 @@ subprojects {
268269
}
269270
}
270271
}
272+
273+
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
274+
275+
fun isNonStable(version: String): Boolean {
276+
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
277+
val versionMatch = "^[0-9,.v-]+(-r)?$".toRegex().matches(version)
278+
279+
return (stableKeyword || versionMatch).not()
280+
}
281+
282+
rejectVersionIf {
283+
isNonStable(candidate.version)
284+
}
285+
286+
checkForGradleUpdate = true
287+
outputFormatter = "plain,html"
288+
outputDir = "build/dependency-reports"
289+
reportfileName = "dependency-updates"
290+
}
291+
// check for latest dependencies - ./gradlew dependencyUpdates -Drevision=release

0 commit comments

Comments
 (0)