diff options
Diffstat (limited to 'docs/manifest-format.txt')
-rw-r--r-- | docs/manifest-format.txt | 239 |
1 files changed, 239 insertions, 0 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt new file mode 100644 index 00000000..38868f10 --- /dev/null +++ b/docs/manifest-format.txt | |||
@@ -0,0 +1,239 @@ | |||
1 | repo Manifest Format | ||
2 | ==================== | ||
3 | |||
4 | A repo manifest describes the structure of a repo client; that is | ||
5 | the directories that are visible and where they should be obtained | ||
6 | from with git. | ||
7 | |||
8 | The basic structure of a manifest is a bare Git repository holding | ||
9 | a single 'default.xml' XML file in the top level directory. | ||
10 | |||
11 | Manifests are inherently version controlled, since they are kept | ||
12 | within a Git repository. Updates to manifests are automatically | ||
13 | obtained by clients during `repo sync`. | ||
14 | |||
15 | |||
16 | XML File Format | ||
17 | --------------- | ||
18 | |||
19 | A manifest XML file (e.g. 'default.xml') roughly conforms to the | ||
20 | following DTD: | ||
21 | |||
22 | <!DOCTYPE manifest [ | ||
23 | <!ELEMENT manifest (notice?, | ||
24 | remote*, | ||
25 | default?, | ||
26 | manifest-server?, | ||
27 | remove-project*, | ||
28 | project*, | ||
29 | repo-hooks?)> | ||
30 | |||
31 | <!ELEMENT notice (#PCDATA)> | ||
32 | |||
33 | <!ELEMENT remote (EMPTY)> | ||
34 | <!ATTLIST remote name ID #REQUIRED> | ||
35 | <!ATTLIST remote alias CDATA #IMPLIED> | ||
36 | <!ATTLIST remote fetch CDATA #REQUIRED> | ||
37 | <!ATTLIST remote review CDATA #IMPLIED> | ||
38 | |||
39 | <!ELEMENT default (EMPTY)> | ||
40 | <!ATTLIST default remote IDREF #IMPLIED> | ||
41 | <!ATTLIST default revision CDATA #IMPLIED> | ||
42 | <!ATTLIST default sync-j CDATA #IMPLIED> | ||
43 | <!ATTLIST default sync-c CDATA #IMPLIED> | ||
44 | |||
45 | <!ELEMENT manifest-server (EMPTY)> | ||
46 | <!ATTLIST url CDATA #REQUIRED> | ||
47 | |||
48 | <!ELEMENT project (annotation?)> | ||
49 | <!ATTLIST project name CDATA #REQUIRED> | ||
50 | <!ATTLIST project path CDATA #IMPLIED> | ||
51 | <!ATTLIST project remote IDREF #IMPLIED> | ||
52 | <!ATTLIST project revision CDATA #IMPLIED> | ||
53 | <!ATTLIST project groups CDATA #IMPLIED> | ||
54 | <!ATTLIST project sync-c CDATA #IMPLIED> | ||
55 | |||
56 | <!ELEMENT annotation (EMPTY)> | ||
57 | <!ATTLIST annotation name CDATA #REQUIRED> | ||
58 | <!ATTLIST annotation value CDATA #REQUIRED> | ||
59 | <!ATTLIST annotation keep CDATA "true"> | ||
60 | |||
61 | <!ELEMENT remove-project (EMPTY)> | ||
62 | <!ATTLIST remove-project name CDATA #REQUIRED> | ||
63 | |||
64 | <!ELEMENT repo-hooks (EMPTY)> | ||
65 | <!ATTLIST repo-hooks in-project CDATA #REQUIRED> | ||
66 | <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED> | ||
67 | |||
68 | <!ELEMENT include (EMPTY)> | ||
69 | <!ATTLIST include name CDATA #REQUIRED> | ||
70 | ]> | ||
71 | |||
72 | A description of the elements and their attributes follows. | ||
73 | |||
74 | |||
75 | Element manifest | ||
76 | ---------------- | ||
77 | |||
78 | The root element of the file. | ||
79 | |||
80 | |||
81 | Element remote | ||
82 | -------------- | ||
83 | |||
84 | One or more remote elements may be specified. Each remote element | ||
85 | specifies a Git URL shared by one or more projects and (optionally) | ||
86 | the Gerrit review server those projects upload changes through. | ||
87 | |||
88 | Attribute `name`: A short name unique to this manifest file. The | ||
89 | name specified here is used as the remote name in each project's | ||
90 | .git/config, and is therefore automatically available to commands | ||
91 | like `git fetch`, `git remote`, `git pull` and `git push`. | ||
92 | |||
93 | Attribute `alias`: The alias, if specified, is used to override | ||
94 | `name` to be set as the remote name in each project's .git/config. | ||
95 | Its value can be duplicated while attribute `name` has to be unique | ||
96 | in the manifest file. This helps each project to be able to have | ||
97 | same remote name which actually points to different remote url. | ||
98 | |||
99 | Attribute `fetch`: The Git URL prefix for all projects which use | ||
100 | this remote. Each project's name is appended to this prefix to | ||
101 | form the actual URL used to clone the project. | ||
102 | |||
103 | Attribute `review`: Hostname of the Gerrit server where reviews | ||
104 | are uploaded to by `repo upload`. This attribute is optional; | ||
105 | if not specified then `repo upload` will not function. | ||
106 | |||
107 | Element default | ||
108 | --------------- | ||
109 | |||
110 | At most one default element may be specified. Its remote and | ||
111 | revision attributes are used when a project element does not | ||
112 | specify its own remote or revision attribute. | ||
113 | |||
114 | Attribute `remote`: Name of a previously defined remote element. | ||
115 | Project elements lacking a remote attribute of their own will use | ||
116 | this remote. | ||
117 | |||
118 | Attribute `revision`: Name of a Git branch (e.g. `master` or | ||
119 | `refs/heads/master`). Project elements lacking their own | ||
120 | revision attribute will use this revision. | ||
121 | |||
122 | |||
123 | Element manifest-server | ||
124 | ----------------------- | ||
125 | |||
126 | At most one manifest-server may be specified. The url attribute | ||
127 | is used to specify the URL of a manifest server, which is an | ||
128 | XML RPC service that will return a manifest in which each project | ||
129 | is pegged to a known good revision for the current branch and | ||
130 | target. | ||
131 | |||
132 | The manifest server should implement: | ||
133 | |||
134 | GetApprovedManifest(branch, target) | ||
135 | |||
136 | The target to use is defined by environment variables TARGET_PRODUCT | ||
137 | and TARGET_BUILD_VARIANT. These variables are used to create a string | ||
138 | of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug. | ||
139 | If one of those variables or both are not present, the program will call | ||
140 | GetApprovedManifest without the target paramater and the manifest server | ||
141 | should choose a reasonable default target. | ||
142 | |||
143 | |||
144 | Element project | ||
145 | --------------- | ||
146 | |||
147 | One or more project elements may be specified. Each element | ||
148 | describes a single Git repository to be cloned into the repo | ||
149 | client workspace. | ||
150 | |||
151 | Attribute `name`: A unique name for this project. The project's | ||
152 | name is appended onto its remote's fetch URL to generate the actual | ||
153 | URL to configure the Git remote with. The URL gets formed as: | ||
154 | |||
155 | ${remote_fetch}/${project_name}.git | ||
156 | |||
157 | where ${remote_fetch} is the remote's fetch attribute and | ||
158 | ${project_name} is the project's name attribute. The suffix ".git" | ||
159 | is always appended as repo assumes the upstream is a forrest of | ||
160 | bare Git repositories. | ||
161 | |||
162 | The project name must match the name Gerrit knows, if Gerrit is | ||
163 | being used for code reviews. | ||
164 | |||
165 | Attribute `path`: An optional path relative to the top directory | ||
166 | of the repo client where the Git working directory for this project | ||
167 | should be placed. If not supplied the project name is used. | ||
168 | |||
169 | Attribute `remote`: Name of a previously defined remote element. | ||
170 | If not supplied the remote given by the default element is used. | ||
171 | |||
172 | Attribute `revision`: Name of the Git branch the manifest wants | ||
173 | to track for this project. Names can be relative to refs/heads | ||
174 | (e.g. just "master") or absolute (e.g. "refs/heads/master"). | ||
175 | Tags and/or explicit SHA-1s should work in theory, but have not | ||
176 | been extensively tested. If not supplied the revision given by | ||
177 | the default element is used. | ||
178 | |||
179 | Attribute `groups`: List of groups to which this project belongs, | ||
180 | whitespace or comma separated. All projects belong to the group | ||
181 | "default", and each project automatically belongs to a group of | ||
182 | it's name:`name` and path:`path`. E.g. for | ||
183 | <project name="monkeys" path="barrel-of"/>, that project | ||
184 | definition is implicitly in the following manifest groups: | ||
185 | default, name:monkeys, and path:barrel-of. | ||
186 | |||
187 | Element annotation | ||
188 | ------------------ | ||
189 | |||
190 | Zero or more annotation elements may be specified as children of a | ||
191 | project element. Each element describes a name-value pair that will be | ||
192 | exported into each project's environment during a 'forall' command, | ||
193 | prefixed with REPO__. In addition, there is an optional attribute | ||
194 | "keep" which accepts the case insensitive values "true" (default) or | ||
195 | "false". This attribute determines whether or not the annotation will | ||
196 | be kept when exported with the manifest subcommand. | ||
197 | |||
198 | Element remove-project | ||
199 | ---------------------- | ||
200 | |||
201 | Deletes the named project from the internal manifest table, possibly | ||
202 | allowing a subsequent project element in the same manifest file to | ||
203 | replace the project with a different source. | ||
204 | |||
205 | This element is mostly useful in the local_manifest.xml, where | ||
206 | the user can remove a project, and possibly replace it with their | ||
207 | own definition. | ||
208 | |||
209 | Element include | ||
210 | --------------- | ||
211 | |||
212 | This element provides the capability of including another manifest | ||
213 | file into the originating manifest. Normal rules apply for the | ||
214 | target manifest to include- it must be a usable manifest on it's own. | ||
215 | |||
216 | Attribute `name`; the manifest to include, specified relative to | ||
217 | the manifest repositories root. | ||
218 | |||
219 | |||
220 | Local Manifest | ||
221 | ============== | ||
222 | |||
223 | Additional remotes and projects may be added through a local | ||
224 | manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. | ||
225 | |||
226 | For example: | ||
227 | |||
228 | $ cat .repo/local_manifest.xml | ||
229 | <?xml version="1.0" encoding="UTF-8"?> | ||
230 | <manifest> | ||
231 | <project path="manifest" | ||
232 | name="tools/manifest" /> | ||
233 | <project path="platform-manifest" | ||
234 | name="platform/manifest" /> | ||
235 | </manifest> | ||
236 | |||
237 | Users may add projects to the local manifest prior to a `repo sync` | ||
238 | invocation, instructing repo to automatically download and manage | ||
239 | these extra projects. | ||