Files
VesiscanClinicalAndroid/app/build.gradle.kts
T
dw.jang 5f40896bee build: 앱 이름을 vesiscan-demo 로 · applicationId 충돌 제거
이 브랜치는 동결 시연판이다. 이제 앱이 셋으로 늘어 한 폰에 같이 깔리므로, 이름과
applicationId 를 1:1 로 못 박아 무엇이 무엇인지 헷갈리지 않게 한다.

  vesiscan-demo       com.medithings.vesiscan.demo        ← 이 브랜치
  vesiscan-user       com.medithings.vesiscan             ← vesiscan_pre_product
  vesiscan-caregiver  com.medithings.vesiscan.caregiver   ← vesiscan_pre_product

## 이름
"VesiScan-Basic Demo"(demo) · "VesiScan Dev"(dev) 를 각각 vesiscan-demo ·
vesiscan-demo-dev 로. 예전 이름은 **무슨 앱인지가 아니라 어떤 빌드인지**만 알려 줘서,
폰에 여러 개가 깔리면 구별할 수 없었다.

## applicationId — 이게 진짜 문제였다
base 가 `com.medithings.vesiscan` 이고 demo 플레이버가 `.demo` 를 붙이는 구조라,
**dev 플레이버는 접미가 없어 `com.medithings.vesiscan`** 이었다. 그 id 는 새 저장소의
환자 앱과 정확히 같다 — 이 브랜치에서 devDebug 를 한 번 빌드해 깔면 환자 앱이
말없이 덮어써진다. 이름을 아무리 잘 붙여도 막을 수 없는 종류의 사고다.

base 를 `com.medithings.vesiscan.demo` 로 옮기고(=demo 빌드의 id 는 그대로),
demo 는 접미 없음, dev 는 `.dev` 를 붙인다. 이제 어떤 플레이버를 빌드해도 다른 앱을
건드리지 않는다.

검증: aapt2 dump badging — package `com.medithings.vesiscan.demo` ·
label `vesiscan-demo` · versionName `2.0.0-demo`. assembleDemoDebug PASS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-02 10:31:01 +09:00

112 lines
4.8 KiB
Kotlin

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.medithings.vesiscan"
compileSdk {
version = release(36)
}
defaultConfig {
// 이 브랜치(demo-final)는 **동결 시연판**이다. 다른 저장소
// (vesiscan_pre_product/vesiscan_android_user)가 만드는 두 앱과 한 폰에
// 같이 깔려야 하므로 applicationId 부터 겹치지 않게 못 박는다:
// vesiscan-demo com.medithings.vesiscan.demo ← 여기
// vesiscan-user com.medithings.vesiscan
// vesiscan-caregiver com.medithings.vesiscan.caregiver
//
// 2026-09-02 이전에는 base 가 `com.medithings.vesiscan` 이고 demo 플레이버가
// `.demo` 를 붙이는 구조였다. demo 빌드의 id 는 지금과 같지만, **dev 플레이버가
// 접미 없이 `com.medithings.vesiscan`** 이라 새 저장소의 환자 앱을 그대로
// 덮어썼다. 여기서 base 를 옮겨 그 구멍을 막는다.
applicationId = "com.medithings.vesiscan.demo"
minSdk = 24
targetSdk = 36
versionCode = 200
versionName = "2.0.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
// Product flavors — demo(동결 안정판) / dev(개발 진행).
// 자세한 운영 정책은 docs/FLAVOR_DEMO_STABLE.md 참고.
flavorDimensions += "channel"
productFlavors {
create("demo") {
dimension = "channel"
// 접미 없음 — base 가 이미 `.demo` 다(위 defaultConfig 주석 참고).
// 이 플레이버가 만드는 것이 곧 vesiscan-demo 이고, 이 브랜치에서 빌드할
// 것은 이것뿐이다.
versionNameSuffix = "-demo"
buildConfigField("Boolean", "IS_DEMO", "true")
buildConfigField("String", "FLAVOR_LABEL", "\"demo\"")
// 시연/안정 검증용 — 방광 모형 테스트가 100% 통과하는 시점을 git tag로 동결.
// src/demo/* 하위에 동결 시점의 알고리즘/파라미터를 격리해 두면 main 변경에 영향받지 않음.
}
create("dev") {
dimension = "channel"
// 동결 브랜치에 개발 채널이 남아 있을 이유는 없지만, 실수로 빌드해도
// 다른 앱을 덮어쓰지 않도록 id 를 갈라 둔다.
applicationIdSuffix = ".dev"
versionNameSuffix = "-dev"
buildConfigField("Boolean", "IS_DEMO", "false")
buildConfigField("String", "FLAVOR_LABEL", "\"dev\"")
// 개발 진행 — 모든 신규 기능/실험/리팩토링은 dev에서만.
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
buildConfig = true
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons)
implementation(libs.androidx.compose.foundation)
implementation(libs.gson)
implementation(libs.androidx.security.crypto)
implementation(libs.rive.android)
implementation(libs.androidx.startup.runtime)
// 2026-08-12: YOLO/CameraX/MLKit 제거 (소변컵 사진 인식 기능 폐기).
implementation("com.squareup.okhttp3:okhttp:4.12.0") // HF API
implementation(libs.mcumgr.ble) // Firmware DFU (SMP-over-BLE)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
}