Dominaezzz
05/19/2022, 7:21 PMandylamax
05/20/2022, 9:24 AMlocal.properties
file. No?Dominaezzz
05/20/2022, 10:26 AMAlexandre Brown
05/21/2022, 1:18 AMgradle.properties
file
Ex:
kotlin.code.style=official
org.gradle.parallel=true
logbackVersion=1.2.11
awsVersion=0.15.1-beta
ktorVersion=1.6.8
kotlinxSerializationVersion=1.3.1
koinVersion=3.1.4
korimVersion=2.2.2
Then reference the versions in a build.gradle.kts file
val logbackVersion: String by project
val awsVersion: String by project
val ktorVersion: String by project
val kotlinxSerializationVersion: String by project
val koinVersion: String by project
dependencies {
implementation(project(":core:core-maths"))
implementation("ch.qos.logback:logback-classic:$logbackVersion")
...
}
You can also use by rootProject
instead if you have a nested module and want to get the value from a root gradle property file instead of the immediate parent.Dominaezzz
05/22/2022, 6:45 PMDominaezzz
05/22/2022, 6:45 PMAlexandre Brown
05/22/2022, 7:08 PMval myVar: String = System.getenv("varname")
Dominaezzz
05/22/2022, 7:10 PMAlexandre Brown
05/25/2022, 1:12 AMAlexandre Brown
05/25/2022, 1:12 AMexport MY_VAR=var_value
Dominaezzz
05/25/2022, 7:47 AMDominaezzz
05/25/2022, 7:48 AM