summaryrefslogtreecommitdiff
path: root/repository/sdk-repository-3.xsd
blob: 75d8541fa6fd571134650132b27b6a20803d826f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<xsd:schema
    targetNamespace="http://schemas.android.com/sdk/android/repository/3"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:sdk="http://schemas.android.com/sdk/android/repository/3"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="1">

    <!-- The repository contains a collection of downloadable items known as
         "packages". Each package has a type and various attributes and contains
         a list of file "archives" that can be downloaded for specific OSes.

         An Android SDK repository is a web site that contains a "repository.xml"
         file that conforms to this XML Schema.

         History:
         - v1 is used by the SDK Updater in Tools r3 and r4.

         - v2 is used by the SDK Updater in Tools r5:
            - It introduces a new <sample> repository type. Previously samples
              were included in the <platform> packages. Instead this package is used
              and and the samples are installed in $SDK/samples.
            - All repository types have a new <obsolete> node. It works as a marker
              to indicate the package is obsolete and should not be selected by default.
              The UI also hides these out by default.

         - v3 is used by the SDK Updater in Tools r8:
            - It introduces a new <platform-tool> repository type. Previously platform-specific
              tools were included in the <platform> packages. Instead this package is used
              and platform-specific tools are installed in $SDK/platform-tools
            - There's a new element <min-platform-tools-rev> in <tool>. The tool package now
              requires that at least some minimal version of <platform-tool> be installed.
            - It removes the <addon> repository type, which is now in its own XML Schema.
    -->

    <xsd:element name="sdk-repository" type="sdk:repositoryType" />

    <xsd:complexType name="repositoryType">
        <xsd:annotation>
            <xsd:documentation>
                The repository contains a collection of downloadable packages.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name="platform"        type="sdk:platformType"     />
            <xsd:element name="tool"            type="sdk:toolType"         />
            <xsd:element name="platform-tool"   type="sdk:platformToolType" />
            <xsd:element name="doc"             type="sdk:docType"          />
            <xsd:element name="sample"          type="sdk:sampleType"       />
            <xsd:element name="extra"           type="sdk:extraType"        />
            <xsd:element name="license"         type="sdk:licenseType"      />
        </xsd:choice>
    </xsd:complexType>

    <!-- The definition of an SDK platform package. -->

    <xsd:complexType name="platformType">
        <xsd:annotation>
            <xsd:documentation>An SDK platform package.</xsd:documentation>
        </xsd:annotation>
        <xsd:all>
            <!-- The Android platform version. It is string such as "1.0". -->
            <xsd:element name="version"   type="xsd:normalizedString" />
            <!-- The Android API Level for the platform. An int > 0. -->
            <xsd:element name="api-level" type="xsd:positiveInteger"  />
            <!-- The optional codename for this platform, if it's a preview. -->
            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />

            <!-- The revision, an int > 0, incremented each time a new
                 package is generated. -->
            <xsd:element name="revision"     type="xsd:positiveInteger" />
            <!-- The optional license of this package. If present, users will have
                 to agree to it before downloading. -->
            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
            <!-- The optional description of this package. -->
            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
            <!-- The optional description URL of this package -->
            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
            <!-- The optional release note for this package. -->
            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
            <!-- The optional release note URL of this package -->
            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
            <!-- A list of file archives for this package. -->
            <xsd:element name="archives"     type="sdk:archivesType" />
            <!-- The minimal revision of tools required by this package.
                 Optional. If present, must be an int > 0. -->
            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />

            <!-- An optional element indicating the package is obsolete.
                 The string content is however currently not defined and ignored. -->
            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>


    <!-- The definition of an SDK tool package. -->

    <xsd:complexType name="toolType" >
        <xsd:annotation>
            <xsd:documentation>An SDK tool package.</xsd:documentation>
        </xsd:annotation>
        <xsd:all>
            <!-- The revision, an int > 0, incremented each time a new
                 package is generated. -->
            <xsd:element name="revision"     type="xsd:positiveInteger" />
            <!-- The optional license of this package. If present, users will have
                 to agree to it before downloading. -->
            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
            <!-- The optional description of this package. -->
            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
            <!-- The optional description URL of this package -->
            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
            <!-- The optional release note for this package. -->
            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
            <!-- The optional release note URL of this package -->
            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
            <!-- A list of file archives for this package. -->
            <xsd:element name="archives"     type="sdk:archivesType" />
            <!-- An optional element indicating the package is obsolete.
                 The string content is however currently not defined and ignored. -->
            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />

            <!-- The minimal revision of platform-tools required by this package.
                 Mandatory. Must be an int > 0. -->
            <xsd:element name="min-platform-tools-rev" type="xsd:positiveInteger" />
        </xsd:all>
    </xsd:complexType>


    <!-- The definition of an SDK platform-tool package. -->

    <xsd:complexType name="platformToolType" >
        <xsd:annotation>
            <xsd:documentation>An SDK platform-tool package.</xsd:documentation>
        </xsd:annotation>
        <xsd:all>
            <!-- The revision, an int > 0, incremented each time a new
                 package is generated. -->
            <xsd:element name="revision"     type="xsd:positiveInteger" />
            <!-- The optional license of this package. If present, users will have
                 to agree to it before downloading. -->
            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
            <!-- The optional description of this package. -->
            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
            <!-- The optional description URL of this package -->
            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
            <!-- The optional release note for this package. -->
            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
            <!-- The optional release note URL of this package -->
            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
            <!-- A list of file archives for this package. -->
            <xsd:element name="archives"     type="sdk:archivesType" />

            <!-- An optional element indicating the package is obsolete.
                 The string content is however currently not defined and ignored. -->
            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>


    <!-- The definition of an SDK doc package. -->

    <xsd:complexType name="docType" >
        <xsd:annotation>
            <xsd:documentation>An SDK doc package.</xsd:documentation>
        </xsd:annotation>
        <xsd:all>
            <!-- The Android API Level for the documentation. An int > 0. -->
            <xsd:element name="api-level" type="xsd:positiveInteger"  />
            <!-- The optional codename for this doc, if it's a preview. -->
            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />

            <!-- The revision, an int > 0, incremented each time a new
                 package is generated. -->
            <xsd:element name="revision"     type="xsd:positiveInteger" />
            <!-- The optional license of this package. If present, users will have
                 to agree to it before downloading. -->
            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
            <!-- The optional description of this package. -->
            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
            <!-- The optional description URL of this package -->
            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
            <!-- The optional release note for this package. -->
            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
            <!-- The optional release note URL of this package -->
            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
            <!-- A list of file archives for this package. -->
            <xsd:element name="archives"     type="sdk:archivesType" />

            <!-- An optional element indicating the package is obsolete.
                 The string content is however currently not defined and ignored. -->
            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>


    <!-- The definition of an SDK sample package. -->

    <xsd:complexType name="sampleType" >
        <xsd:annotation>
            <xsd:documentation>An SDK sample package.</xsd:documentation>
        </xsd:annotation>
        <xsd:all>
            <!-- The Android API Level for the documentation. An int > 0. -->
            <xsd:element name="api-level" type="xsd:positiveInteger"  />
            <!-- The optional codename for this doc, if it's a preview. -->
            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />

            <!-- The revision, an int > 0, incremented each time a new
                 package is generated. -->
            <xsd:element name="revision"     type="xsd:positiveInteger" />
            <!-- The optional license of this package. If present, users will have
                 to agree to it before downloading. -->
            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
            <!-- The optional description of this package. -->
            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
            <!-- The optional description URL of this package -->
            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
            <!-- The optional release note for this package. -->
            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
            <!-- The optional release note URL of this package -->
            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
            <!-- A list of file archives for this package. -->
            <xsd:element name="archives"     type="sdk:archivesType" />
            <!-- The minimal revision of tools required by this package.
                 Optional. If present, must be an int > 0. -->
            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />

            <!-- An optional element indicating the package is obsolete.
                 The string content is however currently not defined and ignored. -->
            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>


    <!-- The definition of an SDK extra package. This kind of package is for
         "free" content. Such packages are installed in SDK/vendor/path.
    -->

    <xsd:complexType name="extraType" >
        <xsd:annotation>
            <xsd:documentation>
                An SDK extra package. This kind of package is for "free" content.
                Such packages are installed in SDK/vendor/path.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:all>

            <!-- The install path top folder name.
                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
                 and "tools" are reserved and cannot be used.
            -->
            <xsd:element name="vendor" type="sdk:segmentType" />

            <!-- The install path sub-folder name. -->
            <xsd:element name="path" type="sdk:segmentType" />

            <!-- The revision, an int > 0, incremented each time a new
                 package is generated. -->
            <xsd:element name="revision"     type="xsd:positiveInteger" />
            <!-- The optional license of this package. If present, users will have
                 to agree to it before downloading. -->
            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
            <!-- The optional description of this package. -->
            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
            <!-- The optional description URL of this package -->
            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
            <!-- The optional release note for this package. -->
            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
            <!-- The optional release note URL of this package -->
            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
            <!-- A list of file archives for this package. -->
            <xsd:element name="archives"     type="sdk:archivesType" />
            <!-- The minimal revision of tools required by this package.
                 Optional. If present, must be an int > 0. -->
            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
            <!-- The minimal API level required by this package.
                 Optional. If present, must be an int > 0. -->
            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />

            <!-- An optional element indicating the package is obsolete.
                 The string content is however currently not defined and ignored. -->
            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>


    <!-- The definition of a path segment used by the extra element. -->

    <xsd:simpleType name="segmentType">
        <xsd:annotation>
            <xsd:documentation>
                One path segment for the install path of an extra element.
                It must be a single-segment path.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:token">
            <xsd:pattern value="[a-zA-Z0-9_]+"/>
        </xsd:restriction>
    </xsd:simpleType>


    <!-- The definition of a license to be referenced by the uses-license element. -->

    <xsd:complexType name="licenseType">
        <xsd:annotation>
            <xsd:documentation>
                A license definition. Such a license must be used later as a reference
                using a uses-license element in one of the package elements.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleContent>
            <xsd:extension base="xsd:string">
                <xsd:attribute name="id"   type="xsd:ID" />
                <xsd:attribute name="type" type="xsd:token" fixed="text" />
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>


    <!-- Type describing the license used by a package.
         The license MUST be defined using a license node and referenced
         using the ref attribute of the license element inside a package.
     -->

    <xsd:complexType name="usesLicenseType">
        <xsd:annotation>
            <xsd:documentation>
                Describes the license used by a package. The license MUST be defined
                using a license node and referenced using the ref attribute of the
                license element inside a package.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="ref" type="xsd:IDREF" />
    </xsd:complexType>


    <!-- A collection of files that can be downloaded for a given architecture.
         The <archives> node is mandatory in the repository elements and the
         collection must have at least one <archive> declared.
         Each archive is a zip file that will be unzipped in a location that depends
         on its package type.
     -->

    <xsd:complexType name="archivesType">
        <xsd:annotation>
            <xsd:documentation>
                A collection of files that can be downloaded for a given architecture.
                The &lt;archives&gt; node is mandatory in the repository packages and the
                collection must have at least one &lt;archive&gt; declared.
                Each archive is a zip file that will be unzipped in a location that depends
                on its package type.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
            <!-- One archive file -->
            <xsd:element name="archive">
                <xsd:complexType>
                    <!-- Properties of the archive file -->
                    <xsd:all>
                        <!-- The size in bytes of the archive to download. -->
                        <xsd:element name="size"     type="xsd:positiveInteger" />
                        <!-- The checksum of the archive file. -->
                        <xsd:element name="checksum" type="sdk:checksumType" />
                        <!-- The URL is an absolute URL if it starts with http://, https://
                             or ftp://. Otherwise it is relative to the parent directory that
                             contains this repository.xml -->
                        <xsd:element name="url"      type="xsd:token" />
                    </xsd:all>

                    <!-- Attributes that identify the OS and architecture -->
                    <xsd:attribute name="os" use="required">
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:token">
                                <xsd:enumeration value="any" />
                                <xsd:enumeration value="linux" />
                                <xsd:enumeration value="macosx" />
                                <xsd:enumeration value="windows" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:attribute>
                    <xsd:attribute name="arch" use="optional">
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:token">
                                <xsd:enumeration value="any" />
                                <xsd:enumeration value="ppc" />
                                <xsd:enumeration value="x86" />
                                <xsd:enumeration value="x86_64" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:attribute>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>


    <!-- The definition of a file checksum -->

    <xsd:simpleType name="sha1Number">
        <xsd:annotation>
            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="([0-9a-fA-F]){40}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="checksumType">
        <xsd:annotation>
            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
        </xsd:annotation>
        <xsd:simpleContent>
            <xsd:extension base="sdk:sha1Number">
                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>

</xsd:schema>