编译构建 CodeArts Build-配置代码下载:代码化构建(manifest多仓下载)
代码化构建(manifest多仓下载)
在安卓、鸿蒙等场景下,一次构建需要同时集成数百甚至上千个代码仓,多个代码仓的集成下载效率至关重要。
编译构建集成Repo下载工具,用户只需进行简单配置即可实现多个代码仓的联动集成。当前支持仅Repo代码仓。
参考以下代码示例,修改在创建代码化构建使用的YAML文件中的PRE_BUILD部分代码信息。
1 2 3 4 5 6 7 8 91011121314 |
version: 2.0 # 必须是2.0steps: PRE_BUILD: - manifest_checkout: name: "manifest" inputs: manifest_url: "https://example.example.example.example.example.com/xx/manifest.git" manifest_branch: "master" manifest_file: "default.xml" path: "dir/dir02" repo_url: "https://example.example.example.example.example.com/xx/git-repo.git" repo_branch: "master" username: "someone" password: "${PASSWD}" |
参数 |
类型 |
说明 |
---|---|---|
name |
string |
可选参数。填写步骤名称。默认值为manifest_checkout。 |
manifest_url |
string |
填写manifest仓地址,包含xml文件的仓库。 |
manifest_branch |
string |
可选参数。填写manifest分支或revision。默认值为“HEAD”。 |
manifest_file |
string |
可选参数。manifest文件路径。默认值为“default.xml”。 |
path |
string |
可选参数。自定义manifest所有子仓下载路径,为工作目录的相对路径 路径不能以“/”开头,不能包含“.”。默认为工作目录。 |
repo_url |
string |
可选参数。填写repo仓库地址。默认值为“https://gerrit.googlesource.com/git-repo”。 |
repo_branch |
string |
可选参数。填写repo仓库分支。默认值为“stable”。 |
username |
string |
可选参数。填写下载仓库时使用的用户名,当下载非公开仓库时需填写。 |
password |
string |
可选参数。填写下载仓库时使用的https密码,下载非公开仓库时需填写。 |

- manifest_file中定义的多个仓库,必须为同一种代码源。
- manifest_url与manifest_file必须为同一种代码源;如果为非公开仓库,username&password应该有下载权限。
- repo_url对应的repo仓库,需要有下载权限(仓库开源,或者仓库私有但配置了账号密码)。
- 以上非必填的参数,如果配置的值为空,则使用默认值。
- 建议在使用非公开仓库时,用户名密码通过构建的私密参数进行配置,详情参考配置构建任务参数。
- 该功能目前仅支持北京四区域使用,其余区域后续上线。