/repository/sdk-addon-04.xsd

https://android.googlesource.com/platform/prebuilts/devtools · XML Schema · 417 lines · 358 code · 59 blank · 0 comment · 0 complexity · 3958f19a6234354d3f0f8b8b8c3dbdc8 MD5 · raw file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. * Copyright (C) 2011 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/addon/4"
  19. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  20. xmlns:sdk="http://schemas.android.com/sdk/android/addon/4"
  21. elementFormDefault="qualified"
  22. attributeFormDefault="unqualified"
  23. version="1">
  24. <!-- The repository contains a collection of downloadable items known as
  25. "packages". Each package has a type and various attributes and contains
  26. a list of file "archives" that can be downloaded for specific OSes.
  27. An Android Addon repository is a web site that contains an "addon.xml"
  28. file that conforms to this XML Schema.
  29. History:
  30. - v1 is used by the SDK Updater in Tools r8. It is split out of the
  31. main SDK Repository XML Schema and can only contain <addon> and
  32. <extra> packages.
  33. - v2 is used by the SDK Updater in Tools r12.
  34. - <extra> element now has a <project-files> element that contains 1 or
  35. or more <path>, each indicating the relative path of a file that this package
  36. can contribute to installed projects.
  37. - <addon> element now has an optional <layoutlib> that indicates the API
  38. and revision of the layout library for this particular add-on, if any.
  39. - v3 is used by the SDK Manager in Tools r14:
  40. - <extra> now has an <old-paths> element, a ;-separated list of old paths that
  41. should be detected and migrated to the new <path> for that package.
  42. - v4 is used by the SDK Manager in Tools r18:
  43. - <extra> and <addon> are not in the Repository XSD v6 anymore.
  44. - <extra> get a new field <name-display>, which is used by the SDK Manager to
  45. customize the name of the extra in the list display. The single <vendor>
  46. field becomes <vendor-id> and <vendor-display>, the id being used internally
  47. and the display in the UI.
  48. - <addon> does the same, where <name> is replaced by <name-id> and <name-display>
  49. and <vendor> is replaced by <vendor-id> and <vendor-display>.
  50. -->
  51. <xsd:element name="sdk-addon" type="sdk:repositoryType" />
  52. <xsd:complexType name="repositoryType">
  53. <xsd:annotation>
  54. <xsd:documentation>
  55. The repository contains a collection of downloadable packages.
  56. </xsd:documentation>
  57. </xsd:annotation>
  58. <xsd:choice minOccurs="0" maxOccurs="unbounded">
  59. <xsd:element name="add-on" type="sdk:addonType" />
  60. <xsd:element name="extra" type="sdk:extraType" />
  61. <xsd:element name="license" type="sdk:licenseType" />
  62. </xsd:choice>
  63. </xsd:complexType>
  64. <!-- The definition of an SDK Add-on package. -->
  65. <xsd:complexType name="addonType">
  66. <xsd:annotation>
  67. <xsd:documentation>An SDK add-on package.</xsd:documentation>
  68. </xsd:annotation>
  69. <xsd:all>
  70. <!-- The internal name id of the add-on. Must be unique per vendor. -->
  71. <xsd:element name="name-id" type="sdk:idType" />
  72. <!-- The displayed name of the add-on. -->
  73. <xsd:element name="name-display" type="xsd:normalizedString" />
  74. <!-- The internal vendor id of the add-on. Must be unique amongst vendors. -->
  75. <xsd:element name="vendor-id" type="sdk:idType" />
  76. <!-- The displayed vendor name of the add-on. -->
  77. <xsd:element name="vendor-display" type="xsd:normalizedString" />
  78. <!-- The Android API Level for the add-on. An int > 0. -->
  79. <xsd:element name="api-level" type="xsd:positiveInteger" />
  80. <!-- Note: Add-ons do not support 'codenames' (a.k.a. API previews). -->
  81. <!-- The revision, an int > 0, incremented each time a new
  82. package is generated. -->
  83. <xsd:element name="revision" type="xsd:positiveInteger" />
  84. <!-- An add-on can declare 0 or more libraries.
  85. This element is mandatory but it can be empty.
  86. -->
  87. <xsd:element name="libs">
  88. <xsd:complexType>
  89. <xsd:sequence minOccurs="0" maxOccurs="unbounded">
  90. <xsd:element name="lib">
  91. <xsd:complexType>
  92. <xsd:all>
  93. <!-- The name of the library. -->
  94. <xsd:element name="name" type="xsd:normalizedString" />
  95. <!-- The optional description of this add-on library. -->
  96. <xsd:element name="description" type="xsd:string" minOccurs="0" />
  97. </xsd:all>
  98. </xsd:complexType>
  99. </xsd:element>
  100. </xsd:sequence>
  101. </xsd:complexType>
  102. </xsd:element>
  103. <!-- optional elements -->
  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. <!-- A list of file archives for this package. -->
  116. <xsd:element name="archives" type="sdk:archivesType" />
  117. <!-- An optional element indicating the package is obsolete.
  118. The string content is however currently not defined and ignored. -->
  119. <xsd:element name="obsolete" type="xsd:string" minOccurs="0" />
  120. <!-- An optional element indicating the package is a beta/preview.
  121. When present, it indicates the release-candidate number.
  122. When the element is absent, it indicates this is a released package.
  123. DEPRECATED. TODO remove in sdk-addon-5. -->
  124. <xsd:element name="beta-rc" type="xsd:positiveInteger" minOccurs="0" />
  125. <!-- Optional information on the layoutlib packaged in this platform. -->
  126. <xsd:element name="layoutlib" type="sdk:layoutlibType" minOccurs="0" />
  127. </xsd:all>
  128. </xsd:complexType>
  129. <xsd:simpleType name="idType">
  130. <xsd:annotation>
  131. <xsd:documentation>
  132. An ID string for an addon/extra name-id or vendor-id
  133. can only be simple alphanumeric string.
  134. </xsd:documentation>
  135. </xsd:annotation>
  136. <xsd:restriction base="xsd:token">
  137. <xsd:pattern value="[a-zA-Z0-9_-]+"/>
  138. </xsd:restriction>
  139. </xsd:simpleType>
  140. <!-- The definition of a layout library used by an addon. -->
  141. <xsd:complexType name="layoutlibType" >
  142. <xsd:annotation>
  143. <xsd:documentation>
  144. Version information for a layoutlib included in an addon.
  145. .</xsd:documentation>
  146. </xsd:annotation>
  147. <xsd:all>
  148. <!-- The layoutlib API level, an int > 0,
  149. incremented with each new incompatible lib. -->
  150. <xsd:element name="api" type="xsd:positiveInteger" />
  151. <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
  152. Optional. An int >= 0, assumed to be 0 if the element is missing. -->
  153. <xsd:element name="revision" type="xsd:nonNegativeInteger" minOccurs="0" />
  154. </xsd:all>
  155. </xsd:complexType>
  156. <!-- The definition of an SDK extra package. This kind of package is for
  157. "free" content. Such packages are installed in SDK/extras/vendor/path.
  158. -->
  159. <xsd:complexType name="extraType" >
  160. <xsd:annotation>
  161. <xsd:documentation>
  162. An SDK extra package. This kind of package is for "free" content.
  163. Such packages are installed in SDK/vendor/path.
  164. </xsd:documentation>
  165. </xsd:annotation>
  166. <xsd:all>
  167. <!-- The displayed name of the extra. -->
  168. <xsd:element name="name-display" type="xsd:normalizedString" />
  169. <!-- The internal vendor id of the extra. Must be unique amongst vendors. -->
  170. <xsd:element name="vendor-id" type="sdk:idType" />
  171. <!-- The displayed vendor name of the extra. -->
  172. <xsd:element name="vendor-display" type="xsd:normalizedString" />
  173. <!-- The install path sub-folder name. It must not be empty. -->
  174. <xsd:element name="path" type="sdk:segmentType" />
  175. <!-- A semi-colon separated list of "obsolete" path names which are equivalent
  176. to the current 'path' name. When a package is seen using an old-paths' name,
  177. the package manager will try to upgrade it to the new path. -->
  178. <xsd:element name="old-paths" type="sdk:segmentListType" minOccurs="0" />
  179. <!-- The revision, an int > 0, incremented each time a new
  180. package is generated. -->
  181. <xsd:element name="revision" type="xsd:positiveInteger" />
  182. <!-- A list of file archives for this package. -->
  183. <xsd:element name="archives" type="sdk:archivesType" />
  184. <!-- optional elements -->
  185. <!-- The optional license of this package. If present, users will have
  186. to agree to it before downloading. -->
  187. <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
  188. <!-- The optional description of this package. -->
  189. <xsd:element name="description" type="xsd:string" minOccurs="0" />
  190. <!-- The optional description URL of this package -->
  191. <xsd:element name="desc-url" type="xsd:token" minOccurs="0" />
  192. <!-- The optional release note for this package. -->
  193. <xsd:element name="release-note" type="xsd:string" minOccurs="0" />
  194. <!-- The optional release note URL of this package -->
  195. <xsd:element name="release-url" type="xsd:token" minOccurs="0" />
  196. <!-- The minimal revision of tools required by this package.
  197. Optional. If present, must be an int > 0. -->
  198. <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
  199. <!-- The minimal API level required by this package.
  200. Optional. If present, must be an int > 0. -->
  201. <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
  202. <!-- An optional element indicating the package is obsolete.
  203. The string content is however currently not defined and ignored. -->
  204. <xsd:element name="obsolete" type="xsd:string" minOccurs="0" />
  205. <!-- An optional element indicating the package is a beta/preview.
  206. When present, it indicates the release-candidate number.
  207. When the element is absent, it indicates this is a released package. -->
  208. <xsd:element name="beta-rc" type="xsd:positiveInteger" minOccurs="0" />
  209. <!-- A list of project files contributed by this package. Optional. -->
  210. <xsd:element name="project-files" type="sdk:projectFilesType" minOccurs="0" />
  211. </xsd:all>
  212. </xsd:complexType>
  213. <!-- The definition of a path segment used by the extra element. -->
  214. <xsd:simpleType name="segmentType">
  215. <xsd:annotation>
  216. <xsd:documentation>
  217. One path segment for the install path of an extra element.
  218. It must be a single-segment path. It must not be empty.
  219. </xsd:documentation>
  220. </xsd:annotation>
  221. <xsd:restriction base="xsd:token">
  222. <xsd:pattern value="[a-zA-Z0-9_]+"/>
  223. </xsd:restriction>
  224. </xsd:simpleType>
  225. <xsd:simpleType name="segmentListType">
  226. <xsd:annotation>
  227. <xsd:documentation>
  228. A semi-colon separated list of a segmentTypes.
  229. </xsd:documentation>
  230. </xsd:annotation>
  231. <xsd:restriction base="xsd:token">
  232. <xsd:pattern value="[a-zA-Z0-9_;]+"/>
  233. </xsd:restriction>
  234. </xsd:simpleType>
  235. <!-- The definition of a license to be referenced by the uses-license element. -->
  236. <xsd:complexType name="licenseType">
  237. <xsd:annotation>
  238. <xsd:documentation>
  239. A license definition. Such a license must be used later as a reference
  240. using a uses-license element in one of the package elements.
  241. </xsd:documentation>
  242. </xsd:annotation>
  243. <xsd:simpleContent>
  244. <xsd:extension base="xsd:string">
  245. <xsd:attribute name="id" type="xsd:ID" />
  246. <xsd:attribute name="type" type="xsd:token" fixed="text" />
  247. </xsd:extension>
  248. </xsd:simpleContent>
  249. </xsd:complexType>
  250. <!-- Type describing the license used by a package.
  251. The license MUST be defined using a license node and referenced
  252. using the ref attribute of the license element inside a package.
  253. -->
  254. <xsd:complexType name="usesLicenseType">
  255. <xsd:annotation>
  256. <xsd:documentation>
  257. Describes the license used by a package. The license MUST be defined
  258. using a license node and referenced using the ref attribute of the
  259. license element inside a package.
  260. </xsd:documentation>
  261. </xsd:annotation>
  262. <xsd:attribute name="ref" type="xsd:IDREF" />
  263. </xsd:complexType>
  264. <!-- A collection of files that can be downloaded for a given architecture.
  265. The <archives> node is mandatory in the repository elements and the
  266. collection must have at least one <archive> declared.
  267. Each archive is a zip file that will be unzipped in a location that depends
  268. on its package type.
  269. -->
  270. <xsd:complexType name="archivesType">
  271. <xsd:annotation>
  272. <xsd:documentation>
  273. A collection of files that can be downloaded for a given architecture.
  274. The &lt;archives&gt; node is mandatory in the repository packages and the
  275. collection must have at least one &lt;archive&gt; declared.
  276. Each archive is a zip file that will be unzipped in a location that depends
  277. on its package type.
  278. </xsd:documentation>
  279. </xsd:annotation>
  280. <xsd:sequence minOccurs="1" maxOccurs="unbounded">
  281. <!-- One archive file -->
  282. <xsd:element name="archive">
  283. <xsd:complexType>
  284. <!-- Properties of the archive file -->
  285. <xsd:all>
  286. <!-- The size in bytes of the archive to download. -->
  287. <xsd:element name="size" type="xsd:positiveInteger" />
  288. <!-- The checksum of the archive file. -->
  289. <xsd:element name="checksum" type="sdk:checksumType" />
  290. <!-- The URL is an absolute URL if it starts with http://, https://
  291. or ftp://. Otherwise it is relative to the parent directory that
  292. contains this repository.xml -->
  293. <xsd:element name="url" type="xsd:token" />
  294. </xsd:all>
  295. <!-- Attributes that identify the OS and architecture -->
  296. <xsd:attribute name="os" use="required">
  297. <xsd:simpleType>
  298. <xsd:restriction base="xsd:token">
  299. <xsd:enumeration value="any" />
  300. <xsd:enumeration value="linux" />
  301. <xsd:enumeration value="macosx" />
  302. <xsd:enumeration value="windows" />
  303. </xsd:restriction>
  304. </xsd:simpleType>
  305. </xsd:attribute>
  306. <xsd:attribute name="arch" use="optional">
  307. <xsd:simpleType>
  308. <xsd:restriction base="xsd:token">
  309. <xsd:enumeration value="any" />
  310. <xsd:enumeration value="ppc" />
  311. <xsd:enumeration value="x86" />
  312. <xsd:enumeration value="x86_64" />
  313. </xsd:restriction>
  314. </xsd:simpleType>
  315. </xsd:attribute>
  316. </xsd:complexType>
  317. </xsd:element>
  318. </xsd:sequence>
  319. </xsd:complexType>
  320. <!-- A collection of file paths available in an &lt;extra&gt; package
  321. that can be installed in an Android project.
  322. If present, the &lt;project-files&gt; collection must contain at least one path.
  323. Each path is relative to the root directory of the package.
  324. -->
  325. <xsd:complexType name="projectFilesType">
  326. <xsd:annotation>
  327. <xsd:documentation>
  328. A collection of file paths available in an &lt;extra&gt; package
  329. that can be installed in an Android project.
  330. If present, the &lt;project-files&gt; collection must contain at least one path.
  331. Each path is relative to the root directory of the package.
  332. </xsd:documentation>
  333. </xsd:annotation>
  334. <xsd:sequence minOccurs="1" maxOccurs="unbounded">
  335. <!-- One JAR Path, relative to the root folder of the package. -->
  336. <xsd:element name="path" type="xsd:string" />
  337. </xsd:sequence>
  338. </xsd:complexType>
  339. <!-- The definition of a file checksum -->
  340. <xsd:simpleType name="sha1Number">
  341. <xsd:annotation>
  342. <xsd:documentation>A SHA1 checksum.</xsd:documentation>
  343. </xsd:annotation>
  344. <xsd:restriction base="xsd:string">
  345. <xsd:pattern value="([0-9a-fA-F]){40}"/>
  346. </xsd:restriction>
  347. </xsd:simpleType>
  348. <xsd:complexType name="checksumType">
  349. <xsd:annotation>
  350. <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
  351. </xsd:annotation>
  352. <xsd:simpleContent>
  353. <xsd:extension base="sdk:sha1Number">
  354. <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
  355. </xsd:extension>
  356. </xsd:simpleContent>
  357. </xsd:complexType>
  358. </xsd:schema>