├── README.md
└── default_local.xml
/README.md:
--------------------------------------------------------------------------------
1 | Local Manifests
2 | ===============
3 |
4 | Additional remotes and projects may be added through local manifest
5 | files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
6 |
7 | For example:
8 |
9 | $ ls .repo/local_manifests
10 | local_manifest.xml
11 | another_local_manifest.xml
12 |
13 | $ cat .repo/local_manifests/local_manifest.xml
14 |
15 |
16 |
18 |
20 |
21 |
22 | Users may add projects to the local manifest(s) prior to a `repo sync`
23 | invocation, instructing repo to automatically download and manage
24 | these extra projects.
25 |
26 | Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
27 | be loaded in alphabetical order.
28 |
29 | Additional remotes and projects may also be added through a local
30 | manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
31 | is deprecated in favor of using multiple manifest files as mentioned
32 | above.
33 |
34 | If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
35 | any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
36 |
37 |
38 | 使用案例
39 | ===============
40 |
41 | CyanogenMod(CM)适配了上百款机型,不同机型所涉及到的git库很可能是有差异的。以CM对清单文件的定制为例,通过新增local_manifest.xml,内容如下:
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | local_manifest.xml会与已有的default.xml融合成一个项目清单文件manifest.xml,实现了对一些git库的替换和新增。
61 | 可以通过以下命令导出当前的清单文件,最终snapshot.xml就是融合后的版本:
62 |
63 | $ repo manifest -o snapshot.xml -r
64 |
65 | 在编译之前,保存整个项目的清单,有助于问题的回溯。当项目的git库发生变更,需要回退到上一个版本进行验证的时候,只需要重新基于snapshot.xml初始化上一个版本即可:
66 |
67 | $ cp snapshot.xml .repo/manifests/
68 | $ repo init -m snapshot.xml # -m 参数表示自定义manifest
69 | $ repo sync -d # -d 参数表示从当前分支脱离,切换到manifest中定义的分支
70 |
71 |
--------------------------------------------------------------------------------
/default_local.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------