diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 220b692..d868608 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -32,9 +32,8 @@ android { isDebuggable = props.getProperty("DEBUGGABLE").toBoolean() applicationIdSuffix = ".debug" buildConfigField("boolean", "DEBUG", "true") - listOf("DEBUG_SERVER1", "DEBUG_SERVER2").forEach { key -> - buildConfigField("String", key, props.getProperty(key)?.let { "\"$it\"" } ?: "null") - } + val debugServers = props.getProperty("DEBUG_SERVERS").split('|').map { "\"$it\"" } + buildConfigField("String[]", "DEBUG_SERVERS", debugServers.joinToString(",", "{", "}")) } release { isMinifyEnabled = true diff --git a/app/src/debug/kotlin/org/sirekanyan/outline/db/DebugDaoImpl.kt b/app/src/debug/kotlin/org/sirekanyan/outline/db/DebugDaoImpl.kt index efb050e..2b854ca 100644 --- a/app/src/debug/kotlin/org/sirekanyan/outline/db/DebugDaoImpl.kt +++ b/app/src/debug/kotlin/org/sirekanyan/outline/db/DebugDaoImpl.kt @@ -19,10 +19,7 @@ class DebugDaoImpl(private val database: OutlineDatabase) : DebugDao { database.transaction { keyQueries.truncate() serverQueries.truncate() - listOfNotNull( - BuildConfig.DEBUG_SERVER1, - BuildConfig.DEBUG_SERVER2, - ).forEachIndexed { index, url -> + BuildConfig.DEBUG_SERVERS.forEachIndexed { index, url -> serverQueries.insert(ServerEntity(url, true, "Server ${index + 1}", null, null)) } }