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