Skip to content

Commit 34a85df

Browse files
authored
Merge pull request #1222 from hamoid/addDependencyUpdates
Add Gradle task to check for dependency updates
2 parents 2e855a1 + 3fbfddb commit 34a85df

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "
4343
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
4444
download = { id = "de.undercouch.download", version = "5.6.0" }
4545
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
46-
gradlePublish = { id = "com.gradle.plugin-publish", version = "1.2.1" }
46+
versions = { id = "com.github.ben-manes.versions", version = "0.52.0" }
47+
gradlePublish = { id = "com.gradle.plugin-publish", version = "1.2.1" }

0 commit comments

Comments
 (0)