oh-xts-build-run

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenHarmony XTS 编译和运行

OpenHarmony XTS Compilation and Execution

此 Skill 将 XTS 编译 (
/oh-xts-build
) 和运行 (
/oh-xts-run
) 组合成一个完整的工作流。
This Skill combines XTS compilation (
/oh-xts-build
) and execution (
/oh-xts-run
) into a complete workflow.

工作流程

Workflow

  1. 执行编译:运行
    /oh-xts-build
    • 更新 List.test.ets 注册测试用例
    • 使用 hvigorw 编译生成 HAP 文件
    • 检查主 HAP 和测试 HAP 是否生成成功
  2. 判断结果
    • 如果编译失败 → 停止流程,返回编译错误
    • 如果编译成功 → 继续执行运行
  3. 执行运行:运行
    /oh-xts-run [参数]
    • 自动解析包名(从 pack.info 或 module.json5)
    • 运行测试并解析结果统计
  4. 汇总结果:统一展示编译和运行的完整输出
  1. Execute Compilation: Run
    /oh-xts-build
    • Update List.test.ets to register test cases
    • Use hvigorw to compile and generate HAP files
    • Check whether the main HAP and test HAP are generated successfully
  2. Judge Results:
    • If compilation fails → Stop the process and return compilation errors
    • If compilation succeeds → Proceed to execution
  3. Execute Test Run: Run
    /oh-xts-run [parameters]
    • Automatically parse the package name (from pack.info or module.json5)
    • Run the test and parse result statistics
  4. Summarize Results: Unified display of the complete output of compilation and execution

参数

Parameters

  • --package=<package-name>
    :指定包名(可选)
  • --api=<api-name>
    :指定测试类名(可选)
  • --package=<package-name>
    : Specify the package name (optional)
  • --api=<api-name>
    : Specify the test class name (optional)

实现位置

Implementation Locations

  • 编译命令:
    packages/cli/src/ui/commands/ohXtsBuildCommand.ts
  • 运行命令:
    packages/cli/src/ui/commands/ohXtsRunCommand.ts
  • 核心模块:
    packages/cli/src/modules/xts/build-runner.ts
  • Compilation command:
    packages/cli/src/ui/commands/ohXtsBuildCommand.ts
  • Execution command:
    packages/cli/src/ui/commands/ohXtsRunCommand.ts
  • Core module:
    packages/cli/src/modules/xts/build-runner.ts