Android 存储库清单存储库如何工作?

编程入门 行业动态 更新时间:2024-10-22 08:43:29
本文介绍了Android 存储库清单存储库如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Android 源 是一个 大型 git 存储库层次结构.它们由名为 repo 的自定义脚本管理.Repo 使用 manifest.xml 确定要管理哪些 git 存储库.Android 的manifest.xml 托管在git 存储库以及所有其他 git 存储库.

Android 中如何管理此存储库?具体来说,不同的分支以及每个分支中托管的不同文件是如何组织的?

解决方案

首先,repo init 创建.repo目录,克隆git仓库android.googlesource/tools/repo 到 .repo/repo,以及使用-u 选项到 .repo/manifests.git 的裸仓库.之后,它会创建.repo/manifests 目录,通过创建从.repo/manifests/.git 到.repo 的符号链接将其转换为git 存储库/manifests.git.然后它检出 -b 中指定的分支,并创建一个符号链接 .repo/manifest.xml 指向指定的文件 (-m> 选项)在 .repo/manifests 中,默认为 .repo/manifests/default.xml.

大致如下:

回购初始化 -u $URL -b $BRANCH -m $MANIFEST--------------------mkdir .repo;光盘.repogit 克隆 android.googlesource/tools/repogit clone --bare $URL manifests.gitmkdir -p manifests/.git;cd 清单/.git对于我在 ../../manifests.git/*;做 ln -s $ı .;完毕光盘..git checkout $BRANCH -- .光盘..ln -s manifests/$MANIFEST manifest.xml

你可以用 repo --trace init ...

追踪到底发生了什么

然后,repo sync 为 manifest.xml 和 local_manifest.xml 中的每个项目克隆 git 存储库到 .repo/projects,创建工作.git 的目录具有指向相应裸存储库的符号链接,检查清单中指定的分支,并更新 .repo/project.list.项目已经存在的情况略有不同,本质上是执行git pull --rebase.

The Android source is a large hierarchy of git repositories. They are managed by a custom script called repo. Repo determines which git repositories to manage using a manifest.xml. The manifest.xml of Android is hosted in a git repository along with all the other git repositories.

How is this repository managed in Android? Specifically how are the different branches and the different files hosted in each branch organised?

解决方案

First, repo init creates the .repo directory, clones the git repository android.googlesource/tools/repo to .repo/repo, and the git repository specified with the -u option to a bare repository at .repo/manifests.git. After that, it creates the .repo/manifests directory, converts it into a git repository through creating symbolic links from .repo/manifests/.git to .repo/manifests.git. It then checks out the branch specified in -b, and creates a symbolic link .repo/manifest.xml pointing to the specified file (-m option) in .repo/manifests, by default .repo/manifests/default.xml.

Roughly as follows:

repo init -u $URL -b $BRANCH -m $MANIFEST -------------------- mkdir .repo; cd .repo git clone android.googlesource/tools/repo git clone --bare $URL manifests.git mkdir -p manifests/.git; cd manifests/.git for i in ../../manifests.git/*; do ln -s $ı .; done cd .. git checkout $BRANCH -- . cd .. ln -s manifests/$MANIFEST manifest.xml

You can trace what really happens with repo --trace init ...

Then, repo sync clones git repositories to .repo/projects for each project in manifest.xml and local_manifest.xml, creates working directories with .git having symlinks to the corresponding bare repository, checks out the branch specified in the manifest, and updates .repo/project.list. The case where the projects are already there is slightly different, essentially performing a git pull --rebase.

更多推荐

Android 存储库清单存储库如何工作?

本文发布于:2023-11-28 16:32:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643143.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:清单   工作   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!