xref: /aosp_15_r20/prebuilts/devtools/repository/sdk-sys-img-03.xsd (revision 4bfccde5c7e9ea06f821db40ef0af54f6695c320)
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 * Copyright (C) 2012 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/sys-img/3"
19    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
20    xmlns:sdk="http://schemas.android.com/sdk/android/sys-img/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 Addon repository is a web site that contains an "addon.xml"
30         file that conforms to this XML Schema.
31
32         History:
33         - v1 is used by the SDK Updater in Tools r20.0. It is split out of the
34           main SDK Repository XML Schema and can only contain <system-image> packages.
35
36         - v2 is used by the SDK Manager in Tools r22.6.
37           It introduces a sub-tag for the <system-image> repository type.
38
39         - v3 is used by the SDK Manager in Tools r22.6.4:
40            - It introduces a <list-display> string for all package types.
41            - it changes <archive os=... arch=...> to sub-elements: <host-os>, <host-bits>,
42              <jvm-bits> and <min-jvm-version>.
43            - Support for new ABIs arm64-v8a, x86_64 and mips64.
44            - Support for new <addon><vendor-id/name></addon> element.
45    -->
46
47    <xsd:element name="sdk-sys-img" type="sdk:repositoryType" />
48
49    <xsd:complexType name="repositoryType">
50        <xsd:annotation>
51            <xsd:documentation>
52                The repository contains a collection of downloadable system images.
53            </xsd:documentation>
54        </xsd:annotation>
55        <xsd:choice minOccurs="0" maxOccurs="unbounded">
56            <xsd:element name="system-image"    type="sdk:systemImageType"  />
57            <xsd:element name="license"         type="sdk:licenseType"      />
58        </xsd:choice>
59    </xsd:complexType>
60
61
62    <!-- The definition of a system image used by a platform. -->
63
64    <xsd:complexType name="systemImageType" >
65        <xsd:annotation>
66            <xsd:documentation>
67                System Image for a platform.
68            </xsd:documentation>
69        </xsd:annotation>
70        <xsd:all>
71            <!-- api-level+codename identifies the platform to which this system image belongs. -->
72
73            <!-- The Android API Level for the platform. An int > 0. -->
74            <xsd:element name="api-level" type="xsd:positiveInteger"  />
75            <!-- The optional codename for this platform, if it's a preview. -->
76            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
77
78            <!-- The revision, an int > 0, incremented each time a new
79                 package is generated. -->
80            <xsd:element name="revision"  type="xsd:positiveInteger" />
81
82            <!-- The tag of the system emulated by this image. -->
83            <xsd:element name="tag-id"      type="sdk:idType" />
84            <!-- The displayed tag of the system emulated by this image. Optional. -->
85            <xsd:element name="tag-display" type="xsd:normalizedString" minOccurs="0" />
86
87            <!-- Indicates a system-image is tied to an add-on and which one.
88                 Mandatory for add-on system-images.
89                 Must not be present for platform system-images. -->
90            <xsd:element name="add-on"      type="sdk:addonType" minOccurs="0" />
91
92            <!-- The vendor id of the system-image when it is associated with an add-on.
93                 Must not be present for system-image associated with a platform. -->
94            <xsd:element name="vendor-id"       type="sdk:idType" minOccurs="0" />
95            <!-- The displayed vendor name of the system-image's add-on. -->
96            <xsd:element name="vendor-display"  type="xsd:normalizedString" minOccurs="0" />
97
98            <!-- The optional display list item. When missing, it is auto-computed. -->
99            <xsd:element name="list-display"   type="xsd:normalizedString" minOccurs="0" />
100
101            <!-- The ABI of the system emulated by this image. -->
102            <xsd:element name="abi"       type="sdk:abiType" />
103
104            <!-- The optional license of this package. If present, users will have
105                 to agree to it before downloading. -->
106            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
107            <!-- The optional description of this package. -->
108            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
109            <!-- The optional description URL of this package -->
110            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
111            <!-- The optional release note for this package. -->
112            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
113            <!-- The optional release note URL of this package -->
114            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
115
116            <!-- A list of file archives for this package. -->
117            <xsd:element name="archives"  type="sdk:archivesType" />
118
119            <!-- An optional element indicating the package is obsolete.
120                 The string content is however currently not defined and ignored. -->
121            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
122        </xsd:all>
123    </xsd:complexType>
124
125
126    <!-- The definition of a system image used by a platform. -->
127
128    <xsd:complexType name="addonType" >
129        <xsd:annotation>
130            <xsd:documentation>
131                Indicates a system-image is tied to an add-on and which one
132                (the combo tag-id + vendor-id uniquely identifies the add-on.)
133                Mandatory for add-on system-images.
134                Must not be present for platform system-images.
135            </xsd:documentation>
136        </xsd:annotation>
137        <xsd:all>
138            <!-- The vendor id of the add-on. -->
139            <xsd:element name="vendor-id"       type="sdk:idType" />
140            <!-- The displayed vendor name of the add-on. -->
141            <xsd:element name="vendor-display"  type="xsd:normalizedString" minOccurs="0" />
142        </xsd:all>
143    </xsd:complexType>
144
145
146    <xsd:simpleType name="idType">
147        <xsd:annotation>
148            <xsd:documentation>
149                An tag string for a system image can only be simple alphanumeric string.
150            </xsd:documentation>
151        </xsd:annotation>
152        <xsd:restriction base="xsd:token">
153            <xsd:pattern value="[a-zA-Z0-9_-]+"/>
154        </xsd:restriction>
155    </xsd:simpleType>
156
157
158    <!-- The definition of the ABI supported by a platform's system image. -->
159
160    <xsd:simpleType name="abiType">
161        <xsd:annotation>
162            <xsd:documentation>The ABI of a platform's system image.</xsd:documentation>
163        </xsd:annotation>
164        <xsd:restriction base="xsd:token">
165            <xsd:enumeration value="armeabi"     />
166            <xsd:enumeration value="armeabi-v7a" />
167            <xsd:enumeration value="arm64-v8a"   />
168            <xsd:enumeration value="x86"         />
169            <xsd:enumeration value="x86_64"      />
170            <xsd:enumeration value="mips"        />
171            <xsd:enumeration value="mips64"      />
172        </xsd:restriction>
173    </xsd:simpleType>
174
175
176    <!-- The definition of a license to be referenced by the uses-license element. -->
177
178    <xsd:complexType name="licenseType">
179        <xsd:annotation>
180            <xsd:documentation>
181                A license definition. Such a license must be used later as a reference
182                using a uses-license element in one of the package elements.
183            </xsd:documentation>
184        </xsd:annotation>
185        <xsd:simpleContent>
186            <xsd:extension base="xsd:string">
187                <xsd:attribute name="id"   type="xsd:ID" />
188                <xsd:attribute name="type" type="xsd:token" fixed="text" />
189            </xsd:extension>
190        </xsd:simpleContent>
191    </xsd:complexType>
192
193
194    <!-- Type describing the license used by a package.
195         The license MUST be defined using a license node and referenced
196         using the ref attribute of the license element inside a package.
197     -->
198
199    <xsd:complexType name="usesLicenseType">
200        <xsd:annotation>
201            <xsd:documentation>
202                Describes the license used by a package. The license MUST be defined
203                using a license node and referenced using the ref attribute of the
204                license element inside a package.
205            </xsd:documentation>
206        </xsd:annotation>
207        <xsd:attribute name="ref" type="xsd:IDREF" />
208    </xsd:complexType>
209
210
211    <!-- A collection of files that can be downloaded for a given architecture.
212         The <archives> node is mandatory in the repository elements and the
213         collection must have at least one <archive> declared.
214         Each archive is a zip file that will be unzipped in a location that depends
215         on its package type.
216     -->
217
218    <xsd:complexType name="archivesType">
219        <xsd:annotation>
220            <xsd:documentation>
221                A collection of files that can be downloaded for a given architecture.
222                The &lt;archives&gt; node is mandatory in the repository packages and the
223                collection must have at least one &lt;archive&gt; declared.
224                Each archive is a zip file that will be unzipped in a location that depends
225                on its package type.
226            </xsd:documentation>
227        </xsd:annotation>
228        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
229            <!-- One archive file -->
230            <xsd:element name="archive">
231                <xsd:complexType>
232                    <!-- Properties of the archive file -->
233                    <xsd:all>
234                        <!-- The size in bytes of the archive to download. -->
235                        <xsd:element name="size"     type="xsd:positiveInteger" />
236                        <!-- The checksum of the archive file. -->
237                        <xsd:element name="checksum" type="sdk:checksumType" />
238                        <!-- The URL is an absolute URL if it starts with http://, https://
239                             or ftp://. Otherwise it is relative to the parent directory that
240                             contains this repository.xml -->
241                        <xsd:element name="url"      type="xsd:token" />
242
243                        <xsd:element name="host-os"         type="sdk:osType"         minOccurs="0" />
244                        <xsd:element name="host-bits"       type="sdk:bitSizeType"    minOccurs="0" />
245                        <xsd:element name="jvm-bits"        type="sdk:bitSizeType"    minOccurs="0" />
246                        <xsd:element name="min-jvm-version" type="sdk:jvmVersionType" minOccurs="0" />
247                    </xsd:all>
248                </xsd:complexType>
249            </xsd:element>
250        </xsd:sequence>
251    </xsd:complexType>
252
253
254    <!-- The definition of archive filters -->
255
256    <xsd:simpleType name="bitSizeType">
257        <xsd:annotation>
258            <xsd:documentation>A CPU bit size filter.</xsd:documentation>
259        </xsd:annotation>
260        <xsd:restriction base="xsd:token">
261            <xsd:enumeration value="32" />
262            <xsd:enumeration value="64" />
263        </xsd:restriction>
264    </xsd:simpleType>
265
266    <xsd:simpleType name="osType">
267        <xsd:annotation>
268            <xsd:documentation>A host OS filter.</xsd:documentation>
269        </xsd:annotation>
270        <xsd:restriction base="xsd:token">
271            <xsd:enumeration value="linux" />
272            <xsd:enumeration value="macosx" />
273            <xsd:enumeration value="windows" />
274        </xsd:restriction>
275    </xsd:simpleType>
276
277    <xsd:simpleType name="jvmVersionType">
278        <xsd:annotation>
279            <xsd:documentation>A JVM version number, e.g. "1" or "1.6" or "1.14.15".</xsd:documentation>
280        </xsd:annotation>
281        <xsd:restriction base="xsd:string">
282            <xsd:pattern value="([1-9](\.[1-9]{1,2}){0,2})"/>
283        </xsd:restriction>
284    </xsd:simpleType>
285
286
287    <!-- The definition of a file checksum -->
288
289    <xsd:simpleType name="sha1Number">
290        <xsd:annotation>
291            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
292        </xsd:annotation>
293        <xsd:restriction base="xsd:string">
294            <xsd:pattern value="([0-9a-fA-F]){40}"/>
295        </xsd:restriction>
296    </xsd:simpleType>
297
298    <xsd:complexType name="checksumType">
299        <xsd:annotation>
300            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
301        </xsd:annotation>
302        <xsd:simpleContent>
303            <xsd:extension base="sdk:sha1Number">
304                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
305            </xsd:extension>
306        </xsd:simpleContent>
307    </xsd:complexType>
308
309</xsd:schema>
310