59 lines
1.7 KiB
Plaintext
59 lines
1.7 KiB
Plaintext
import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.exclude
|
|
|
|
buildscript {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
maven("https://jitpack.io")
|
|
gradlePluginPortal()
|
|
}
|
|
dependencies {
|
|
classpath("com.android.tools.build:gradle:${properties["ANDROID_GRADLE_PLUGIN_VERSION"]}")
|
|
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${properties["ANDROIDX_NAVIGATION_VERSION"]}")
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id("com.github.ben-manes.versions")
|
|
id("io.gitlab.arturbosch.detekt")
|
|
id("zcash.ktlint-conventions")
|
|
}
|
|
|
|
tasks {
|
|
register("detektAll", io.gitlab.arturbosch.detekt.Detekt::class) {
|
|
parallel = true
|
|
setSource(files(projectDir))
|
|
include("**/*.kt")
|
|
include("**/*.kts")
|
|
exclude("**/resources/**")
|
|
exclude("**/build/**")
|
|
exclude("**/commonTest/**")
|
|
exclude("**/jvmTest/**")
|
|
exclude("**/androidTest/**")
|
|
config.setFrom(files("${rootProject.projectDir}/tools/detekt.yml"))
|
|
buildUponDefaultConfig = true
|
|
}
|
|
|
|
withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
|
|
gradleReleaseChannel = "current"
|
|
|
|
resolutionStrategy {
|
|
componentSelection {
|
|
all {
|
|
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
|
|
reject("Unstable")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
val unstableKeywords = listOf("alpha", "beta", "rc", "m", "ea", "build")
|
|
|
|
fun isNonStable(version: String): Boolean {
|
|
val versionLowerCase = version.toLowerCase()
|
|
|
|
return unstableKeywords.any { versionLowerCase.contains(it) }
|
|
}
|