/** * Checks whether the {@link RepoManager} needs to have its local and remote packages cache * reset and invalidates them if they do. */ private void checkNeedsCacheReset(RepoManager repoManager, SdkLibData sdkLibData) { if (sdkLibData.needsCacheReset()) { repoManager.markInvalid(); sdkLibData.setNeedsCacheReset(false); } }
public static SdkLibData dontDownload() { return new SdkLibData(); }
mSdkHandler.getLatestLocalPackageForPrefix(packageId, true, progress); if (localSdkToolPackage == null) { if (!sdkLibData.useSdkDownload()) { RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, progress, sdkLibData.getDownloader(), sdkLibData.getSettings()); ImmutableList.of(sdkToolPackage), repoManager, sdkLibData.getDownloader(), getNewDownloadProgress());
allArtifacts = configuration.getResolvedConfiguration().getResolvedArtifacts(); } else { if (!repositoriesUpdated && sdkLibData.useSdkDownload()) { List<String> repositoryPaths = new ArrayList<>(); sdkLibData.setNeedsCacheReset(sdkHandler.checkResetCache()); List<File> updatedRepositories = sdkHandler.getSdkLoader() .updateRepositories(repositoryPaths, sdkLibData, logger);
/** * This method checks if the cache of the local and remote repositories has been already reset * this build. */ public boolean checkResetCache() { return sdkLibData.needsCacheReset(); } }
RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, new LoggerProgressIndicatorWrapper(logger), sdkLibData.getDownloader(), sdkLibData.getSettings()); artifactPackages, repoManager, sdkLibData.getDownloader(), progress)); repositoriesBuilder.add(new File( mSdkLocation + ImmutableList.of(googleRepositoryPackage.getRemote()), repoManager, sdkLibData.getDownloader(), progress)); ImmutableList.of(androidRepositoryPackage.getRemote()), repoManager, sdkLibData.getDownloader(), progress));
private final ILogger logger; private final SdkHandler sdkHandler; private SdkLibData sdkLibData = SdkLibData.dontDownload(); private boolean repositoriesUpdated = false;
mSdkHandler.getBuildToolInfo(buildToolRevision, progress); if (sdkLibData.useSdkDownload()) { SettingsController settings = sdkLibData.getSettings(); Downloader downloader = sdkLibData.getDownloader(); Preconditions.checkNotNull(settings); Preconditions.checkNotNull(downloader);
public static SdkLibData download( @NonNull Downloader downloader, @NonNull SettingsController settings){ return new SdkLibData(downloader, settings); }