@NonNull @Override public ProgressIndicator getRepositoryLogger() { return mDelegate.getRepositoryLogger(); }
/** * Returns all the {@link IAndroidTarget} versions installed in the user's SDK install * area. * * @return all the installed targets */ @NonNull public IAndroidTarget[] getTargets() { if (targets == null) { AndroidSdkHandler sdkHandler = getSdk(); if (sdkHandler != null) { ProgressIndicator logger = getRepositoryLogger(); Collection<IAndroidTarget> targets = sdkHandler.getAndroidTargetManager(logger) .getTargets(logger); this.targets = targets.toArray(new IAndroidTarget[targets.size()]); } else { targets = new IAndroidTarget[0]; } } return targets; }
@NonNull private static GradleCoordinate getLatestVersion(@NonNull XmlContext context) { GradleCoordinate latestAvailable = LATEST_KNOWN_VERSION; AndroidSdkHandler sdkHandler = context.getClient().getSdk(); if (sdkHandler != null) { ProgressIndicator progress = context.getClient().getRepositoryLogger(); RepoPackage latestPackage = SdkMavenRepository .findLatestVersion(LATEST_KNOWN_VERSION, sdkHandler, progress); if (latestPackage != null) { GradleCoordinate fromPackage = SdkMavenRepository .getCoordinateFromSdkPath(latestPackage.getPath()); if (fromPackage != null && COMPARE_PLUS_LOWER.compare(latestAvailable, fromPackage) < 0) { latestAvailable = fromPackage; } } } return latestAvailable; }
@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; }
/** * Returns the specific version of the build tools being used for the given project, if known * * @param project the project in question * * @return the build tools version in use by the project, or null if not known */ @Nullable public BuildToolInfo getBuildTools(@NonNull Project project) { AndroidSdkHandler sdk = getSdk(); // Build systems like Eclipse and ant just use the latest available // build tools, regardless of project metadata. In Gradle, this // method is overridden to use the actual build tools specified in the // project. if (sdk != null) { IAndroidTarget compileTarget = getCompileTarget(project); if (compileTarget != null) { return compileTarget.getBuildToolInfo(); } return sdk.getLatestBuildTool(getRepositoryLogger(), false); } return null; }
context.getClient().getRepositoryLogger()); if (pkgInfo == null) { return;