refactor(wear): drop local.properties fallback for doctate.* keys

Profile file (via -Pdoctate.* injected by run.sh) is now the only source.
local.properties stays gitignored but is no longer consulted by the build.

refs #3
This commit is contained in:
2026-05-20 18:55:40 +02:00
parent 4d9b6126fb
commit 78868f86af
+6 -14
View File
@@ -1,5 +1,3 @@
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
@@ -23,19 +21,13 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// Build-time config resolved in this order:
// 1. Gradle CLI property (-Pdoctate.serverUrl=...) — used by run.sh
// to switch between emulator and watch builds without touching
// local.properties.
// 2. local.properties (gitignored) — sticky per-developer default.
// 3. Hardcoded fallback — emulator loopback + sentinel key.
val localProps = Properties().apply {
rootProject.file("local.properties").takeIf { it.exists() }
?.inputStream()?.use { load(it) }
}
// 1. Gradle CLI property (-Pdoctate.serverUrl=...) — set by run.sh
// from the active profile (profiles.d/<name>.sh).
// 2. Hardcoded fallback — emulator loopback + sentinel key. This
// path is only taken for the `emulator` target, which has no
// profile concept.
fun resolveProp(key: String, default: String): String =
(project.findProperty(key) as? String)
?: localProps.getProperty(key)
?: default
(project.findProperty(key) as? String) ?: default
buildConfigField(
"String", "SERVER_URL",
"\"${resolveProp("doctate.serverUrl", "http://10.0.2.2:3000")}\""