The previous Code has constructed an android source code library locally. Let's take a look at how the source code library is constructed.
All of this is based on the construction tool named repo. Go back to the initial command $ curl http://android.git.kernel.org/repo> ~ /Bin/Repo
This command downloads a script named repo from the website. It is actually a Python code segment. It is a bit interesting to look at it carefully. It is actually a small part of the code of the entire build tool, and the function of this small part of the code is mainly to download its other code and initialize the Build Environment.
When running this tool, it first checks. repo directory, and then from the built-in script (or the address specified by the command line) git: // android.kernel.org/tools/repo.git to use git to clone a complete version library of the latest repo tool. check the latest code in the repo/repo directory. These codes are the code of other parts of the repo. Here, Main. py is the main entry code of the repo build tool.
In the previous construction process, in the call command $ repo init-u git: // android.git.kernel.org/platform/manifest.git, the repo first completes the update and initialization of itself, then, call the code added later to complete the init operation. In this operation, the repo downloads a version library of the entire source code repository list from the GIT: // android.git.kernel.org/platform/manifest.git address, and checkout out the latest list, that is. repo/manifests/default. XML file. This file is an XML file that describes the remote version library address for getting code, the address of each project involved in it, and so on. Below are some of them:
- <Manifest branch = "master">
- <Remote name = "Korg"
- Fetch = "Git: // android.git.kernel.org /"
- Review = "review.source.android.com"/>
- <Project Path = "Bionic" name = "platform/bionic"/>
- <Project Path = "external/clearsilver" name = "platform/external/clearsilver">
- <Import>
- <Remap strip = "clearsilver-% version %/"/>
- <Mirror url = "http://android.git.kernel.org/pub/clearsilver-%version%.tar.gz"/>
- <Snapshot version = "0.10.5" Check = "ec5fff5d71_ddd29a619cf81ae1_687fde94c8"/>
- </Import>
- </Project>
- ......
- </Manifest>
A small part of the clip is intercepted to illustrate the problem.
The fetch attribute of the remote node describes the basic address of the remote version library, followed by a series of Project nodes. Each project node has a path and name attribute. path is the local storage address of the project, and bionic is stored locally. under/repo/projects/bionic, and the name attribute is the path in the remote version library, you can get the version library address of the project by combining with the remote fetch address, for example, the bionic version library is in git: // android.git.kernel.org/platform/bionic
The quota package. During synchronization, the repo will download it, decompress it, add it to the version library of the project, and mark it with a tag.
Through this inventory file, Repo can be used to update and synchronize the entire source code library at any time, which is also a unique advantage of Git-based version control.