Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 75318e7

Browse files
committed
merge: integrate preflight readiness and diff-report optimizations into main
2 parents 5741671 + 703df69 commit 75318e7

14 files changed

Lines changed: 1344 additions & 6 deletions

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ sudo python3 main.py --stock <底包路径> --port <移植包路径> --pack-type
151151
| `--clean` | 开始前清理工作目录 | `false` |
152152
| `--debug` | 开启调试日志 | `false` |
153153
| `--eu-bundle` | EU 本地化资源包 (ZIP) 的路径或 URL ||
154+
| `--preflight-only` | 仅执行预检并输出报告,然后退出 | `false` |
155+
| `--skip-preflight` | 跳过预检阶段(不建议) | `false` |
156+
| `--preflight-strict` | 将风险项也视为失败项(用于严格阻断) | `false` |
157+
| `--preflight-report` | 预检 JSON 报告输出路径 | `build/preflight-report.json` |
158+
| `--enable-snapshots` | 在关键阶段保存工作目录快照 | `false` |
159+
| `--snapshot-dir` | 快照目录(未设置时使用 `<work-dir>/snapshots`| `null` |
160+
| `--rollback-to-snapshot` | 从指定快照恢复目标工作目录并退出 | `null` |
161+
| `--enable-diff-report` | 生成产物差异报告(前后文件/属性/APK变化) | `false` |
162+
| `--diff-report` | 差异报告 JSON 输出路径 | `build/diff-report.json` |
154163

155164
---
156165

README_EN.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ sudo python3 main.py --stock <path_to_stock_zip> --port <path_to_port_zip> --pac
153153
| `--clean` | Clean work directory before starting | `false` |
154154
| `--debug` | Enable verbose debug logging | `false` |
155155
| `--eu-bundle` | Path/URL to EU Localization Bundle ZIP | N/A |
156+
| `--preflight-only` | Run preflight checks only, emit report, then exit | `false` |
157+
| `--skip-preflight` | Skip the preflight phase (not recommended) | `false` |
158+
| `--preflight-strict` | Treat risk findings as failures (strict gating) | `false` |
159+
| `--preflight-report` | Output path for preflight JSON report | `build/preflight-report.json` |
160+
| `--enable-snapshots` | Capture workspace snapshots at key workflow stages | `false` |
161+
| `--snapshot-dir` | Snapshot directory (defaults to `<work-dir>/snapshots`) | `null` |
162+
| `--rollback-to-snapshot` | Restore target workspace from a named snapshot and exit | `null` |
163+
| `--enable-diff-report` | Generate artifact diff report (files/props/APK changes) | `false` |
164+
| `--diff-report` | Output path for artifact diff report JSON | `build/diff-report.json` |
156165

157166
---
158167

src/app/cli.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,51 @@ def build_parser() -> argparse.ArgumentParser:
4141
help="Filesystem type for repacking. Default: from config or 'erofs'",
4242
)
4343
parser.add_argument("--eu-bundle", help="Path/URL to EU Localization Bundle zip")
44+
parser.add_argument(
45+
"--preflight-only",
46+
action="store_true",
47+
help="Run input preflight checks only, then exit",
48+
)
49+
parser.add_argument(
50+
"--skip-preflight",
51+
action="store_true",
52+
help="Skip preflight checks before porting workflow",
53+
)
54+
parser.add_argument(
55+
"--preflight-strict",
56+
action="store_true",
57+
help="Treat risk findings as failures in preflight checks",
58+
)
59+
parser.add_argument(
60+
"--preflight-report",
61+
default="build/preflight-report.json",
62+
help="Path to write preflight JSON report (default: build/preflight-report.json)",
63+
)
64+
parser.add_argument(
65+
"--enable-snapshots",
66+
action="store_true",
67+
help="Capture workflow snapshots at key stages",
68+
)
69+
parser.add_argument(
70+
"--snapshot-dir",
71+
default=None,
72+
help="Snapshot directory (default: <work-dir>/snapshots)",
73+
)
74+
parser.add_argument(
75+
"--rollback-to-snapshot",
76+
default=None,
77+
help="Restore target workspace from the named snapshot and exit",
78+
)
79+
parser.add_argument(
80+
"--enable-diff-report",
81+
action="store_true",
82+
help="Generate before/after artifact diff report",
83+
)
84+
parser.add_argument(
85+
"--diff-report",
86+
default="build/diff-report.json",
87+
help="Output path for artifact diff report (default: build/diff-report.json)",
88+
)
4489
parser.add_argument(
4590
"--phases",
4691
nargs="+",

0 commit comments

Comments
 (0)