mirror of
https://github.com/gotson/komga.git
synced 2025-01-08 11:47:47 +08:00
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
|
|
|
|
plugins {
|
|
run {
|
|
val kotlinVersion = "1.7.0"
|
|
kotlin("jvm") version kotlinVersion
|
|
kotlin("plugin.spring") version kotlinVersion
|
|
kotlin("kapt") version kotlinVersion
|
|
}
|
|
id("org.jlleitschuh.gradle.ktlint") version "10.3.0"
|
|
id("com.github.ben-manes.versions") version "0.42.0"
|
|
}
|
|
|
|
fun isNonStable(version: String): Boolean {
|
|
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
|
|
val unstableKeyword = listOf("ALPHA", "RC").any { version.toUpperCase().contains(it) }
|
|
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
|
|
val isStable = stableKeyword || regex.matches(version)
|
|
return unstableKeyword || !isStable
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
apply(plugin = "org.jlleitschuh.gradle.ktlint")
|
|
apply(plugin = "com.github.ben-manes.versions")
|
|
|
|
tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
|
|
// disallow release candidates as upgradable versions from stable versions
|
|
rejectVersionIf {
|
|
isNonStable(candidate.version) && !isNonStable(currentVersion)
|
|
}
|
|
gradleReleaseChannel = "current"
|
|
checkConstraints = true
|
|
}
|
|
|
|
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
|
|
version.set("0.45.2")
|
|
filter {
|
|
exclude("**/db/migration/**")
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.wrapper {
|
|
gradleVersion = "7.4.2"
|
|
distributionType = Wrapper.DistributionType.ALL
|
|
}
|