feat: 新增项目级构建 Hook - #530
Open
helantianshen wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #496
说明
为
mcpp build增加项目级构建生命周期 Hook。Hook 在项目的mcpp.toml中配置,适用于普通项目和 workspace 成员构建。配置
build_start:项目准备完成、正式构建开始前执行。build_finished:构建成功结束后执行。build_failed:构建失败后执行。timeout_seconds:每条命令的最长执行时间,默认 10 秒。enabled:是否启用本表中的 Hook,默认true。side_effect:Hook 失败是否使本次构建失败,默认true。执行行为
/bin/sh或cmd.exe),并沿用终端的标准输入、输出和错误。build_finished与build_failed互斥。side_effect = false时仅输出 warning 并保留原构建结果;默认配置下 Hook 失败会使构建返回失败。配套示例应用为 mcpp-hooks-audioplayer,对应包索引提交为 openxlings/xim-pkgindex#712。
其他修改
side_effect和非法配置。验证
tests/e2e/314_project_build_hooks.sh:通过。mcpp test:96 passed,0 failed。