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