安装reop:
- curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo
- chmod a+x /usr/local/bin/repo
- pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
下载主干代码:
- cd ~/harmony
- repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
- repo sync -c
下载分支代码:
- cd ~/harmony
- repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/ OpenHarmony_release_v1.1.0 --no-repo-verify
- repo sync -c
其他版本源代码请参考Release-Notes。
编译源码:
- 获取docker镜像
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3 - 进入openharmony代码根目录执行
docker run -it -v $(pwd):/xxx/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3
注:/xxx/openharmony为源码存放目录。 - 通过如下命令编译不同平台
hb set #设置工作目录,输入(.)表示当前目录
在显示的页面中通过键盘的上下键选择需要编译的平台,回车确定选择。
hb build -f