diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-14 12:56:35 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-14 12:56:35 -0700 |
commit | d8fb4bbe9d20df6f22389e79427cb2b10ab861fe (patch) | |
tree | fa47393415b731eb4ffc36e517c3fcfdfcb4acfd /sdkmanager/app/src | |
parent | d054afbd92d6799c04018ee0174c003db2265d88 (diff) | |
parent | 1647849f10140b218f1a4012609c072946c5d1f3 (diff) | |
download | sdk-d8fb4bbe9d20df6f22389e79427cb2b10ab861fe.zip sdk-d8fb4bbe9d20df6f22389e79427cb2b10ab861fe.tar.gz sdk-d8fb4bbe9d20df6f22389e79427cb2b10ab861fe.tar.bz2 |
Merge change 1501 into donut
* changes:
ADT #1844909: SDK manager, define XML schemas & sample XMLs
Diffstat (limited to 'sdkmanager/app/src')
-rwxr-xr-x | sdkmanager/app/src/com/android/sdkmanager/repository/SdkRepositoryConstants.java | 33 | ||||
-rwxr-xr-x | sdkmanager/app/src/com/android/sdkmanager/repository/sdk-repository.xsd | 181 |
2 files changed, 214 insertions, 0 deletions
diff --git a/sdkmanager/app/src/com/android/sdkmanager/repository/SdkRepositoryConstants.java b/sdkmanager/app/src/com/android/sdkmanager/repository/SdkRepositoryConstants.java new file mode 100755 index 0000000..f911989 --- /dev/null +++ b/sdkmanager/app/src/com/android/sdkmanager/repository/SdkRepositoryConstants.java @@ -0,0 +1,33 @@ +/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.sdkmanager.repository;
+
+import java.io.InputStream;
+
+/**
+ * Constants for the sdk-repository XML Schema
+ */
+public class SdkRepositoryConstants {
+
+ public static final String NS_SDK_REPOSITORY =
+ "http://schemas.android.com/sdk/android/repository/1";
+
+ public static InputStream getXsdStream() {
+ return SdkRepositoryConstants.class.getResourceAsStream("sdk-repository.xsd");
+ }
+
+}
diff --git a/sdkmanager/app/src/com/android/sdkmanager/repository/sdk-repository.xsd b/sdkmanager/app/src/com/android/sdkmanager/repository/sdk-repository.xsd new file mode 100755 index 0000000..c59197f --- /dev/null +++ b/sdkmanager/app/src/com/android/sdkmanager/repository/sdk-repository.xsd @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +--> +<xsd:schema + targetNamespace="http://schemas.android.com/sdk/android/repository/1" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:sdk="http://schemas.android.com/sdk/android/repository/1" + elementFormDefault="qualified" + attributeFormDefault="unqualified" + version="1"> + + <!-- The definition of a file checksum --> + + <xsd:simpleType name="sha1Number"> + <xsd:annotation> + <xsd:documentation>A SHA1 checksum.</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:string"> + <xsd:pattern value="([0-9a-fA-F]){40}"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:complexType name="checksumType"> + <xsd:annotation> + <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation> + </xsd:annotation> + <xsd:simpleContent> + <xsd:extension base="sdk:sha1Number"> + <xsd:attribute name="type" type="xsd:token" fixed="sha1" /> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + + <!-- The repository contains a collection of downloadable items --> + + <xsd:element name="sdk-repository"> + <xsd:annotation> + <xsd:documentation> + The repository contains collections of downloadable items. + </xsd:documentation> + </xsd:annotation> + + <xsd:complexType> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + + <!-- The definition of an SDK platform item --> + + <xsd:element name="platform"> + <xsd:complexType> + <xsd:all> + <xsd:element name="version" type="xsd:normalizedString" /> + <xsd:element name="api-level" type="xsd:positiveInteger" /> + + <xsd:element name="revision" type="xsd:positiveInteger" /> + <xsd:element name="description" type="xsd:string" minOccurs="0" /> + <xsd:element name="desc-url" type="xsd:token" minOccurs="0" /> + <xsd:element name="archives" type="sdk:archivesType" /> + </xsd:all> + </xsd:complexType> + </xsd:element> + + <!-- The definition of an SDK Add-on item --> + + <xsd:element name="add-on"> + <xsd:complexType> + <xsd:all> + <xsd:element name="name" type="xsd:normalizedString" /> + <xsd:element name="vendor" type="xsd:normalizedString" /> + <xsd:element name="api-level" type="xsd:positiveInteger" /> + + <xsd:element name="revision" type="xsd:positiveInteger" /> + <xsd:element name="description" type="xsd:string" minOccurs="0" /> + <xsd:element name="desc-url" type="xsd:token" minOccurs="0" /> + <xsd:element name="archives" type="sdk:archivesType" /> + + <xsd:element name="libs"> + <xsd:complexType> + <xsd:sequence maxOccurs="unbounded"> + <xsd:element name="lib"> + <xsd:complexType> + <xsd:all> + <xsd:element name="name" type="xsd:normalizedString" /> + <xsd:element name="description" type="xsd:string" minOccurs="0" /> + </xsd:all> + </xsd:complexType> + </xsd:element> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:all> + </xsd:complexType> + </xsd:element> + + <!-- The definition of an SDK tool item --> + + <xsd:element name="tool"> + <xsd:complexType> + <xsd:all> + <xsd:element name="revision" type="xsd:positiveInteger" /> + <xsd:element name="description" type="xsd:string" minOccurs="0" /> + <xsd:element name="desc-url" type="xsd:token" minOccurs="0" /> + <xsd:element name="archives" type="sdk:archivesType" /> + </xsd:all> + </xsd:complexType> + </xsd:element> + + <!-- The definition of an SDK doc item --> + + <xsd:element name="doc"> + <xsd:complexType> + <xsd:all> + <xsd:element name="api-level" type="xsd:positiveInteger" /> + + <xsd:element name="revision" type="xsd:positiveInteger" /> + <xsd:element name="description" type="xsd:string" minOccurs="0" /> + <xsd:element name="desc-url" type="xsd:token" minOccurs="0" /> + <xsd:element name="archives" type="sdk:archivesType" /> + </xsd:all> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + + <!-- A collection of files that can be downloaded for a given architectures --> + + <xsd:complexType name="archivesType"> + <xsd:annotation> + <xsd:documentation>A collection of architecture-dependent archives.</xsd:documentation> + </xsd:annotation> + <xsd:sequence maxOccurs="unbounded"> + <!-- One archive file --> + <xsd:element name="archive"> + <xsd:complexType> + <!-- Properties of the file --> + <xsd:all> + <xsd:element name="size" type="xsd:positiveInteger" /> + <xsd:element name="checksum" type="sdk:checksumType" /> + <xsd:element name="url" type="xsd:token" /> + </xsd:all> + + <!-- Attributes that identify the architecture --> + <xsd:attribute name="os" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="any" /> + <xsd:enumeration value="linux" /> + <xsd:enumeration value="macosx" /> + <xsd:enumeration value="windows" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="arch" use="optional"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="any" /> + <xsd:enumeration value="ppc" /> + <xsd:enumeration value="x86" /> + <xsd:enumeration value="x86_64" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + </xsd:sequence> + </xsd:complexType> + +</xsd:schema> |