Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: WoLeo-Z <[email protected]>
Co-authored-by: StageGuard <[email protected]>
  • Loading branch information
3 people authored Jan 27, 2025
1 parent bf082d9 commit af96782
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/contributing/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ flowchart TD

Ani 使用 Gradle 构建系统。Gradle 构建系统由多个模块 (module) 组成,每个模块都有自己的功能和职责。

Ani 客户端大致包含 30 个模块。我们可以把它们分成一下几个类别,这也对应了仓库内的目录结构:
Ani 客户端大致包含 30 个模块。我们可以把它们分成以下几个类别,这也对应了仓库内的目录结构:

- `utils`:基础工具模块,包含日志库、序列化、BBCode 等基础工具
- `datasource`:数据源
Expand Down Expand Up @@ -122,7 +122,7 @@ UI 层负责展示数据,Domain 层负责业务逻辑,Data 层负责数据

- `app-platform`:平台层。用于适配不同平台的基础需求。包含 BuildConfig、权限管理、音量控制器等。
> **平台**:即 APP 支持的操作系统。例如 Android,macOS,Windows,iOS。
- `app-data`:数据层与业务层。由于一些历史遗留原因,该模块内部同时数据层和业务层的代码
- `app-data`:数据层与业务层。由于一些历史遗留原因,该模块内部同时有数据层和业务层的代码
不过在不同包名下:
- `src/commonMain/data`:数据层,包含数据库持久化,网络处理。
- `src/commonMain/domain`:业务层,包含各个功能的业务逻辑,处理数据源的数据。
Expand Down
7 changes: 5 additions & 2 deletions docs/contributing/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ ani.dandanplay.app.secret=aaaaaaaaaaaaaaa

### 打包 Android APP

在 IDE 中双击 Ctrl, 执行 `./gradlew assembleRelease``./gradlew assembleDebug`
,分别编译发布版或测试版。使用 `./gradlew installRelease``./gradlew installDebug` 还可以构建应用并安装到模拟器。
在 IDE 中双击 Ctrl,可用的命令:
- `./gradlew assembleRelease` - 编译发布版
- `./gradlew assembleDebug` - 编译测试版
- `./gradlew installRelease` - 构建发布版并安装到模拟器
- `./gradlew installDebug` - 构建测试版并安装到模拟器

在 IDE 上也可以选择 `Build -> Build Bundle(s) / APK(s) -> Build APK(s)` 来构建 APK.

Expand Down
4 changes: 2 additions & 2 deletions docs/contributing/kmp.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ Compose Multiplatform 在 `desktop` 和 `ios` 均使用 [Skiko][Skiko] 渲染,
### 如何增加多平台功能

`common` 内可以使用 `expect fun` 定义一个没有函数体的函数,然后在 `android``desktop` 内使用
`actual fun` 实现它,这样就可以在 common 内间接访问到平台相关的功能。
`actual fun` 实现它,这样就可以在 `common` 内间接访问到平台相关的功能。

要开发一个适配各个平台的功能的流程通常是如下所示。

以增加视频播放器为例:

1.`commonMain` 中增加 `expect fun VideoPlayer(state: ediampPlayer)`。该函数没有函数体,
1.`commonMain` 中增加 `expect fun VideoPlayer(state: MediampPlayer)`。该函数没有函数体,
各个平台分别实现函数体;
2. 考虑该功能应当如何在各个平台实现。对于视频播放器,我们需要在三个平台分别实现;
3.`androidMain``desktopMain``appleMain` 中分别增加
Expand Down

0 comments on commit af96782

Please sign in to comment.