xref: /aosp_15_r20/prebuilts/devtools/repository/sdk-sys-img-01.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/1"
19    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
20    xmlns:sdk="http://schemas.android.com/sdk/android/sys-img/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 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
37    <xsd:element name="sdk-sys-img" type="sdk:repositoryType" />
38
39    <xsd:complexType name="repositoryType">
40        <xsd:annotation>
41            <xsd:documentation>
42                The repository contains a collection of downloadable system images.
43            </xsd:documentation>
44        </xsd:annotation>
45        <xsd:choice minOccurs="0" maxOccurs="unbounded">
46            <xsd:element name="system-image"    type="sdk:systemImageType"  />
47            <xsd:element name="license"         type="sdk:licenseType"      />
48        </xsd:choice>
49    </xsd:complexType>
50
51
52    <!-- The definition of a system image used by a platform. -->
53
54    <xsd:complexType name="systemImageType" >
55        <xsd:annotation>
56            <xsd:documentation>
57                System Image for a platform.
58            </xsd:documentation>
59        </xsd:annotation>
60        <xsd:all>
61            <!-- api-level+codename identifies the platform to which this system image belongs. -->
62
63            <!-- The Android API Level for the platform. An int > 0. -->
64            <xsd:element name="api-level" type="xsd:positiveInteger"  />
65            <!-- The optional codename for this platform, if it's a preview. -->
66            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
67
68            <!-- The revision, an int > 0, incremented each time a new
69                 package is generated. -->
70            <xsd:element name="revision"  type="xsd:positiveInteger" />
71
72            <!-- The ABI of the system emulated by this image. -->
73            <xsd:element name="abi"       type="sdk:abiType" />
74
75            <!-- The optional license of this package. If present, users will have
76                 to agree to it before downloading. -->
77            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
78            <!-- The optional description of this package. -->
79            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
80            <!-- The optional description URL of this package -->
81            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
82            <!-- The optional release note for this package. -->
83            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
84            <!-- The optional release note URL of this package -->
85            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
86
87            <!-- A list of file archives for this package. -->
88            <xsd:element name="archives"  type="sdk:archivesType" />
89
90            <!-- An optional element indicating the package is obsolete.
91                 The string content is however currently not defined and ignored. -->
92            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
93        </xsd:all>
94    </xsd:complexType>
95
96
97    <!-- The definition of the ABI supported by a platform's system image. -->
98
99    <xsd:simpleType name="abiType">
100        <xsd:annotation>
101            <xsd:documentation>The ABI of a platform's system image.</xsd:documentation>
102        </xsd:annotation>
103        <xsd:restriction base="xsd:token">
104            <xsd:enumeration value="armeabi"     />
105            <xsd:enumeration value="armeabi-v7a" />
106            <xsd:enumeration value="x86"         />
107            <xsd:enumeration value="mips"        />
108        </xsd:restriction>
109    </xsd:simpleType>
110
111
112    <!-- The definition of a license to be referenced by the uses-license element. -->
113
114    <xsd:complexType name="licenseType">
115        <xsd:annotation>
116            <xsd:documentation>
117                A license definition. Such a license must be used later as a reference
118                using a uses-license element in one of the package elements.
119            </xsd:documentation>
120        </xsd:annotation>
121        <xsd:simpleContent>
122            <xsd:extension base="xsd:string">
123                <xsd:attribute name="id"   type="xsd:ID" />
124                <xsd:attribute name="type" type="xsd:token" fixed="text" />
125            </xsd:extension>
126        </xsd:simpleContent>
127    </xsd:complexType>
128
129
130    <!-- Type describing the license used by a package.
131         The license MUST be defined using a license node and referenced
132         using the ref attribute of the license element inside a package.
133     -->
134
135    <xsd:complexType name="usesLicenseType">
136        <xsd:annotation>
137            <xsd:documentation>
138                Describes the license used by a package. The license MUST be defined
139                using a license node and referenced using the ref attribute of the
140                license element inside a package.
141            </xsd:documentation>
142        </xsd:annotation>
143        <xsd:attribute name="ref" type="xsd:IDREF" />
144    </xsd:complexType>
145
146
147    <!-- A collection of files that can be downloaded for a given architecture.
148         The <archives> node is mandatory in the repository elements and the
149         collection must have at least one <archive> declared.
150         Each archive is a zip file that will be unzipped in a location that depends
151         on its package type.
152     -->
153
154    <xsd:complexType name="archivesType">
155        <xsd:annotation>
156            <xsd:documentation>
157                A collection of files that can be downloaded for a given architecture.
158                The &lt;archives&gt; node is mandatory in the repository packages and the
159                collection must have at least one &lt;archive&gt; declared.
160                Each archive is a zip file that will be unzipped in a location that depends
161                on its package type.
162            </xsd:documentation>
163        </xsd:annotation>
164        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
165            <!-- One archive file -->
166            <xsd:element name="archive">
167                <xsd:complexType>
168                    <!-- Properties of the archive file -->
169                    <xsd:all>
170                        <!-- The size in bytes of the archive to download. -->
171                        <xsd:element name="size"     type="xsd:positiveInteger" />
172                        <!-- The checksum of the archive file. -->
173                        <xsd:element name="checksum" type="sdk:checksumType" />
174                        <!-- The URL is an absolute URL if it starts with http://, https://
175                             or ftp://. Otherwise it is relative to the parent directory that
176                             contains this repository.xml -->
177                        <xsd:element name="url"      type="xsd:token" />
178                    </xsd:all>
179
180                    <!-- Attributes that identify the OS and architecture -->
181                    <xsd:attribute name="os" use="required">
182                        <xsd:simpleType>
183                            <xsd:restriction base="xsd:token">
184                                <xsd:enumeration value="any" />
185                                <xsd:enumeration value="linux" />
186                                <xsd:enumeration value="macosx" />
187                                <xsd:enumeration value="windows" />
188                            </xsd:restriction>
189                        </xsd:simpleType>
190                    </xsd:attribute>
191                    <xsd:attribute name="arch" use="optional">
192                        <xsd:simpleType>
193                            <xsd:restriction base="xsd:token">
194                                <xsd:enumeration value="any" />
195                                <xsd:enumeration value="ppc" />
196                                <xsd:enumeration value="x86" />
197                                <xsd:enumeration value="x86_64" />
198                            </xsd:restriction>
199                        </xsd:simpleType>
200                    </xsd:attribute>
201                </xsd:complexType>
202            </xsd:element>
203        </xsd:sequence>
204    </xsd:complexType>
205
206
207    <!-- The definition of a file checksum -->
208
209    <xsd:simpleType name="sha1Number">
210        <xsd:annotation>
211            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
212        </xsd:annotation>
213        <xsd:restriction base="xsd:string">
214            <xsd:pattern value="([0-9a-fA-F]){40}"/>
215        </xsd:restriction>
216    </xsd:simpleType>
217
218    <xsd:complexType name="checksumType">
219        <xsd:annotation>
220            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
221        </xsd:annotation>
222        <xsd:simpleContent>
223            <xsd:extension base="sdk:sha1Number">
224                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
225            </xsd:extension>
226        </xsd:simpleContent>
227    </xsd:complexType>
228
229</xsd:schema>
230