sdk-repository-03.xsd revision 4c3b19c11bed6972f2ebf758af4025607b41b11b
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 * Copyright (C) 2010 The Android Open Source Project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16-->
17<xsd:schema
18    targetNamespace="http://schemas.android.com/sdk/android/repository/3"
19    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
20    xmlns:sdk="http://schemas.android.com/sdk/android/repository/3"
21    elementFormDefault="qualified"
22    attributeFormDefault="unqualified"
23    version="1">
24
25    <!-- The repository contains a collection of downloadable items known as
26         "packages". Each package has a type and various attributes and contains
27         a list of file "archives" that can be downloaded for specific OSes.
28
29         An Android SDK repository is a web site that contains a "repository.xml"
30         file that conforms to this XML Schema.
31
32         History:
33         - v1 is used by the SDK Updater in Tools r3 and r4.
34
35         - v2 is used by the SDK Updater in Tools r5:
36            - It introduces a new <sample> repository type. Previously samples
37              were included in the <platform> packages. Instead this package is used
38              and and the samples are installed in $SDK/samples.
39            - All repository types have a new <obsolete> node. It works as a marker
40              to indicate the package is obsolete and should not be selected by default.
41              The UI also hides these out by default.
42
43         - v3 is used by the SDK Updater in Tools r8:
44            - It introduces a new <platform-tool> repository type. Previously platform-specific
45              tools were included in the <platform> packages. Instead this package is used
46              and platform-specific tools are installed in $SDK/platform-tools
47            - There's a new element <min-platform-tools-rev> in <tool>. The tool package now
48              requires that at least some minimal version of <platform-tool> be installed.
49            - It removes the <addon> repository type, which is now in its own XML Schema.
50    -->
51
52    <xsd:element name="sdk-repository" type="sdk:repositoryType" />
53
54    <xsd:complexType name="repositoryType">
55        <xsd:annotation>
56            <xsd:documentation>
57                The repository contains a collection of downloadable packages.
58            </xsd:documentation>
59        </xsd:annotation>
60        <xsd:choice minOccurs="0" maxOccurs="unbounded">
61            <xsd:element name="platform"        type="sdk:platformType"     />
62            <xsd:element name="tool"            type="sdk:toolType"         />
63            <xsd:element name="platform-tool"   type="sdk:platformToolType" />
64            <xsd:element name="doc"             type="sdk:docType"          />
65            <xsd:element name="sample"          type="sdk:sampleType"       />
66            <xsd:element name="extra"           type="sdk:extraType"        />
67            <xsd:element name="license"         type="sdk:licenseType"      />
68        </xsd:choice>
69    </xsd:complexType>
70
71    <!-- The definition of an SDK platform package. -->
72
73    <xsd:complexType name="platformType">
74        <xsd:annotation>
75            <xsd:documentation>An SDK platform package.</xsd:documentation>
76        </xsd:annotation>
77        <xsd:all>
78            <!-- The Android platform version. It is string such as "1.0". -->
79            <xsd:element name="version"   type="xsd:normalizedString" />
80            <!-- The Android API Level for the platform. An int > 0. -->
81            <xsd:element name="api-level" type="xsd:positiveInteger"  />
82            <!-- The optional codename for this platform, if it's a preview. -->
83            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
84
85            <!-- The revision, an int > 0, incremented each time a new
86                 package is generated. -->
87            <xsd:element name="revision"     type="xsd:positiveInteger" />
88            <!-- The optional license of this package. If present, users will have
89                 to agree to it before downloading. -->
90            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
91            <!-- The optional description of this package. -->
92            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
93            <!-- The optional description URL of this package -->
94            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
95            <!-- The optional release note for this package. -->
96            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
97            <!-- The optional release note URL of this package -->
98            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
99            <!-- A list of file archives for this package. -->
100            <xsd:element name="archives"     type="sdk:archivesType" />
101            <!-- The minimal revision of tools required by this package.
102                 Optional. If present, must be an int > 0. -->
103            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
104
105            <!-- An optional element indicating the package is obsolete.
106                 The string content is however currently not defined and ignored. -->
107            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
108        </xsd:all>
109    </xsd:complexType>
110
111
112    <!-- The definition of an SDK tool package. -->
113
114    <xsd:complexType name="toolType" >
115        <xsd:annotation>
116            <xsd:documentation>An SDK tool package.</xsd:documentation>
117        </xsd:annotation>
118        <xsd:all>
119            <!-- The revision, an int > 0, incremented each time a new
120                 package is generated. -->
121            <xsd:element name="revision"     type="xsd:positiveInteger" />
122            <!-- The optional license of this package. If present, users will have
123                 to agree to it before downloading. -->
124            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
125            <!-- The optional description of this package. -->
126            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
127            <!-- The optional description URL of this package -->
128            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
129            <!-- The optional release note for this package. -->
130            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
131            <!-- The optional release note URL of this package -->
132            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
133            <!-- A list of file archives for this package. -->
134            <xsd:element name="archives"     type="sdk:archivesType" />
135            <!-- An optional element indicating the package is obsolete.
136                 The string content is however currently not defined and ignored. -->
137            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
138
139            <!-- The minimal revision of platform-tools required by this package.
140                 Mandatory. Must be an int > 0. -->
141            <xsd:element name="min-platform-tools-rev" type="xsd:positiveInteger" />
142        </xsd:all>
143    </xsd:complexType>
144
145
146    <!-- The definition of an SDK platform-tool package. -->
147
148    <xsd:complexType name="platformToolType" >
149        <xsd:annotation>
150            <xsd:documentation>An SDK platform-tool package.</xsd:documentation>
151        </xsd:annotation>
152        <xsd:all>
153            <!-- The revision, an int > 0, incremented each time a new
154                 package is generated. -->
155            <xsd:element name="revision"     type="xsd:positiveInteger" />
156            <!-- The optional license of this package. If present, users will have
157                 to agree to it before downloading. -->
158            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
159            <!-- The optional description of this package. -->
160            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
161            <!-- The optional description URL of this package -->
162            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
163            <!-- The optional release note for this package. -->
164            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
165            <!-- The optional release note URL of this package -->
166            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
167            <!-- A list of file archives for this package. -->
168            <xsd:element name="archives"     type="sdk:archivesType" />
169
170            <!-- An optional element indicating the package is obsolete.
171                 The string content is however currently not defined and ignored. -->
172            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
173        </xsd:all>
174    </xsd:complexType>
175
176
177    <!-- The definition of an SDK doc package. -->
178
179    <xsd:complexType name="docType" >
180        <xsd:annotation>
181            <xsd:documentation>An SDK doc package.</xsd:documentation>
182        </xsd:annotation>
183        <xsd:all>
184            <!-- The Android API Level for the documentation. An int > 0. -->
185            <xsd:element name="api-level" type="xsd:positiveInteger"  />
186            <!-- The optional codename for this doc, if it's a preview. -->
187            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
188
189            <!-- The revision, an int > 0, incremented each time a new
190                 package is generated. -->
191            <xsd:element name="revision"     type="xsd:positiveInteger" />
192            <!-- The optional license of this package. If present, users will have
193                 to agree to it before downloading. -->
194            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
195            <!-- The optional description of this package. -->
196            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
197            <!-- The optional description URL of this package -->
198            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
199            <!-- The optional release note for this package. -->
200            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
201            <!-- The optional release note URL of this package -->
202            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
203            <!-- A list of file archives for this package. -->
204            <xsd:element name="archives"     type="sdk:archivesType" />
205
206            <!-- An optional element indicating the package is obsolete.
207                 The string content is however currently not defined and ignored. -->
208            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
209        </xsd:all>
210    </xsd:complexType>
211
212
213    <!-- The definition of an SDK sample package. -->
214
215    <xsd:complexType name="sampleType" >
216        <xsd:annotation>
217            <xsd:documentation>An SDK sample package.</xsd:documentation>
218        </xsd:annotation>
219        <xsd:all>
220            <!-- The Android API Level for the documentation. An int > 0. -->
221            <xsd:element name="api-level" type="xsd:positiveInteger"  />
222            <!-- The optional codename for this doc, if it's a preview. -->
223            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
224
225            <!-- The revision, an int > 0, incremented each time a new
226                 package is generated. -->
227            <xsd:element name="revision"     type="xsd:positiveInteger" />
228            <!-- The optional license of this package. If present, users will have
229                 to agree to it before downloading. -->
230            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
231            <!-- The optional description of this package. -->
232            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
233            <!-- The optional description URL of this package -->
234            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
235            <!-- The optional release note for this package. -->
236            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
237            <!-- The optional release note URL of this package -->
238            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
239            <!-- A list of file archives for this package. -->
240            <xsd:element name="archives"     type="sdk:archivesType" />
241            <!-- The minimal revision of tools required by this package.
242                 Optional. If present, must be an int > 0. -->
243            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
244
245            <!-- An optional element indicating the package is obsolete.
246                 The string content is however currently not defined and ignored. -->
247            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
248        </xsd:all>
249    </xsd:complexType>
250
251
252    <!-- The definition of an SDK extra package. This kind of package is for
253         "free" content. Such packages are installed in SDK/vendor/path.
254    -->
255
256    <xsd:complexType name="extraType" >
257        <xsd:annotation>
258            <xsd:documentation>
259                An SDK extra package. This kind of package is for "free" content.
260                Such packages are installed in SDK/vendor/path.
261            </xsd:documentation>
262        </xsd:annotation>
263        <xsd:all>
264
265            <!-- The install path top folder name.
266                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
267                 and "tools" are reserved and cannot be used.
268            -->
269            <xsd:element name="vendor" type="sdk:segmentType" />
270
271            <!-- The install path sub-folder name. -->
272            <xsd:element name="path" type="sdk:segmentType" />
273
274            <!-- The revision, an int > 0, incremented each time a new
275                 package is generated. -->
276            <xsd:element name="revision"     type="xsd:positiveInteger" />
277            <!-- The optional license of this package. If present, users will have
278                 to agree to it before downloading. -->
279            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
280            <!-- The optional description of this package. -->
281            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
282            <!-- The optional description URL of this package -->
283            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
284            <!-- The optional release note for this package. -->
285            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
286            <!-- The optional release note URL of this package -->
287            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
288            <!-- A list of file archives for this package. -->
289            <xsd:element name="archives"     type="sdk:archivesType" />
290            <!-- The minimal revision of tools required by this package.
291                 Optional. If present, must be an int > 0. -->
292            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
293            <!-- The minimal API level required by this package.
294                 Optional. If present, must be an int > 0. -->
295            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
296
297            <!-- An optional element indicating the package is obsolete.
298                 The string content is however currently not defined and ignored. -->
299            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
300        </xsd:all>
301    </xsd:complexType>
302
303
304    <!-- The definition of a path segment used by the extra element. -->
305
306    <xsd:simpleType name="segmentType">
307        <xsd:annotation>
308            <xsd:documentation>
309                One path segment for the install path of an extra element.
310                It must be a single-segment path.
311            </xsd:documentation>
312        </xsd:annotation>
313        <xsd:restriction base="xsd:token">
314            <xsd:pattern value="[a-zA-Z0-9_]+"/>
315        </xsd:restriction>
316    </xsd:simpleType>
317
318
319    <!-- The definition of a license to be referenced by the uses-license element. -->
320
321    <xsd:complexType name="licenseType">
322        <xsd:annotation>
323            <xsd:documentation>
324                A license definition. Such a license must be used later as a reference
325                using a uses-license element in one of the package elements.
326            </xsd:documentation>
327        </xsd:annotation>
328        <xsd:simpleContent>
329            <xsd:extension base="xsd:string">
330                <xsd:attribute name="id"   type="xsd:ID" />
331                <xsd:attribute name="type" type="xsd:token" fixed="text" />
332            </xsd:extension>
333        </xsd:simpleContent>
334    </xsd:complexType>
335
336
337    <!-- Type describing the license used by a package.
338         The license MUST be defined using a license node and referenced
339         using the ref attribute of the license element inside a package.
340     -->
341
342    <xsd:complexType name="usesLicenseType">
343        <xsd:annotation>
344            <xsd:documentation>
345                Describes the license used by a package. The license MUST be defined
346                using a license node and referenced using the ref attribute of the
347                license element inside a package.
348            </xsd:documentation>
349        </xsd:annotation>
350        <xsd:attribute name="ref" type="xsd:IDREF" />
351    </xsd:complexType>
352
353
354    <!-- A collection of files that can be downloaded for a given architecture.
355         The <archives> node is mandatory in the repository elements and the
356         collection must have at least one <archive> declared.
357         Each archive is a zip file that will be unzipped in a location that depends
358         on its package type.
359     -->
360
361    <xsd:complexType name="archivesType">
362        <xsd:annotation>
363            <xsd:documentation>
364                A collection of files that can be downloaded for a given architecture.
365                The &lt;archives&gt; node is mandatory in the repository packages and the
366                collection must have at least one &lt;archive&gt; declared.
367                Each archive is a zip file that will be unzipped in a location that depends
368                on its package type.
369            </xsd:documentation>
370        </xsd:annotation>
371        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
372            <!-- One archive file -->
373            <xsd:element name="archive">
374                <xsd:complexType>
375                    <!-- Properties of the archive file -->
376                    <xsd:all>
377                        <!-- The size in bytes of the archive to download. -->
378                        <xsd:element name="size"     type="xsd:positiveInteger" />
379                        <!-- The checksum of the archive file. -->
380                        <xsd:element name="checksum" type="sdk:checksumType" />
381                        <!-- The URL is an absolute URL if it starts with http://, https://
382                             or ftp://. Otherwise it is relative to the parent directory that
383                             contains this repository.xml -->
384                        <xsd:element name="url"      type="xsd:token" />
385                    </xsd:all>
386
387                    <!-- Attributes that identify the OS and architecture -->
388                    <xsd:attribute name="os" use="required">
389                        <xsd:simpleType>
390                            <xsd:restriction base="xsd:token">
391                                <xsd:enumeration value="any" />
392                                <xsd:enumeration value="linux" />
393                                <xsd:enumeration value="macosx" />
394                                <xsd:enumeration value="windows" />
395                            </xsd:restriction>
396                        </xsd:simpleType>
397                    </xsd:attribute>
398                    <xsd:attribute name="arch" use="optional">
399                        <xsd:simpleType>
400                            <xsd:restriction base="xsd:token">
401                                <xsd:enumeration value="any" />
402                                <xsd:enumeration value="ppc" />
403                                <xsd:enumeration value="x86" />
404                                <xsd:enumeration value="x86_64" />
405                            </xsd:restriction>
406                        </xsd:simpleType>
407                    </xsd:attribute>
408                </xsd:complexType>
409            </xsd:element>
410        </xsd:sequence>
411    </xsd:complexType>
412
413
414    <!-- The definition of a file checksum -->
415
416    <xsd:simpleType name="sha1Number">
417        <xsd:annotation>
418            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
419        </xsd:annotation>
420        <xsd:restriction base="xsd:string">
421            <xsd:pattern value="([0-9a-fA-F]){40}"/>
422        </xsd:restriction>
423    </xsd:simpleType>
424
425    <xsd:complexType name="checksumType">
426        <xsd:annotation>
427            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
428        </xsd:annotation>
429        <xsd:simpleContent>
430            <xsd:extension base="sdk:sha1Number">
431                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
432            </xsd:extension>
433        </xsd:simpleContent>
434    </xsd:complexType>
435
436</xsd:schema>
437