*/\r
public abstract class Package implements IDescription {\r
\r
- private static final String PROP_REVISION = "Pkg.Revision"; //$NON-NLS-1$\r
- private static final String PROP_LICENSE = "Pkg.License"; //$NON-NLS-1$\r
- private static final String PROP_DESC = "Pkg.Desc"; //$NON-NLS-1$\r
- private static final String PROP_DESC_URL = "Pkg.DescUrl"; //$NON-NLS-1$\r
- private static final String PROP_SOURCE_URL = "Pkg.SourceUrl"; //$NON-NLS-1$\r
- private static final String PROP_USER_SOURCE = "Pkg.UserSrc"; //$NON-NLS-1$\r
+ private static final String PROP_REVISION = "Pkg.Revision"; //$NON-NLS-1$\r
+ private static final String PROP_LICENSE = "Pkg.License"; //$NON-NLS-1$\r
+ private static final String PROP_DESC = "Pkg.Desc"; //$NON-NLS-1$\r
+ private static final String PROP_DESC_URL = "Pkg.DescUrl"; //$NON-NLS-1$\r
+ private static final String PROP_RELEASE_NOTE = "Pkg.RelNote"; //$NON-NLS-1$\r
+ private static final String PROP_RELEASE_URL = "Pkg.RelNoteUrl"; //$NON-NLS-1$\r
+ private static final String PROP_SOURCE_URL = "Pkg.SourceUrl"; //$NON-NLS-1$\r
+ private static final String PROP_USER_SOURCE = "Pkg.UserSrc"; //$NON-NLS-1$\r
private final int mRevision;\r
private final String mLicense;\r
private final String mDescription;\r
private final String mDescUrl;\r
+ private final String mReleaseNote;\r
+ private final String mReleaseUrl;\r
private final Archive[] mArchives;\r
private final RepoSource mSource;\r
\r
mRevision = XmlParserUtils.getXmlInt (packageNode, SdkRepository.NODE_REVISION, 0);\r
mDescription = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_DESCRIPTION);\r
mDescUrl = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_DESC_URL);\r
+ mReleaseNote = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_RELEASE_NOTE);\r
+ mReleaseUrl = XmlParserUtils.getXmlString(packageNode, SdkRepository.NODE_RELEASE_URL);\r
\r
mLicense = parseLicense(packageNode, licenses);\r
mArchives = parseArchives(XmlParserUtils.getFirstChild(\r
Arch archiveArch,\r
String archiveOsPath) {\r
\r
+ if (description == null) {\r
+ description = "";\r
+ }\r
+ if (descUrl == null) {\r
+ descUrl = "";\r
+ }\r
+\r
mRevision = Integer.parseInt(getProperty(props, PROP_REVISION, Integer.toString(revision)));\r
- mLicense = getProperty(props, PROP_LICENSE, license);\r
- mDescription = getProperty(props, PROP_DESC, description);\r
- mDescUrl = getProperty(props, PROP_DESC_URL, descUrl);\r
+ mLicense = getProperty(props, PROP_LICENSE, license);\r
+ mDescription = getProperty(props, PROP_DESC, description);\r
+ mDescUrl = getProperty(props, PROP_DESC_URL, descUrl);\r
+ mReleaseNote = getProperty(props, PROP_RELEASE_NOTE, "");\r
+ mReleaseUrl = getProperty(props, PROP_RELEASE_URL, "");\r
\r
// If source is null and we can find a source URL in the properties, generate\r
// a dummy source just to store the URL. This allows us to easily remember where\r
*/\r
void saveProperties(Properties props) {\r
props.setProperty(PROP_REVISION, Integer.toString(mRevision));\r
- if (mLicense != null) {\r
+ if (mLicense != null && mLicense.length() > 0) {\r
props.setProperty(PROP_LICENSE, mLicense);\r
}\r
- if (mDescription != null) {\r
+\r
+ if (mDescription != null && mDescription.length() > 0) {\r
props.setProperty(PROP_DESC, mDescription);\r
}\r
- if (mDescUrl != null) {\r
+ if (mDescUrl != null && mDescUrl.length() > 0) {\r
props.setProperty(PROP_DESC_URL, mDescUrl);\r
}\r
\r
+ if (mReleaseNote != null && mReleaseNote.length() > 0) {\r
+ props.setProperty(PROP_RELEASE_NOTE, mReleaseNote);\r
+ }\r
+ if (mReleaseUrl != null && mReleaseUrl.length() > 0) {\r
+ props.setProperty(PROP_RELEASE_URL, mReleaseUrl);\r
+ }\r
+\r
if (mSource != null) {\r
props.setProperty(PROP_SOURCE_URL, mSource.getUrl());\r
props.setProperty(PROP_USER_SOURCE, Boolean.toString(mSource.isUserSource()));\r
}\r
\r
/**\r
+ * Returns the optional release note for all packages (platform, add-on, tool, doc) or\r
+ * for a lib. Can be empty but not null.\r
+ */\r
+ public String getReleaseNote() {\r
+ return mReleaseNote;\r
+ }\r
+\r
+ /**\r
+ * Returns the optional release note URL for all packages (platform, add-on, tool, doc).\r
+ * Can be empty but not null.\r
+ */\r
+ public String getReleaseNoteUrl() {\r
+ return mReleaseUrl;\r
+ }\r
+\r
+ /**\r
* Returns the archives defined in this package.\r
* Can be an empty array but not null.\r
*/\r
* Can be empty but not null.\r
*/\r
public String getLongDescription() {\r
- return String.format("%1$s\nRevision %2$d", getDescription(), getRevision());\r
+ StringBuilder sb = new StringBuilder();\r
+\r
+ String s = getDescription();\r
+ if (s != null) {\r
+ sb.append(s);\r
+ }\r
+\r
+ sb.append(String.format("\nRevision %1$d", getRevision()));\r
+\r
+ s = getDescUrl();\r
+ if (s != null && s.length() > 0) {\r
+ sb.append(String.format("\n\nMore information at %1$s", s));\r
+ }\r
+\r
+ s = getReleaseNote();\r
+ if (s != null && s.length() > 0) {\r
+ sb.append("\n\nRelease note:\n").append(s);\r
+ }\r
+\r
+ s = getReleaseNoteUrl();\r
+ if (s != null && s.length() > 0) {\r
+ sb.append("\nRelease note URL: ").append(s);\r
+ }\r
+\r
+ return sb.toString();\r
}\r
\r
/**\r
/** The optional uses-license for all packages (platform, add-on, tool, doc) or for a lib. */\r
public static final String NODE_USES_LICENSE = "uses-license"; //$NON-NLS-1$\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
+ public static final String NODE_REVISION = "revision"; //$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
+ public static final String NODE_DESCRIPTION = "description"; //$NON-NLS-1$\r
/** The optional description URL for all packages (platform, add-on, tool, doc). */\r
- public static final String NODE_DESC_URL = "desc-url"; //$NON-NLS-1$\r
+ public static final String NODE_DESC_URL = "desc-url"; //$NON-NLS-1$\r
+ /** The optional release note for all packages (platform, add-on, tool, doc). */\r
+ public static final String NODE_RELEASE_NOTE = "release-note"; //$NON-NLS-1$\r
+ /** The optional release note URL for all packages (platform, add-on, tool, doc). */\r
+ public static final String NODE_RELEASE_URL = "release-url"; //$NON-NLS-1$\r
\r
/** The version, a string, for platform packages. */\r
public static final String NODE_VERSION = "version"; //$NON-NLS-1$\r
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<xsd:element name="desc-url" type="xsd:token" minOccurs="0" />
+ <!-- The optional release note for this package. -->
+ <xsd:element name="release-note" type="xsd:string" minOccurs="0" />
+ <!-- The optional release note URL of this package -->
+ <xsd:element name="release-url" type="xsd:token" minOccurs="0" />
<!-- A list of file archives for this package. -->
<xsd:element name="archives" type="sdk:archivesType" />
</xsd:all>
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<xsd:element name="desc-url" type="xsd:token" minOccurs="0" />
+ <!-- The optional release note for this package. -->
+ <xsd:element name="release-note" type="xsd:string" minOccurs="0" />
+ <!-- The optional release note URL of this package -->
+ <xsd:element name="release-url" type="xsd:token" minOccurs="0" />
<!-- A list of file archives for this package. -->
<xsd:element name="archives" type="sdk:archivesType" />
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<xsd:element name="desc-url" type="xsd:token" minOccurs="0" />
+ <!-- The optional release note for this package. -->
+ <xsd:element name="release-note" type="xsd:string" minOccurs="0" />
+ <!-- The optional release note URL of this package -->
+ <xsd:element name="release-url" type="xsd:token" minOccurs="0" />
<!-- A list of file archives for this package. -->
<xsd:element name="archives" type="sdk:archivesType" />
</xsd:all>
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<xsd:element name="desc-url" type="xsd:token" minOccurs="0" />
+ <!-- The optional release note for this package. -->
+ <xsd:element name="release-note" type="xsd:string" minOccurs="0" />
+ <!-- The optional release note URL of this package -->
+ <xsd:element name="release-url" type="xsd:token" minOccurs="0" />
<!-- A list of file archives for this package. -->
<xsd:element name="archives" type="sdk:archivesType" />
</xsd:all>
<xsd:element name="description" type="xsd:string" minOccurs="0" />
<!-- The optional description URL of this package -->
<xsd:element name="desc-url" type="xsd:token" minOccurs="0" />
+ <!-- The optional release note for this package. -->
+ <xsd:element name="release-note" type="xsd:string" minOccurs="0" />
+ <!-- The optional release note URL of this package -->
+ <xsd:element name="release-url" type="xsd:token" minOccurs="0" />
<!-- A list of file archives for this package. -->
<xsd:element name="archives" type="sdk:archivesType" />
</xsd:all>