/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } return String.format("Android SDK Tools, revision %1$s%2$s", revision.toShortString(), obsolete ? " (Obsolete)" : ""); }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } return String.format("Android SDK Build-tools, revision %1$s%2$s", revision.toShortString(), obsolete ? " (Obsolete)" : ""); } }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } return String .format("Android SDK Platform-tools, revision %1$s%2$s", revision.toShortString(), obsolete ? " (Obsolete)" : ""); }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, String displayName, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } String s = String.format("%1$s, revision %2$s%3$s", displayName, revision.toShortString(), obsolete ? " (Obsolete)" : ""); //$NON-NLS-2$ return s; }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, String displayName, AndroidVersion version, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } return String.format("%1$s, Android API %2$s, revision %3$s%4$s", displayName, version.getApiString(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, AndroidVersion version, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } String s = String .format("Samples for SDK API %1$s%2$s, revision %3$s%4$s", version.getApiString(), version.isPreview() ? " Preview" : "", revision.toShortString(), obsolete ? " (Obsolete)" : ""); return s; } }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, AndroidVersion version, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } if (version.isPreview()) { return String .format("Documentation for Android '%1$s' Preview SDK, revision %2$s%3$s", version.getCodename(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); } else { return String .format("Documentation for Android SDK, API %1$d, revision %2$s%3$s", version.getApiLevel(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); } }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, String versionName, AndroidVersion version, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } String s; if (version.isPreview()) { s = String.format("SDK Platform Android %1$s Preview, revision %2$s%3$s", versionName, revision.toShortString(), obsolete ? " (Obsolete)" : ""); //$NON-NLS-2$ } else { s = String .format("SDK Platform Android %1$s, API %2$d, revision %3$s%4$s", versionName, version.getApiLevel(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); //$NON-NLS-2$ } return s; }
/** * Returns a short description for an {@link IDescription}. */ private static String createShortDescription(String listDisplay, Revision revision, AndroidVersion version, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, revision %2$s%3$s", listDisplay, revision.toShortString(), obsolete ? " (Obsolete)" : ""); } if (version.isPreview()) { return String .format("Sources for Android '%1$s' Preview SDK, revision %2$s%3$s", version.getCodename(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); } else { return String.format("Sources for Android SDK, API %1$d, revision %2$s%3$s", version.getApiLevel(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); } }
public void saveProperties(Properties props) { if (!getMinToolsRevision().equals(MIN_TOOLS_REV_NOT_SPECIFIED)) { props.setProperty(PkgProps.MIN_TOOLS_REV, getMinToolsRevision().toShortString()); } }
public static String createShortDescription(String listDisplay, String abi, IdDisplay vendor, IdDisplay tag, AndroidVersion version, Revision revision, boolean obsolete) { if (!listDisplay.isEmpty()) { return String.format("%1$s, %2$s API %3$s, revision %4$s%5$s", listDisplay, vendor == null ? "Android" : vendor.getDisplay(), version.getApiString(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); } boolean isDefaultTag = SystemImage.DEFAULT_TAG.equals(tag); return String.format("%1$s%2$s System Image, %3$s API %4$s, revision %5$s%6$s", isDefaultTag ? "" : (tag.getDisplay() + " "), getAbiDisplayNameInternal(abi), vendor == null ? "Android" : vendor.getDisplay(), version.getApiString(), revision.toShortString(), obsolete ? " (Obsolete)" : ""); }
/** * Save this {@link ArchFilter} attributes into the the given {@link Properties} object. These * properties can later be given to the constructor that takes a {@link Properties} object. <p> * Null attributes are not saved in the properties. * * @param props A non-null properties object to fill with non-null attributes. */ void saveProperties(@NonNull Properties props) { if (mHostOs != null) { props.setProperty(PROP_HOST_OS, mHostOs.getXmlName()); } if (mHostBits != null) { props.setProperty(PROP_HOST_BITS, mHostBits.getXmlName()); } if (mJvmBits != null) { props.setProperty(PROP_JVM_BITS, mJvmBits.getXmlName()); } if (mMinJvmVersion != null) { props.setProperty(PROP_MIN_JVM_VERSION, mMinJvmVersion.toShortString()); } }
.replace("$MAJ", getRevision().toShortString()); result = result .replace("$FULL", getRevision().toShortString()); result = result .replace("$API", hasAndroidVersion() ? getAndroidVersion().getApiString() : "");
message = String.format("Upgrade `buildToolsVersion` from " + "`%1$s` to at least `23.0.1`; if not, ", buildTools.toShortString()) + Character.toLowerCase(message.charAt(0)) + message.substring(1);
@VisibleForTesting @Nullable static String getPlatformVersion(@NonNull LintClient client) { AndroidSdkHandler sdk = client.getSdk(); if (sdk != null) { LocalPackage pkgInfo = sdk .getLocalPackage(SdkConstants.FD_PLATFORM_TOOLS, client.getRepositoryLogger()); if (pkgInfo != null) { return pkgInfo.getVersion().toShortString(); } } return null; }
@VisibleForTesting @Nullable static String getPlatformVersion(@NonNull LintClient client) { AndroidSdkHandler sdk = client.getSdk(); if (sdk != null) { LocalPackage pkgInfo = sdk .getLocalPackage(SdkConstants.FD_PLATFORM_TOOLS, client.getRepositoryLogger()); if (pkgInfo != null) { return pkgInfo.getVersion().toShortString(); } } return null; }
String.format("The SDK platform-tools version (%1$s) is too old " + " to check APIs compiled with API %2$d; please update", revision.toShortString(), compileSdkVersion));