OSDN Git Service

Merge change 6506
[android-x86/development.git] / tools / sdkmanager / libs / sdklib / src / com / android / sdklib / repository / sdk-repository.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Copyright (C) 2009 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/1"
19     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
20     xmlns:sdk="http://schemas.android.com/sdk/android/repository/1"
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
33     <xsd:element name="sdk-repository">
34         <xsd:annotation>
35             <xsd:documentation>
36                 The repository contains collections of downloadable packages.
37             </xsd:documentation>
38         </xsd:annotation>
39
40         <xsd:complexType>
41             <xsd:choice minOccurs="0" maxOccurs="unbounded">
42
43                 <!-- The definition of an SDK platform package. -->
44
45                 <xsd:element name="platform">
46                     <xsd:annotation>
47                         <xsd:documentation>An SDK platform package.</xsd:documentation>
48                     </xsd:annotation>
49                     <xsd:complexType>
50                         <xsd:all>
51                             <!-- The Android platform version. It is string such as "1.0". -->
52                             <xsd:element name="version"   type="xsd:normalizedString" />
53                             <!-- The Android API Level for the platform. An int > 0. -->
54                             <xsd:element name="api-level" type="xsd:positiveInteger"  />
55                             <!-- The optional codename for this platform, if it's a preview. -->
56                             <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
57
58                             <!-- The revision, an int > 0, incremented each time a new
59                                  package is generated. -->
60                             <xsd:element name="revision"     type="xsd:positiveInteger" />
61                             <!-- The optional license of this package. If present, users will have
62                                  to agree to it before downloading. -->
63                             <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
64                             <!-- The optional description of this package. -->
65                             <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
66                             <!-- The optional description URL of this package -->
67                             <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
68                             <!-- A list of file archives for this package. -->
69                             <xsd:element name="archives"     type="sdk:archivesType" />
70                         </xsd:all>
71                     </xsd:complexType>
72                 </xsd:element>
73
74
75                 <!-- The definition of an SDK Add-on package. -->
76
77                 <xsd:element name="add-on">
78                     <xsd:annotation>
79                         <xsd:documentation>An SDK add-on package.</xsd:documentation>
80                     </xsd:annotation>
81                     <xsd:complexType>
82                         <xsd:all>
83                             <!-- The name of the add-on. -->
84                             <xsd:element name="name"      type="xsd:normalizedString" />
85                             <!-- The vendor of the add-on. -->
86                             <xsd:element name="vendor"    type="xsd:normalizedString" />
87                             <!-- The Android API Level for the add-on. An int > 0. -->
88                             <xsd:element name="api-level" type="xsd:positiveInteger"  />
89                             <!-- The optional codename for this add-on, if it's a preview. -->
90                             <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
91
92                             <!-- The revision, an int > 0, incremented each time a new
93                                  package is generated. -->
94                             <xsd:element name="revision"     type="xsd:positiveInteger" />
95                             <!-- The optional license of this package. If present, users will have
96                                  to agree to it before downloading. -->
97                             <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
98                             <!-- The optional description of this package. -->
99                             <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
100                             <!-- The optional description URL of this package -->
101                             <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
102                             <!-- A list of file archives for this package. -->
103                             <xsd:element name="archives"     type="sdk:archivesType" />
104
105                             <!-- An add-on can declare 0 or more libraries. -->
106
107                             <xsd:element name="libs">
108                                 <xsd:complexType>
109                                     <xsd:sequence minOccurs="0" maxOccurs="unbounded">
110                                         <xsd:element name="lib">
111                                             <xsd:complexType>
112                                                 <xsd:all>
113                                                     <!-- The name of the library. -->
114                                                     <xsd:element name="name" type="xsd:normalizedString" />
115                                                     <!-- The optional description of this add-on library. -->
116                                                     <xsd:element name="description" type="xsd:string" minOccurs="0" />
117                                                 </xsd:all>
118                                             </xsd:complexType>
119                                         </xsd:element>
120                                     </xsd:sequence>
121                                 </xsd:complexType>
122                             </xsd:element>
123                         </xsd:all>
124                     </xsd:complexType>
125                 </xsd:element>
126
127
128                 <!-- The definition of an SDK tool package. -->
129
130                 <xsd:element name="tool">
131                     <xsd:annotation>
132                         <xsd:documentation>An SDK tool package.</xsd:documentation>
133                     </xsd:annotation>
134                     <xsd:complexType>
135                         <xsd:all>
136                             <!-- The revision, an int > 0, incremented each time a new
137                                  package is generated. -->
138                             <xsd:element name="revision"     type="xsd:positiveInteger" />
139                             <!-- The optional license of this package. If present, users will have
140                                  to agree to it before downloading. -->
141                             <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
142                             <!-- The optional description of this package. -->
143                             <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
144                             <!-- The optional description URL of this package -->
145                             <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
146                             <!-- A list of file archives for this package. -->
147                             <xsd:element name="archives"     type="sdk:archivesType" />
148                         </xsd:all>
149                     </xsd:complexType>
150                 </xsd:element>
151
152
153                 <!-- The definition of an SDK doc package. -->
154
155                 <xsd:element name="doc">
156                     <xsd:annotation>
157                         <xsd:documentation>An SDK doc package.</xsd:documentation>
158                     </xsd:annotation>
159                     <xsd:complexType>
160                         <xsd:all>
161                             <!-- The Android API Level for the documentation. An int > 0. -->
162                             <xsd:element name="api-level" type="xsd:positiveInteger"  />
163                             <!-- The optional codename for this doc, if it's a preview. -->
164                             <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
165
166                             <!-- The revision, an int > 0, incremented each time a new
167                                  package is generated. -->
168                             <xsd:element name="revision"     type="xsd:positiveInteger" />
169                             <!-- The optional license of this package. If present, users will have
170                                  to agree to it before downloading. -->
171                             <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
172                             <!-- The optional description of this package. -->
173                             <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
174                             <!-- The optional description URL of this package -->
175                             <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
176                             <!-- A list of file archives for this package. -->
177                             <xsd:element name="archives"     type="sdk:archivesType" />
178                         </xsd:all>
179                     </xsd:complexType>
180                 </xsd:element>
181
182
183                 <!-- The definition of an SDK extra package. This kind of package is for
184                      "free" content and specifies in which fixed root directory it must be
185                      installed.
186                 -->
187
188                 <xsd:element name="extra">
189                     <xsd:annotation>
190                         <xsd:documentation>
191                             An SDK extra package. This kind of package is for "free"
192                             content and specifies in which fixed root directory it must be
193                             installed.
194                             The paths "add-ons", "platforms", "tools" and "docs" are
195                             reserved and cannot be used.
196                         </xsd:documentation>
197                     </xsd:annotation>
198                     <xsd:complexType>
199                         <xsd:all>
200                             <!-- The install folder name. It must be a single-segment path.
201                                  The paths "add-ons", "platforms", "tools" and "docs" are
202                                  reserved and cannot be used.
203                             -->
204                             <xsd:element name="path">
205                                 <xsd:simpleType>
206                                     <xsd:restriction base="xsd:token">
207                                         <xsd:pattern value="[^/\\]+"/>
208                                     </xsd:restriction>
209                                 </xsd:simpleType>
210                             </xsd:element>
211
212                             <!-- The revision, an int > 0, incremented each time a new
213                                  package is generated. -->
214                             <xsd:element name="revision"     type="xsd:positiveInteger" />
215                             <!-- The optional license of this package. If present, users will have
216                                  to agree to it before downloading. -->
217                             <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
218                             <!-- The optional description of this package. -->
219                             <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
220                             <!-- The optional description URL of this package -->
221                             <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
222                             <!-- A list of file archives for this package. -->
223                             <xsd:element name="archives"     type="sdk:archivesType" />
224                         </xsd:all>
225                     </xsd:complexType>
226                 </xsd:element>
227
228
229
230                 <!-- The definition of a license to be referenced by the uses-license element. -->
231
232                 <xsd:element name="license">
233                     <xsd:annotation>
234                         <xsd:documentation>
235                             A license definition. Such a license must be used later as a reference
236                             using a uses-license element in one of the package elements.
237                         </xsd:documentation>
238                     </xsd:annotation>
239                     <xsd:complexType>
240                         <xsd:simpleContent>
241                             <xsd:extension base="xsd:string">
242                                 <xsd:attribute name="id"   type="xsd:ID" />
243                                 <xsd:attribute name="type" type="xsd:token" fixed="text" />
244                             </xsd:extension>
245                         </xsd:simpleContent>
246                     </xsd:complexType>
247                 </xsd:element>
248             </xsd:choice>
249         </xsd:complexType>
250     </xsd:element>
251
252
253     <!-- Type describing the license used by a package.
254          The license MUST be defined using a license node and referenced
255          using the ref attribute of the license element inside a package.
256      -->
257
258     <xsd:complexType name="licenseType">
259         <xsd:annotation>
260             <xsd:documentation>
261                 Describes the license used by a package. The license MUST be defined
262                 using a license node and referenced using the ref attribute of the
263                 license element inside a package.
264             </xsd:documentation>
265         </xsd:annotation>
266         <xsd:attribute name="ref" type="xsd:IDREF" />
267     </xsd:complexType>
268
269
270     <!-- A collection of files that can be downloaded for a given architecture.
271          The <archives> node is mandatory in the repository elements and the
272          collection must have at least one <archive> declared.
273          Each archive is a zip file that will be unzipped in a location that depends
274          on its package type.
275      -->
276
277     <xsd:complexType name="archivesType">
278         <xsd:annotation>
279             <xsd:documentation>
280                 A collection of files that can be downloaded for a given architecture.
281                 The &lt;archives&gt; node is mandatory in the repository packages and the
282                 collection must have at least one &lt;archive&gt; declared.
283                 Each archive is a zip file that will be unzipped in a location that depends
284                 on its package type.
285             </xsd:documentation>
286         </xsd:annotation>
287         <xsd:sequence minOccurs="1" maxOccurs="unbounded">
288             <!-- One archive file -->
289             <xsd:element name="archive">
290                 <xsd:complexType>
291                     <!-- Properties of the archive file -->
292                     <xsd:all>
293                         <!-- The size in bytes of the archive to download. -->
294                         <xsd:element name="size"     type="xsd:positiveInteger" />
295                         <!-- The checksum of the archive file. -->
296                         <xsd:element name="checksum" type="sdk:checksumType" />
297                         <!-- The URL is an absolute URL if it starts with http://, https://
298                              or ftp://. Otherwise it is relative to the parent directory that
299                              contains this repository.xml -->
300                         <xsd:element name="url"      type="xsd:token" />
301                     </xsd:all>
302
303                     <!-- Attributes that identify the OS and architecture -->
304                     <xsd:attribute name="os" use="required">
305                         <xsd:simpleType>
306                             <xsd:restriction base="xsd:token">
307                                 <xsd:enumeration value="any" />
308                                 <xsd:enumeration value="linux" />
309                                 <xsd:enumeration value="macosx" />
310                                 <xsd:enumeration value="windows" />
311                             </xsd:restriction>
312                         </xsd:simpleType>
313                     </xsd:attribute>
314                     <xsd:attribute name="arch" use="optional">
315                         <xsd:simpleType>
316                             <xsd:restriction base="xsd:token">
317                                 <xsd:enumeration value="any" />
318                                 <xsd:enumeration value="ppc" />
319                                 <xsd:enumeration value="x86" />
320                                 <xsd:enumeration value="x86_64" />
321                             </xsd:restriction>
322                         </xsd:simpleType>
323                     </xsd:attribute>
324                 </xsd:complexType>
325             </xsd:element>
326         </xsd:sequence>
327     </xsd:complexType>
328
329
330     <!-- The definition of a file checksum -->
331
332     <xsd:simpleType name="sha1Number">
333         <xsd:annotation>
334             <xsd:documentation>A SHA1 checksum.</xsd:documentation>
335         </xsd:annotation>
336         <xsd:restriction base="xsd:string">
337             <xsd:pattern value="([0-9a-fA-F]){40}"/>
338         </xsd:restriction>
339     </xsd:simpleType>
340
341     <xsd:complexType name="checksumType">
342         <xsd:annotation>
343             <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
344         </xsd:annotation>
345         <xsd:simpleContent>
346             <xsd:extension base="sdk:sha1Number">
347                 <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
348             </xsd:extension>
349         </xsd:simpleContent>
350     </xsd:complexType>
351
352
353 </xsd:schema>