Files
android-client/docs/decisions/0003-toolchain-and-versions.md
2026-09-03 19:03:35 +08:00

24 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ADR 0003:工具链与版本选型
- **状态**:已接受
- **日期**:2026-09-03
## 背景
需要为一套现代化 Android 技术栈锁定版本。项目原本是 AGP 9.4.0 + Kotlin 2.2.10 + Gradle 9.6.0。
## 决策
- **保留**:Gradle 9.6.0(wrapper)、AGP 9.4.0、compileSdk/targetSdk 37、minSdk 28、Compose BOM 2026.02.01。
- **对齐 nowinandroid 已验证矩阵**:Kotlin 2.3.0、KSP 2.3.4、Hilt 2.59、Room 2.8.3、Retrofit 2.11.0、OkHttp 4.12.0、kotlinx-coroutines 1.10.1、kotlinx-serialization 1.8.0、Navigation Compose 2.8.5、DataStore 1.2.0、Lifecycle 2.10.0、truth 1.4.4、turbine 1.2.0、spotless 8.3.0、ktlint 1.4.0。
## 理由
- 采用 AGP 9 内置 Kotlin(不显式应用 `org.jetbrains.kotlin.android`),与项目原有模板一致,且经 nowinandroid 验证可与 KSP/Hilt/Room 共存。
- Kotlin 升到 2.3.0 是为了直接复用 nowinandroid 已证明可用的 KSP 2.3.4 / Hilt 2.59 / Room 2.8.3 组合,避免为旧 Kotlin 猜测 KSP 补丁版本。
## 后果
- 全量构建已验证通过(`:app:assembleDebug`)。
- 若未来 AGP 升级改变内置 Kotlin 行为,需回归验证 KSP/Hilt/Room 兼容性。