哪个做问卷网站佣金高,做网站需要提供些什么页面,宁波企业网站制作推荐,杭州电商网站建设公司OpenHarmony源码下载(windows, ubuntu)
现在的 OpenHarmony 4.0 源码已经有了#xff0c;在 https://gitee.com/openharmony 地址中#xff0c;描述了源码获取的方式。下来先写下 windows 的获取方式#xff0c;再写 ubuntu 的获取方式。
获取源码前#xff0c;还需要的准…OpenHarmony源码下载(windows, ubuntu)
现在的 OpenHarmony 4.0 源码已经有了在 https://gitee.com/openharmony 地址中描述了源码获取的方式。下来先写下 windows 的获取方式再写 ubuntu 的获取方式。
获取源码前还需要的准备工作是在 gitee 上添加 ssh 公钥来保证 PC 可以正确发起请求并下载。具体的生成 ssh 公钥方式在 gitee 官网上按照步骤操作就可以了。
Windows
gitee 描述的下载方式是基于 ubuntu 或者说是 Linux 的下载方式。在 windows 平台下的下载方式没有做出介绍。
我自己尝试了 windows 下的下载方式与下载 android 源码下载方式雷同。
整个 openharmony 4.0 代码在27.6GB大小。
前提
在下载源码前安装 windows 下 git 工具还有 python (用于执行下载程序) 。
在**合适**的位置创建放置源码的目录进入目录下载 openharmony 的仓库。
git clone https://gitee.com/openharmony/manifest.git在 clone 结束后可以在目中看到 manifest 目录。 在 git-bash 工具中进入到 manifest 目录查看当前的工作分支默认是 master 。
将源码分支切换到要下载的分支。这里下载 openharmony 4.0 代码。
$ git branch
* OpenHarmony-4.0-Releasemaster下载
在切换分支后可以在 manifest 的目录下打开查看 default.xml 文件。
?xml version1.0 encodingUTF-8?
manifestremote fetch. nameorigin reviewhttps://openharmony.gitee.com/openharmony//default remoteorigin revisionOpenHarmony-4.0-Release sync-j4 /include nameohos/ohos.xml /include namechipsets/all.xml /
/manifest内容中包含了下载两个目录分别是
ohos openharmony 系统的软件代码。chipsets 是根据芯片适配的底层代码。
要下载的是 ohos 目录下文件列举的源码结构。
创建 download 的 py 文件
在 nanifest 统计目录下创建 download.py 文件文件内容如下。
import xml.dom.minidom
import os
from subprocess import call# 1. 修改为源码要保存的路径
rootdir D:/OHOSP/OHOS# 2. 设置 git.exe 安装的路径
git D:/DevTools/Git/bin/git.exe# 3. 修改为 manifest 中 default.xml 文件内容中 ohos.xml 路径
dom xml.dom.minidom.parse(D:/OHOSP/manifest/ohos/ohos.xml)
root dom.documentElement# 4. 拼接下载地址
prefix git clone https://gitee.com/openharmony/
suffix .gitif not os.path.exists(rootdir):os.mkdir(rootdir)for node in root.getElementsByTagName(project):os.chdir(rootdir)d node.getAttribute(path)last d.rfind(/)if last ! -1:d rootdir / d[:last]if not os.path.exists(d):os.makedirs(d)os.chdir(d)cmd prefix node.getAttribute(name) suffixprint(cmd)call(cmd)打开python的IDLE工具
打开 python 的 IDLE 工具。 在 File Open 打开上面创建的 download 文件。 运行这段程序等待源码下载结束。
Ubuntu
Ubuntu 下下载的方式使用的工具是 repo因此需要安装工具 gitgit lfs 和 repo。
还需要 ubuntu 上安装了 python如果安装了 python3大概率还需要安装 python-is-python3。
安装 git
$ sudo apt get install git安装 repo
$ mkdir ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo ~/bin/repo
$ chmod ax ~/bin/repo执行完上面指令repo 也就安装上了。
若果 ubuntu 系统是 22.04 或更高版本可以直接使用 apt 包管理器安装。
$ sudo apt install repo安装 git lfs若只安装了 git没有安装 git lfs 工具在下载过程中会出错提示未安装 git lfs 。 添加包下载 apt/deb 库。 $ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash执行 apt/deb 安装指令。 $ sudo apt-get install git-lfs验证是否安装成功。 $ git lfs --version下载 4.0 代码
使用 repo 工具下载 openharmony 4.0 代码
$ repo init -u gitgitee.com:openharmony/manifest.git -b OpenHarmony-4.0-Release --no-repo-verify
$ repo sync -c # 下载版本库
$ repo forall -c git lfs pull # 没有check进度等待下载完成就可以了