diff --git a/clients/wearos/app/build.gradle.kts b/clients/wearos/app/build.gradle.kts index 258e5e6..6ad7eac 100644 --- a/clients/wearos/app/build.gradle.kts +++ b/clients/wearos/app/build.gradle.kts @@ -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/.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")}\""