nuhkoca
05/22/2019, 7:23 PMgradle.properties
and apply it with buildConfigField
Below doesn’t work, I mean BASE_URL is not detected.
buildTypes.forEach {
it.buildConfigField("String", "BASE_URL", BASE_URL)
it.buildConfigField("String", "BASE_PLAYER_URL", BASE_PLAYER_URL)
it.buildConfigField("String", "ACCESS_TOKEN", ACCESS_TOKEN)
}
gradle.properties
BASE_URL = "url"
BASE_PLAYER_URL = "url"
ACCESS_TOKEN = "token"
snowe
05/22/2019, 7:24 PMsnowe
05/22/2019, 7:24 PMgradle.properties
?snowe
05/22/2019, 7:25 PMgradle.properties
file in your build.gradle.kts
you can look here. https://github.com/gradle/kotlin-dsl/tree/master/samples/project-propertiesnuhkoca
05/22/2019, 7:25 PMsnowe
05/22/2019, 7:25 PMnuhkoca
05/22/2019, 7:26 PMsnowe
05/22/2019, 7:27 PMval BASE_URL: String by project
though I don't know if it works with all caps variables.nuhkoca
05/22/2019, 7:28 PMsnowe
05/22/2019, 7:29 PM