2022-04-26 05:08:28 -07:00
|
|
|
buildscript {
|
|
|
|
dependencyLocking {
|
2024-01-02 06:15:27 -08:00
|
|
|
// This property is treated specially, as it is not defined by default in the root gradle.properties
|
|
|
|
// and declaring it in the root gradle.properties is ignored by included builds. This only picks up
|
|
|
|
// a value declared as a system property, a command line argument, or an environment variable.
|
|
|
|
val isDependencyLockingEnabled = if (project.hasProperty("ZCASH_IS_DEPENDENCY_LOCKING_ENABLED")) {
|
|
|
|
project.property("ZCASH_IS_DEPENDENCY_LOCKING_ENABLED").toString().toBoolean()
|
|
|
|
} else {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
if (isDependencyLockingEnabled) {
|
|
|
|
lockAllConfigurations()
|
|
|
|
}
|
2022-04-26 05:08:28 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencyLocking {
|
2024-01-02 06:15:27 -08:00
|
|
|
// This property is treated specially, as it is not defined by default in the root gradle.properties
|
|
|
|
// and declaring it in the root gradle.properties is ignored by included builds. This only picks up
|
|
|
|
// a value declared as a system property, a command line argument, or an environment variable.
|
|
|
|
val isDependencyLockingEnabled = if (project.hasProperty("ZCASH_IS_DEPENDENCY_LOCKING_ENABLED")) {
|
|
|
|
project.property("ZCASH_IS_DEPENDENCY_LOCKING_ENABLED").toString().toBoolean()
|
|
|
|
} else {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
if (isDependencyLockingEnabled) {
|
|
|
|
lockAllConfigurations()
|
|
|
|
}
|
2022-04-26 05:08:28 -07:00
|
|
|
}
|
|
|
|
|
2022-04-25 05:07:50 -07:00
|
|
|
plugins {
|
2023-02-07 10:35:51 -08:00
|
|
|
id("bip39.detekt-conventions")
|
2022-04-25 05:07:50 -07:00
|
|
|
id("bip39.ktlint-conventions")
|
2022-06-02 11:53:46 -07:00
|
|
|
alias(libs.plugins.versions)
|
2022-05-04 11:55:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
2022-06-02 11:53:46 -07:00
|
|
|
|
|
|
|
withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
|
|
|
|
gradleReleaseChannel = "current"
|
|
|
|
|
|
|
|
resolutionStrategy {
|
|
|
|
componentSelection {
|
|
|
|
all {
|
|
|
|
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
|
|
|
|
reject("Unstable")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-25 05:07:50 -07:00
|
|
|
}
|
2022-06-02 11:53:46 -07:00
|
|
|
|
2022-06-03 06:41:35 -07:00
|
|
|
val unstableKeywords = listOf("alpha", "beta", "rc", "m", "ea", "build")
|
2022-06-02 11:53:46 -07:00
|
|
|
fun isNonStable(version: String): Boolean {
|
2023-06-09 06:19:25 -07:00
|
|
|
val versionLowerCase = version.lowercase()
|
2022-06-02 11:53:46 -07:00
|
|
|
|
|
|
|
return unstableKeywords.any { versionLowerCase.contains(it) }
|
|
|
|
}
|