diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java
index 8d19c0f6d..5afe73cd1 100755
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java
@@ -42,16 +42,20 @@ import java.util.Properties;
*/
public abstract class Package implements IDescription {
- private static final String PROP_REVISION = "Pkg.Revision"; //$NON-NLS-1$
- private static final String PROP_LICENSE = "Pkg.License"; //$NON-NLS-1$
- private static final String PROP_DESC = "Pkg.Desc"; //$NON-NLS-1$
- private static final String PROP_DESC_URL = "Pkg.DescUrl"; //$NON-NLS-1$
- private static final String PROP_SOURCE_URL = "Pkg.SourceUrl"; //$NON-NLS-1$
- private static final String PROP_USER_SOURCE = "Pkg.UserSrc"; //$NON-NLS-1$
+ private static final String PROP_REVISION = "Pkg.Revision"; //$NON-NLS-1$
+ private static final String PROP_LICENSE = "Pkg.License"; //$NON-NLS-1$
+ private static final String PROP_DESC = "Pkg.Desc"; //$NON-NLS-1$
+ private static final String PROP_DESC_URL = "Pkg.DescUrl"; //$NON-NLS-1$
+ private static final String PROP_RELEASE_NOTE = "Pkg.RelNote"; //$NON-NLS-1$
+ private static final String PROP_RELEASE_URL = "Pkg.RelNoteUrl"; //$NON-NLS-1$
+ private static final String PROP_SOURCE_URL = "Pkg.SourceUrl"; //$NON-NLS-1$
+ private static final String PROP_USER_SOURCE = "Pkg.UserSrc"; //$NON-NLS-1$
private final int mRevision;
private final String mLicense;
private final String mDescription;
private final String mDescUrl;
+ private final String mReleaseNote;
+ private final String mReleaseUrl;
private final Archive[] mArchives;
private final RepoSource mSource;
@@ -80,6 +84,8 @@ public abstract class Package implements IDescription {
mRevision = XmlParserUtils.getXmlInt (packageNode, SdkRepository.NODE_REVISION, 0);
mDescription = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_DESCRIPTION);
mDescUrl = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_DESC_URL);
+ mReleaseNote = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_RELEASE_NOTE);
+ mReleaseUrl = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_RELEASE_URL);
mLicense = parseLicense(packageNode, licenses);
mArchives = parseArchives(XmlParserUtils.getFirstChild(
@@ -104,10 +110,19 @@ public abstract class Package implements IDescription {
Arch archiveArch,
String archiveOsPath) {
+ if (description == null) {
+ description = "";
+ }
+ if (descUrl == null) {
+ descUrl = "";
+ }
+
mRevision = Integer.parseInt(getProperty(props, PROP_REVISION, Integer.toString(revision)));
- mLicense = getProperty(props, PROP_LICENSE, license);
- mDescription = getProperty(props, PROP_DESC, description);
- mDescUrl = getProperty(props, PROP_DESC_URL, descUrl);
+ mLicense = getProperty(props, PROP_LICENSE, license);
+ mDescription = getProperty(props, PROP_DESC, description);
+ mDescUrl = getProperty(props, PROP_DESC_URL, descUrl);
+ mReleaseNote = getProperty(props, PROP_RELEASE_NOTE, "");
+ mReleaseUrl = getProperty(props, PROP_RELEASE_URL, "");
// If source is null and we can find a source URL in the properties, generate
// a dummy source just to store the URL. This allows us to easily remember where
@@ -145,16 +160,24 @@ public abstract class Package implements IDescription {
*/
void saveProperties(Properties props) {
props.setProperty(PROP_REVISION, Integer.toString(mRevision));
- if (mLicense != null) {
+ if (mLicense != null && mLicense.length() > 0) {
props.setProperty(PROP_LICENSE, mLicense);
}
- if (mDescription != null) {
+
+ if (mDescription != null && mDescription.length() > 0) {
props.setProperty(PROP_DESC, mDescription);
}
- if (mDescUrl != null) {
+ if (mDescUrl != null && mDescUrl.length() > 0) {
props.setProperty(PROP_DESC_URL, mDescUrl);
}
+ if (mReleaseNote != null && mReleaseNote.length() > 0) {
+ props.setProperty(PROP_RELEASE_NOTE, mReleaseNote);
+ }
+ if (mReleaseUrl != null && mReleaseUrl.length() > 0) {
+ props.setProperty(PROP_RELEASE_URL, mReleaseUrl);
+ }
+
if (mSource != null) {
props.setProperty(PROP_SOURCE_URL, mSource.getUrl());
props.setProperty(PROP_USER_SOURCE, Boolean.toString(mSource.isUserSource()));
@@ -258,6 +281,22 @@ public abstract class Package implements IDescription {
return mDescUrl;
}
+ /**
+ * Returns the optional release note for all packages (platform, add-on, tool, doc) or
+ * for a lib. Can be empty but not null.
+ */
+ public String getReleaseNote() {
+ return mReleaseNote;
+ }
+
+ /**
+ * Returns the optional release note URL for all packages (platform, add-on, tool, doc).
+ * Can be empty but not null.
+ */
+ public String getReleaseNoteUrl() {
+ return mReleaseUrl;
+ }
+
/**
* Returns the archives defined in this package.
* Can be an empty array but not null.
@@ -291,7 +330,31 @@ public abstract class Package implements IDescription {
* Can be empty but not null.
*/
public String getLongDescription() {
- return String.format("%1$s\nRevision %2$d", getDescription(), getRevision());
+ StringBuilder sb = new StringBuilder();
+
+ String s = getDescription();
+ if (s != null) {
+ sb.append(s);
+ }
+
+ sb.append(String.format("\nRevision %1$d", getRevision()));
+
+ s = getDescUrl();
+ if (s != null && s.length() > 0) {
+ sb.append(String.format("\n\nMore information at %1$s", s));
+ }
+
+ s = getReleaseNote();
+ if (s != null && s.length() > 0) {
+ sb.append("\n\nRelease note:\n").append(s);
+ }
+
+ s = getReleaseNoteUrl();
+ if (s != null && s.length() > 0) {
+ sb.append("\nRelease note URL: ").append(s);
+ }
+
+ return sb.toString();
}
/**
diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkRepository.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkRepository.java
index 88d18dbfd..4b12d597b 100755
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkRepository.java
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkRepository.java
@@ -53,11 +53,15 @@ public class SdkRepository {
/** The optional uses-license for all packages (platform, add-on, tool, doc) or for a lib. */
public static final String NODE_USES_LICENSE = "uses-license"; //$NON-NLS-1$
/** The revision, an int > 0, for all packages (platform, add-on, tool, doc). */
- public static final String NODE_REVISION = "revision"; //$NON-NLS-1$
+ public static final String NODE_REVISION = "revision"; //$NON-NLS-1$
/** The optional description for all packages (platform, add-on, tool, doc) or for a lib. */
- public static final String NODE_DESCRIPTION = "description"; //$NON-NLS-1$
+ public static final String NODE_DESCRIPTION = "description"; //$NON-NLS-1$
/** The optional description URL for all packages (platform, add-on, tool, doc). */
- public static final String NODE_DESC_URL = "desc-url"; //$NON-NLS-1$
+ public static final String NODE_DESC_URL = "desc-url"; //$NON-NLS-1$
+ /** The optional release note for all packages (platform, add-on, tool, doc). */
+ public static final String NODE_RELEASE_NOTE = "release-note"; //$NON-NLS-1$
+ /** The optional release note URL for all packages (platform, add-on, tool, doc). */
+ public static final String NODE_RELEASE_URL = "release-url"; //$NON-NLS-1$
/** The version, a string, for platform packages. */
public static final String NODE_VERSION = "version"; //$NON-NLS-1$
diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository.xsd b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository.xsd
index a697c83a3..7ca089298 100755
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository.xsd
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository.xsd
@@ -65,6 +65,10 @@
+
+
+
+
@@ -99,6 +103,10 @@
+
+
+
+
@@ -143,6 +151,10 @@
+
+
+
+
@@ -173,6 +185,10 @@
+
+
+
+
@@ -219,6 +235,10 @@
+
+
+
+
diff --git a/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/repository_sample.xml b/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/repository_sample.xml
index 73405498a..20b85717c 100755
--- a/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/repository_sample.xml
+++ b/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/repository_sample.xml
@@ -39,6 +39,10 @@
Some optional description
http://www.example.com/platform1.html
+ This is an optional release note
+ for this package. It's a free multi-line text.
+
+ http://some/url/for/the/release/note.html