Review feedback- simplifies an expression

MAILAND-2711
This commit is contained in:
Maciej Surmacz 2022-01-19 15:20:44 +01:00
parent 959a9adf26
commit 8616dad049
1 changed files with 6 additions and 11 deletions

View File

@ -160,18 +160,13 @@ android(
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
var testOnLive = false
val testEnvUrl = if (project.hasProperty("testEnv")) {
when (project.properties["testEnv"]) {
"local" -> "${privateProperties["local_endpointUrl"]}"
"test" -> "${privateProperties["test_endpointUrl"]}"
else -> {
testOnLive = true
"${privateProperties["live_endpointUrl"]}"
}
val testEnvUrl = when (project.properties["testEnv"] ?: "live") {
"local" -> "${privateProperties["local_endpointUrl"]}"
"test" -> "${privateProperties["test_endpointUrl"]}"
else -> {
testOnLive = true
"${privateProperties["live_endpointUrl"]}"
}
} else {
testOnLive = true
"${privateProperties["live_endpointUrl"]}"
}
buildConfigField("String", "TEST_ENDPOINT_URL", "\"$testEnvUrl\"")