OSDN Git Service

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