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:
@@ -189,18 +189,29 @@ public class AddonPackage extends Package {
|
||||
/** Returns a short description for an {@link IDescription}. */
|
||||
@Override
|
||||
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(),
|
||||
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
|
||||
public String getLongDescription() {
|
||||
return String.format("%1$s,\nRevision %2$d.",
|
||||
getShortDescription(),
|
||||
getRevision());
|
||||
String s = getDescription();
|
||||
if (s == null || s.length() == 0) {
|
||||
s = getShortDescription();
|
||||
}
|
||||
|
||||
s += String.format(".\nRequires SDK Platform Android API %1$s.",
|
||||
mVersion.getApiString());
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -103,21 +103,34 @@ public class DocPackage extends Package {
|
||||
@Override
|
||||
public String getShortDescription() {
|
||||
if (mVersion.isPreview()) {
|
||||
return String.format("Documentation for Android '%1$s' Preview SDK",
|
||||
mVersion.getCodename());
|
||||
} else if (mVersion.getApiLevel() != 0) {
|
||||
return String.format("Documentation for Android SDK, API %1$d", mVersion.getApiLevel());
|
||||
return String.format("Documentation for Android '%1$s' Preview SDK, revision %2$s",
|
||||
mVersion.getCodename(),
|
||||
getRevision());
|
||||
} 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
|
||||
public String getLongDescription() {
|
||||
return String.format("%1$s,\nRevision %2$d.",
|
||||
getShortDescription(),
|
||||
getRevision());
|
||||
String s = getDescription();
|
||||
if (s == null || s.length() == 0) {
|
||||
s = getShortDescription();
|
||||
}
|
||||
|
||||
if (!s.endsWith(".")) {
|
||||
s += ".";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -152,25 +152,27 @@ public class ExtraPackage extends MinToolsPackage {
|
||||
name,
|
||||
getRevision());
|
||||
|
||||
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
|
||||
s += String.format(" (tools rev: %1$d)", getMinToolsRevision());
|
||||
}
|
||||
|
||||
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
|
||||
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(),
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -119,24 +119,37 @@ public class PlatformPackage extends MinToolsPackage {
|
||||
String s;
|
||||
|
||||
if (mVersion.isPreview()) {
|
||||
s = String.format("SDK Platform Android %1$s (Preview)", getVersionName());
|
||||
} else {
|
||||
s = String.format("SDK Platform Android %1$s, API %2$d",
|
||||
s = String.format("SDK Platform Android %1$s Preview, revision %2$s",
|
||||
getVersionName(),
|
||||
mVersion.getApiLevel());
|
||||
}
|
||||
|
||||
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
|
||||
s += String.format(" (tools rev: %1$d)", getMinToolsRevision());
|
||||
getRevision());
|
||||
} else {
|
||||
s = String.format("SDK Platform Android %1$s, API %2$d, revision %3$s",
|
||||
getVersionName(),
|
||||
mVersion.getApiLevel(),
|
||||
getRevision());
|
||||
}
|
||||
|
||||
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
|
||||
public String getLongDescription() {
|
||||
return getShortDescription() + ".";
|
||||
String s = getDescription();
|
||||
if (s == null || s.length() == 0) {
|
||||
s = getShortDescription();
|
||||
}
|
||||
|
||||
if (!s.endsWith(".")) {
|
||||
s += ".";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user