Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import java.util.Base64
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.dokka)
alias(libs.plugins.dependencyUpdates)
id("signing")
id("maven-publish")
}
Expand Down Expand Up @@ -159,4 +160,19 @@ if (canSignArtifacts) {
}

private fun Project.getPropertyOrEmpty(name: String): String =
if (hasProperty(name)) property(name) as String? ?: "" else ""
if (hasProperty(name)) property(name) as String? ?: "" else ""

// -- START: Check version only accepts stable versions
private val instableVersionRegex = "[0-9,.v-]+(-r)?(.*)".toRegex()
private fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
return !stableKeyword && !instableVersionRegex.matches(version)
}

tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
gradleReleaseChannel = "stable"
}
// -- END
8 changes: 5 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[versions]
kotlin = "2.2.0"
dokka = "2.0.0"
kotlin = "2.3.0"
dokka = "2.1.0"
dependencyUpdatesVersions = "0.53.0"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
dependencyUpdates = { id = "com.github.ben-manes.versions", version.ref = "dependencyUpdatesVersions" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading