2021-09-14 14:02:06 -07:00
|
|
|
import org.jetbrains.kotlin.konan.properties.loadProperties
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
`kotlin-dsl`
|
|
|
|
}
|
|
|
|
|
2022-04-04 06:23:39 -07:00
|
|
|
buildscript {
|
|
|
|
dependencyLocking {
|
2022-07-22 10:00:04 -07: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 a 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-04 06:23:39 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-22 10:00:04 -07:00
|
|
|
|
2022-04-04 06:23:39 -07:00
|
|
|
dependencyLocking {
|
2022-07-22 10:00:04 -07: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 a 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-04 06:23:39 -07:00
|
|
|
}
|
|
|
|
|
2021-09-14 14:02:06 -07:00
|
|
|
dependencies {
|
2021-10-18 11:27:16 -07:00
|
|
|
val rootProperties = getRootProperties()
|
2021-09-14 14:02:06 -07:00
|
|
|
|
2021-10-18 11:27:16 -07:00
|
|
|
implementation("com.android.tools.build:gradle:${rootProperties.getProperty("ANDROID_GRADLE_PLUGIN_VERSION")}")
|
2023-01-22 12:37:52 -08:00
|
|
|
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${rootProperties.getProperty("DETEKT_VERSION")}")
|
2023-02-10 04:18:58 -08:00
|
|
|
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProperties.getProperty("KOTLIN_VERSION")}") {
|
|
|
|
// https://youtrack.jetbrains.com/issue/KT-56414/Dependency-locking-and-failed-builds-with-Kotlin-1.8.10
|
|
|
|
exclude(group = "org.jetbrains.kotlin", module = "kotlin-build-common")
|
|
|
|
}
|
2022-05-17 07:06:56 -07:00
|
|
|
implementation("wtf.emulator:gradle-plugin:${rootProperties.getProperty("EMULATOR_WTF_GRADLE_PLUGIN_VERSION")}")
|
2021-09-14 14:02:06 -07:00
|
|
|
}
|
2021-10-18 11:27:16 -07:00
|
|
|
|
|
|
|
// A slightly gross way to use the root gradle.properties as the single source of truth for version numbers
|
|
|
|
fun getRootProperties() = loadProperties(File(project.projectDir.parentFile, "gradle.properties").path)
|