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}. */
|
/** 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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();
|
||||||
getPath(),
|
if (s == null || s.length() == 0) {
|
||||||
getRevision());
|
s = String.format("Extra %1$s package, revision %2$d",
|
||||||
|
getPath(),
|
||||||
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
|
getRevision());
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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",
|
||||||
|
getVersionName(),
|
||||||
|
getRevision());
|
||||||
} else {
|
} else {
|
||||||
s = String.format("SDK Platform Android %1$s, API %2$d",
|
s = String.format("SDK Platform Android %1$s, API %2$d, revision %3$s",
|
||||||
getVersionName(),
|
getVersionName(),
|
||||||
mVersion.getApiLevel());
|
mVersion.getApiLevel(),
|
||||||
}
|
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() {
|
||||||
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