SDK Manager: display packages revisions

This changes the short description of all the package types
to display the revision.

It also changes the long description to be "whatever" is in the
XML; if there's nothing in the xml, use the short description.
Also appends the requirements for addon/platform and min-tools-rev.

I will address the packaging script to put proper descriptions
when generating the XML.

SDK BUG 2136068

Change-Id: Iaca7692f048f7f63111c2fe1f25c5588f0fc2099
This commit is contained in:
Raphael
2009-10-09 18:17:21 -07:00
parent e7ad6a5e40
commit e4c98c0191
4 changed files with 75 additions and 36 deletions

View File

@@ -189,18 +189,29 @@ public class AddonPackage extends Package {
/** Returns a short description for an {@link IDescription}. */ /** Returns a short description for an {@link IDescription}. */
@Override @Override
public String getShortDescription() { public String getShortDescription() {
return String.format("%1$s by %2$s for Android API %3$s", return String.format("%1$s by %2$s, Android API %3$s, revision %4$s",
getName(), getName(),
getVendor(), getVendor(),
mVersion.getApiString()); mVersion.getApiString(),
getRevision());
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
return String.format("%1$s,\nRevision %2$d.", String s = getDescription();
getShortDescription(), if (s == null || s.length() == 0) {
getRevision()); s = getShortDescription();
}
s += String.format(".\nRequires SDK Platform Android API %1$s.",
mVersion.getApiString());
return s;
} }
/** /**

View File

@@ -103,21 +103,34 @@ public class DocPackage extends Package {
@Override @Override
public String getShortDescription() { public String getShortDescription() {
if (mVersion.isPreview()) { if (mVersion.isPreview()) {
return String.format("Documentation for Android '%1$s' Preview SDK", return String.format("Documentation for Android '%1$s' Preview SDK, revision %2$s",
mVersion.getCodename()); mVersion.getCodename(),
} else if (mVersion.getApiLevel() != 0) { getRevision());
return String.format("Documentation for Android SDK, API %1$d", mVersion.getApiLevel());
} else { } else {
return String.format("Documentation for Android SDK"); return String.format("Documentation for Android SDK, API %1$d, revision %2$s",
mVersion.getApiLevel(),
getRevision());
} }
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
return String.format("%1$s,\nRevision %2$d.", String s = getDescription();
getShortDescription(), if (s == null || s.length() == 0) {
getRevision()); s = getShortDescription();
}
if (!s.endsWith(".")) {
s += ".";
}
return s;
} }
/** /**

View File

@@ -152,25 +152,27 @@ public class ExtraPackage extends MinToolsPackage {
name, name,
getRevision()); getRevision());
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
s += String.format(" (tools rev: %1$d)", getMinToolsRevision());
}
return s; return s;
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
String s = String.format("Extra %1$s package, revision %2$d", String s = getDescription();
if (s == null || s.length() == 0) {
s = String.format("Extra %1$s package, revision %2$d",
getPath(), getPath(),
getRevision()); getRevision());
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
s += String.format(" (min tools rev.: %1$d)", getMinToolsRevision());
} }
s += "."; if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
s += String.format(".\nRequires tools revision %1$d.", getMinToolsRevision());
}
return s; return s;
} }

View File

@@ -119,24 +119,37 @@ public class PlatformPackage extends MinToolsPackage {
String s; String s;
if (mVersion.isPreview()) { if (mVersion.isPreview()) {
s = String.format("SDK Platform Android %1$s (Preview)", getVersionName()); s = String.format("SDK Platform Android %1$s Preview, revision %2$s",
} else {
s = String.format("SDK Platform Android %1$s, API %2$d",
getVersionName(), getVersionName(),
mVersion.getApiLevel()); getRevision());
} } else {
s = String.format("SDK Platform Android %1$s, API %2$d, revision %3$s",
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) { getVersionName(),
s += String.format(" (tools rev: %1$d)", getMinToolsRevision()); mVersion.getApiLevel(),
getRevision());
} }
return s; return s;
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
return getShortDescription() + "."; String s = getDescription();
if (s == null || s.length() == 0) {
s = getShortDescription();
}
if (!s.endsWith(".")) {
s += ".";
}
return s;
} }
/** /**