@Override @Nullable public File getSdkHome() { return mDelegate.getSdkHome(); }
/** * Locates an SDK resource (relative to the SDK root directory). * <p> * TODO: Consider switching to a {@link URL} return type instead. * * @param relativePath A relative path (using {@link File#separator} to * separate path components) to the given resource * @return a {@link File} pointing to the resource, or null if it does not * exist */ @Nullable public File findResource(@NonNull String relativePath) { File top = getSdkHome(); if (top == null) { throw new IllegalArgumentException("Lint must be invoked with the System property " + PROP_BIN_DIR + " pointing to the ANDROID_SDK tools directory"); } File file = new File(top, relativePath); if (file.exists()) { return file; } else { return null; } }
/** * Returns the SDK installation (used to look up platforms etc) * * @return the SDK if known */ @Nullable public AndroidSdkHandler getSdk() { if (sdk == null) { File sdkHome = getSdkHome(); if (sdkHome != null) { sdk = AndroidSdkHandler.getInstance(sdkHome); } } return sdk; }
File sdkHome = client.getSdkHome(); if (sdkHome != null) { File[] dirs = new File(sdkHome, FD_BUILD_TOOLS).listFiles();
File sdkHome = client.getSdkHome(); if (sdkHome != null) { File[] dirs = new File(sdkHome, FD_BUILD_TOOLS).listFiles();
private void checkPlayServices(Context context, GradleCoordinate dependency, Object cookie) { String groupId = dependency.getGroupId(); String artifactId = dependency.getArtifactId(); assert groupId != null && artifactId != null; File sdkHome = context.getClient().getSdkHome(); File repository = SdkMavenRepository.GOOGLE.getRepositoryLocation(sdkHome, true); if (repository == null) { report(context, cookie, DEPENDENCY, "Dependency on Play Services, but the SDK installation does not " + "have the \"Extras > Google Repository\" installed. " + "Open the SDK manager and install it."); } else { checkLocalMavenVersions(context, dependency, cookie, groupId, artifactId, repository); } }
assert groupId != null && artifactId != null; File sdkHome = context.getClient().getSdkHome(); File repository = SdkMavenRepository.GOOGLE.getRepositoryLocation(sdkHome, true, FileOpUtils.create());
File sdkHome = context.getClient().getSdkHome(); FileOp fileOp = FileOpUtils.create(); File repository =
private void checkSupportLibraries(Context context, GradleCoordinate dependency, Object cookie) { String groupId = dependency.getGroupId(); String artifactId = dependency.getArtifactId(); assert groupId != null && artifactId != null; // See if the support library version is lower than the targetSdkVersion if (mTargetSdkVersion > 0 && dependency.getMajorVersion() < mTargetSdkVersion && dependency.getMajorVersion() != GradleCoordinate.PLUS_REV_VALUE && // The multidex library doesn't follow normal supportlib numbering scheme !dependency.getArtifactId().startsWith("multidex") && context.isEnabled(COMPATIBILITY)) { String message = "This support library should not use a lower version (" + dependency.getMajorVersion() + ") than the `targetSdkVersion` (" + mTargetSdkVersion + ")"; report(context, cookie, COMPATIBILITY, message); } // Check to make sure you have the Android support repository installed File sdkHome = context.getClient().getSdkHome(); File repository = SdkMavenRepository.ANDROID.getRepositoryLocation(sdkHome, true); if (repository == null) { report(context, cookie, DEPENDENCY, "Dependency on a support library, but the SDK installation does not " + "have the \"Extras > Android Support Repository\" installed. " + "Open the SDK manager and install it."); } else { checkLocalMavenVersions(context, dependency, cookie, groupId, artifactId, repository); } }
File sdkHome = context.getClient().getSdkHome(); File repository = SdkMavenRepository.ANDROID.getRepositoryLocation(sdkHome, true, FileOpUtils.create());
File sdkHome = context.getClient().getSdkHome(); File repository = SdkMavenRepository.GOOGLE.getRepositoryLocation(sdkHome, true); if (repository != null) {
File sdkHome = context.getClient().getSdkHome(); File repository = SdkMavenRepository.GOOGLE.getRepositoryLocation(sdkHome, true, FileOpUtils.create());