Files
android-client/docs/decisions/0001-multi-module-nia.md
2026-09-03 19:03:35 +08:00

23 lines
949 B
Markdown
Raw Permalink 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 0001:多模块 NIA 架构,feature 单模块(不做 api/impl 拆分)
- **状态**:已接受
- **日期**:2026-09-03
## 背景
项目从单模块 Compose 模板起步,需要确立可扩展、可测试、可维护的架构基础。
## 决策
采用 Google Now in Android(NIA)风格多模块架构:`app`(组合根)+ `core/*`(共享能力)+ `feature/*`(业务功能)。每个 feature 用**单模块**,不做 nowinandroid 的 `feature:*/api` + `feature:*/impl` 拆分。
## 理由
- 依赖方向单向、职责清晰,符合参考项目 `nowinandroid` 与 `app_device` 的共识。
- 团队规模小、feature 间共享少,api/impl 拆分会带来额外模块与样板,收益有限。
## 后果
- 约定插件 `mcl.android.feature` 预置 feature 通用依赖,新增 feature 只需一个插件声明。
- 若未来 feature 间需要稳定 API 边界,再引入 api/impl 拆分(成本可控)。