Skip to content

Commit 452fbce

Browse files
committed
Add Gradle task to check for dependency updates
1 parent 198f593 commit 452fbce

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

build.gradle.kts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,27 @@ plugins {
44

55
alias(libs.plugins.compose.compiler) apply false
66
alias(libs.plugins.jetbrainsCompose) apply false
7+
8+
alias(libs.plugins.versions)
79
}
810

911
// Set the build directory to not /build to prevent accidental deletion through the clean action
1012
// Can be deleted after the migration to Gradle is complete
11-
layout.buildDirectory = file(".build")
13+
layout.buildDirectory = file(".build")
14+
15+
// Configure the dependencyUpdates task
16+
tasks {
17+
dependencyUpdates {
18+
gradleReleaseChannel = "current"
19+
20+
val nonStableKeywords = listOf("alpha", "beta", "rc")
21+
22+
fun isNonStable(version: String) = nonStableKeywords.any {
23+
version.lowercase().contains(it)
24+
}
25+
26+
rejectVersionIf {
27+
isNonStable(candidate.version) && !isNonStable(currentVersion)
28+
}
29+
}
30+
}

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kotlin = "2.0.20"
33
compose-plugin = "1.7.1"
44
jogl = "2.5.0"
55
jupiter = "5.12.0"
6+
versions = "0.52.0"
67

78
[libraries]
89
jogl = { module = "org.jogamp.jogl:jogl-all-main", version.ref = "jogl" }
@@ -36,4 +37,5 @@ kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref =
3637
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
3738
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
3839
download = { id = "de.undercouch.download", version = "5.6.0" }
39-
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
40+
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
41+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }

0 commit comments

Comments
 (0)