Afwk hb build

From openharmonyinsight/openharmony-skills · View interactive version

Afwk hb build is an AI agent skill from the GitHub repository openharmonyinsight/openharmony-skills. 智能编译 ability_runtime 组件,通过检测修改的文件自动确定编译目标。支持多目标一起编译、自动重试判断、智能错误分析。触发关键词:"编译"、"构建"、"compile"、"build"、"make"、"make file"。

How to use this skill

Skill file

hb-build - Ability Runtime 智能编译工具

自动检测修改的文件并智能编译 ability_runtime 组件,支持多目标编译和自动重试。

快速开始

自动检测并编译(推荐)

python3 scripts/helper.py

编译特定服务

# SO 名称(推荐)
python3 scripts/helper.py --target libupms      # UriPermissionManager
python3 scripts/helper.py --target abilityms    # AbilityManagerService
python3 scripts/helper.py --target appms        # AppManagerService

# 完整路径
python3 scripts/helper.py --target \
  //foundation/ability/ability_runtime/services/uripermmgr:libupms

编译多个服务

python3 scripts/helper.py --target libupms abilityms appms

整仓编译

python3 scripts/helper.py --target full

工作流程

1. 切换到项目根目录(包含 build.py)
2. 检测修改文件 → git status --short
3. 过滤无关文件 → 排除 .claude/, build/, out/, *.md 等
4. 推断编译目标 → 统计每个服务的修改文件数
5. 智能决策 →
   • 目标数量 > 5 → 使用整仓编译
   • 目标数量 > 1 → 一起编译多个目标
   • 目标数量 = 1 → 编译单个目标
6. 执行编译 → hb build ability_runtime -i --build-target <TARGET>
7. 处理结果 → 成功或失败(支持智能重试)

参数概览

| 参数 | 说明 | 默认值 |

|------|------|--------|

| --target | 编译目标(支持多个) | auto |

| --type | 编译类型(-i 功能代码 / -t 测试套) | -i |

| --fast | 启用快速编译(--fast-rebuild) | false |

| --max-retries | 最大重试次数 | 3 |

| --auto-retry | 启用自动重试模式 | false |

支持的编译目标

自动忽略的文件

以下文件和目录不会被检测为需要编译的修改:

使用要求

必须满足的条件:

已知的限制:

详细文档

核心脚本

外部资源

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.