Files
NESLite/docs/build.md
T

58 lines
2.4 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.
# NESLite 可复现构建说明
本说明对应 M0~M4 基线。命令使用系统默认 PowerShell 7.6.6(`pwsh`)从仓库根目录执行;不需要手工复制 `.so`、
FCEUmm 或 Oboe 文件。
## 前置条件
1. 安装或使用 [toolchain.md](toolchain.md) 中的 JDK 17.0.17+10、SDK Platform 36.1、
NDK 28.2.13676358 与 Android CMake 3.22.1。
2. 设置 `JAVA_HOME` 指向 JDK 17;不能用系统默认的 JDK 21。
3. 设置 `ANDROID_HOME`(或在未设置时使用本机记录的 SDK 根目录)。`local.properties` 仅保存
本机 `sdk.dir`,不提交。
4. 首次构建需要访问 Google Maven、Maven Central 与 Gradle 分发服务,以取得已锁定版本。
5. M2~M4 构建原生内核、音频和输入层前,运行:
```powershell
.\tools\fetch-third-party.ps1
```
该脚本根据 `third_party/manifest.json` 检出固定提交;M4 构建需要 FCEUmm、libretro headers 与 Oboe。
## 构建调试 APK
```powershell
pwsh -NoProfile -File .\tools\check.ps1 -Scope Build
```
产物为 `app/build/outputs/apk/debug/app-debug.apk`,其中只包含 `arm64-v8a` 的
`libneslite_jni.so`。调试包的 application ID 是 `org.neslite.app.debug`。
## 有界检查入口
| 命令 | 范围 | 不会执行 |
| --- | --- | --- |
| `pwsh -NoProfile -File ./tools/check.ps1 -Scope Build` | 生成调试 APK | 单元、原生、实机、长测 |
| `pwsh -NoProfile -File ./tools/check.ps1 -Scope Local` | Kotlin 本地单元测试 | APK、原生、实机、长测 |
| `pwsh -NoProfile -File ./tools/check.ps1 -Scope Module` | 原生 smoke test 与 Kotlin 本地单测 | APK、实机、长测 |
| `pwsh -NoProfile -File ./tools/check.ps1 -Scope Stage` | 当前 APK、原生 smoke test 与 Kotlin 本地单测 | 设备、ROM 兼容、耐久、H 专项 |
`Stage` 是本地阶段入口,不是 G1~G9 的替代。实机、ROM、存档、插拔和耐久验收必须在
相应里程碑按 [acceptance.md](acceptance.md) 执行和记录。
## M1 诊断版安装
连接并授权一台目标手机后执行:
```powershell
pwsh -NoProfile -File .\tools\check-m1-device.ps1
```
脚本安装并启动 `0.1.3-debug` 诊断版;手柄操作和导出步骤见
[controller-x5lite.md](controller-x5lite.md)。连接多台设备时传入 `-Serial <adb序列号>`。
## 清理
只清理本工程生成物时删除 `build/`、`app/build/` 和 `.build/`;不要删除 SDK、NDK、
`.toolchains/` 或用户的签名密钥。上述输出均已被 Git 忽略。