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