}\r
\r
/**\r
- * Creates a new platform package based on an actual {@link IAndroidTarget} (with\r
+ * Creates a new platform package based on an actual {@link IAndroidTarget} (which\r
* {@link IAndroidTarget#isPlatform()} false) from the {@link SdkManager}.\r
* This is used to list local SDK folders.\r
*/\r
AddonPackage(IAndroidTarget target) {\r
super( null, //source\r
0, //revision\r
- target.getDescription(), //description\r
+ null, //license\r
+ target.getDescription(), //description\r
null, //descUrl\r
Os.getCurrentOs(), //archiveOs\r
Arch.getCurrentArch(), //archiveArch\r
DocPackage(RepoSource source,\r
int apiLevel,\r
int revision,\r
+ String license,\r
String description,\r
String descUrl,\r
Os archiveOs,\r
String archiveChecksum) {\r
super(source,\r
revision,\r
+ license,\r
description,\r
descUrl,\r
archiveOs,\r
pkg = new ToolPackage(\r
null, //source\r
0, //revision\r
+ null, //license\r
"Tools", //description\r
null, //descUrl\r
Os.getCurrentOs(), //archiveOs\r
null, //source\r
0, //apiLevel\r
0, //revision\r
+ null, //license\r
String.format("Documentation for %1$s", found), //description\r
null, //descUrl\r
Os.getCurrentOs(), //archiveOs\r
public abstract class Package implements IDescription {\r
\r
private final int mRevision;\r
+ private final String mLicense;\r
private final String mDescription;\r
private final String mDescUrl;\r
private final Archive[] mArchives;\r
mRevision = getXmlInt (packageNode, SdkRepository.NODE_REVISION, 0);\r
mDescription = getXmlString(packageNode, SdkRepository.NODE_DESCRIPTION);\r
mDescUrl = getXmlString(packageNode, SdkRepository.NODE_DESC_URL);\r
-\r
+ mLicense = getXmlString(packageNode, SdkRepository.NODE_LICENSE);\r
mArchives = parseArchives(getFirstChild(packageNode, SdkRepository.NODE_ARCHIVES));\r
}\r
\r
*/\r
public Package(RepoSource source,\r
int revision,\r
+ String license,\r
String description,\r
String descUrl,\r
Os archiveOs,\r
String archiveChecksum) {\r
mSource = source;\r
mRevision = revision;\r
+ mLicense = license;\r
mDescription = description;\r
mDescUrl = descUrl;\r
mArchives = new Archive[1];\r
\r
/**\r
* Returns the optional description for all packages (platform, add-on, tool, doc) or\r
+ * for a lib. It is null if the element has not been specified in the repository XML.\r
+ */\r
+ public String getLicense() {\r
+ return mLicense;\r
+ }\r
+\r
+ /**\r
+ * Returns the optional description for all packages (platform, add-on, tool, doc) or\r
* for a lib. Can be empty but not null.\r
*/\r
public String getDescription() {\r
}\r
\r
/**\r
- * Creates a new platform package based on an actual {@link IAndroidTarget} (with\r
+ * Creates a new platform package based on an actual {@link IAndroidTarget} (which\r
* must have {@link IAndroidTarget#isPlatform()} true) from the {@link SdkManager}.\r
* This is used to list local SDK folders.\r
*/\r
PlatformPackage(IAndroidTarget target) {\r
super( null, //source\r
0, //revision\r
- target.getDescription(), //description\r
+ null, //license\r
+ target.getDescription(), //description\r
null, //descUrl\r
Os.getCurrentOs(), //archiveOs\r
Arch.getCurrentArch(), //archiveArch\r
*/\r
ToolPackage(RepoSource source,\r
int revision,\r
+ String license,\r
String description,\r
String descUrl,\r
Os archiveOs,\r
String archiveChecksum) {\r
super(source,\r
revision,\r
+ license,\r
description,\r
descUrl,\r
archiveOs,\r
\r
/** The revision, an int > 0, for all packages (platform, add-on, tool, doc). */\r
public static final String NODE_REVISION = "revision"; //$NON-NLS-1$\r
+ /** The optional license for all packages (platform, add-on, tool, doc) or for a lib. */\r
+ public static final String NODE_LICENSE = "license"; //$NON-NLS-1$\r
/** The optional description for all packages (platform, add-on, tool, doc) or for a lib. */\r
public static final String NODE_DESCRIPTION = "description"; //$NON-NLS-1$\r
/** The optional description URL for all packages (platform, add-on, tool, doc). */\r
<!-- The revision, an int > 0, incremented each time a new
package is generated. -->
<xsd:element name="revision" type="xsd:positiveInteger" />
+ <!-- The optional license of this package. If present, users will have
+ to agree to it before downloading. -->
+ <xsd:element name="license" type="xsd:string" minOccurs="0" />
<!-- The optional description of this package. -->
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<!-- The revision, an int > 0, incremented each time a new
package is generated. -->
<xsd:element name="revision" type="xsd:positiveInteger" />
+ <!-- The optional license of this package. If present, users will have
+ to agree to it before downloading. -->
+ <xsd:element name="license" type="xsd:string" minOccurs="0" />
<!-- The optional description of this package. -->
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<!-- The revision, an int > 0, incremented each time a new
package is generated. -->
<xsd:element name="revision" type="xsd:positiveInteger" />
+ <!-- The optional license of this package. If present, users will have
+ to agree to it before downloading. -->
+ <xsd:element name="license" type="xsd:string" minOccurs="0" />
<!-- The optional description of this package. -->
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<!-- The revision, an int > 0, incremented each time a new
package is generated. -->
<xsd:element name="revision" type="xsd:positiveInteger" />
+ <!-- The optional license of this package. If present, users will have
+ to agree to it before downloading. -->
+ <xsd:element name="license" type="xsd:string" minOccurs="0" />
<!-- The optional description of this package. -->
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<sdk:api-level>1</sdk:api-level>\r
<sdk:revision>3</sdk:revision>\r
<sdk:description>Some optional description</sdk:description>\r
+ <sdk:license>This is the license\r
+ for this platform.</sdk:license>\r
<sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>\r
<!-- The archives node is mandatory and it cannot be empty. -->\r
<sdk:archives>\r
<sdk:api-level>1</sdk:api-level>\r
<sdk:revision>1</sdk:revision>\r
<sdk:description>Some optional description</sdk:description>\r
+ <!-- the license element is not mandatory. -->\r
<sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>\r
<sdk:archives>\r
<sdk:archive os="any">\r
<sdk:api-level>1</sdk:api-level>\r
<sdk:vendor>John Doe</sdk:vendor>\r
<sdk:revision>1</sdk:revision>\r
+ <!-- license can be empty. -->\r
+ <sdk:license></sdk:license>\r
<sdk:description>Some optional description</sdk:description>\r
<sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>\r
<sdk:archives>\r
<sdk:version>1.1</sdk:version>\r
<sdk:api-level>2</sdk:api-level>\r
<sdk:revision>12</sdk:revision>\r
+ <sdk:license>This is the license for this package.</sdk:license>\r
<!-- sdk:description and sdk:desc-url are optional -->\r
<sdk:archives>\r
<sdk:archive os="windows">\r
<sdk:name>com.android.mymaps</sdk:name>\r
</sdk:lib>\r
</sdk:libs>\r
+ <sdk:license>This is the license for this package.</sdk:license>\r
</sdk:add-on>\r
\r
<sdk:tool>\r
<sdk:revision>1</sdk:revision>\r
<sdk:description>Some optional description</sdk:description>\r
<sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>\r
+ <sdk:license>This is the license for this package.</sdk:license>\r
<sdk:archives>\r
<sdk:archive os="any">\r
<sdk:size>65536</sdk:size>\r
<sdk:doc>\r
<sdk:api-level>2</sdk:api-level>\r
<sdk:revision>42</sdk:revision>\r
+ <sdk:license>This is the license for this package.</sdk:license>\r
<sdk:archives>\r
<sdk:archive os="windows">\r
<sdk:size>65536</sdk:size>\r
\r
<sdk:tool>\r
<sdk:revision>42</sdk:revision>\r
+ <sdk:license>This is the license for this package.</sdk:license>\r
<sdk:archives>\r
<sdk:archive os="windows">\r
<sdk:size>65536</sdk:size>\r
</sdk:tool>\r
\r
<sdk:add-on>\r
+ <sdk:license>This is the license for this package.</sdk:license>\r
<sdk:name>This add-on has no libraries</sdk:name>\r
<sdk:api-level>4</sdk:api-level>\r
<sdk:vendor>Joe Bar</sdk:vendor>\r