2021-09-25 05:13:14 -07:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
gradlePluginPortal()
|
|
|
|
}
|
|
|
|
dependencies {
|
2021-09-25 06:44:31 -07:00
|
|
|
classpath(libs.gradle.plugin.android)
|
|
|
|
classpath(libs.gradle.plugin.rust)
|
|
|
|
classpath(libs.gradle.plugin.publish)
|
|
|
|
classpath(libs.gradle.plugin.navigation)
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("org.jetbrains.dokka")
|
|
|
|
id("org.owasp.dependencycheck")
|
|
|
|
id("zcash.ktlint-conventions")
|
|
|
|
id("io.gitlab.arturbosch.detekt")
|
2021-09-25 07:55:02 -07:00
|
|
|
id("com.github.ben-manes.versions")
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2021-09-25 07:55:02 -07:00
|
|
|
|
|
|
|
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) }
|
|
|
|
}
|