Parcourir la source

Added list of debug servers

Vadik Sirekanyan il y a 2 ans
Parent
commit
d0630ed45b

+ 2 - 3
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

+ 1 - 4
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))
             }
         }