public static synchronized SdkLoader getLoader( @NonNull File sdkLocation) { if (sLoader == null) { sLoader = new DefaultSdkLoader(sdkLocation); } else if (!sdkLocation.equals(sLoader.mSdkLocation)) { throw new IllegalStateException("Already created an SDK Loader with different SDK Path"); } return sLoader; }
private DefaultSdkLoader(@NonNull File sdkLocation) { mSdkLocation = sdkLocation; mRepositories = computeRepositories(); }
public synchronized void unload() { if (sdkLoader != null) { if (isRegularSdk) { DefaultSdkLoader.unload(); } else { PlatformLoader.unload(); } sdkLoader = null; } }
@NonNull ILogger logger, @NonNull SdkLibData sdkLibData) { init(logger); ProgressIndicator stdOutputProgress = getNewDownloadProgress(); IAndroidTarget target = mSdkHandler.getAndroidTargetManager(progress) .getTargetFromHashString(targetHash, progress); Map<RemotePackage, InstallResultType> installResults = new HashMap<>(); RepoManager repoManager = mSdkHandler.getSdkManager(progress); checkNeedsCacheReset(repoManager, sdkLibData); repoManager.loadSynchronously( RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, progress, downloader, settings); installBuildTools( buildToolRevision, repoManager, downloader, stdOutputProgress)); installTarget(targetHash, repoManager, downloader, stdOutputProgress)); checkResults(installResults);
ProgressIndicator progress = getNewDownloadProgress(); RepoManager repoManager = mSdkHandler.getSdkManager(progress); checkNeedsCacheReset(repoManager, sdkLibData); repoManager.loadSynchronously( RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, installResults.putAll(installRemotePackages( artifactPackages, repoManager, sdkLibData.getDownloader(), progress)); repositoriesBuilder.add(new File( checkResults(installResults); if (isInGoogleRepository(repositoryPaths)) { File googleRepo = getMavenRepoAsFile(SdkMavenRepository.GOOGLE); repositoriesBuilder.add(googleRepo); } else { installResults.putAll( installRemotePackages( ImmutableList.of(googleRepositoryPackage.getRemote()), repoManager, File googleRepo = getMavenRepoAsFile(SdkMavenRepository.GOOGLE); repositoriesBuilder.add(googleRepo); File androidRepo = getMavenRepoAsFile(SdkMavenRepository.ANDROID); repositoriesBuilder.add(androidRepo); } else { installResults.putAll(
checkNeedsCacheReset(repoManager, sdkLibData); repoManager.loadSynchronously( RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, } else { Map<RemotePackage, InstallResultType> installResults = installRemotePackages( ImmutableList.of(sdkToolPackage), repoManager, sdkLibData.getDownloader(), getNewDownloadProgress()); checkResults(installResults); repoManager.loadSynchronously(0, progress, null, null); localSdkToolPackage =
@Override @NonNull public SdkInfo getSdkInfo(@NonNull ILogger logger) { init(logger); return mSdkInfo; }
public synchronized SdkLoader getSdkLoader() { if (sdkLoader == null) { if (isRegularSdk) { getAndCheckSdkFolder(); // check if the SDK folder actually exist. // For internal test we provide a fake SDK location through // setTestSdkFolder in order to have an SDK, even though we don't use it // so in this case we ignore the check. if (sTestSdkFolder == null && !sdkFolder.isDirectory()) { throw new RuntimeException(String.format( "The SDK directory '%1$s' does not exist.", sdkFolder)); } sdkLoader = DefaultSdkLoader.getLoader(sdkFolder); } else { sdkLoader = PlatformLoader.getLoader(sdkFolder); } } return sdkLoader; }
@Override @NonNull public SdkInfo getSdkInfo(@NonNull ILogger logger) { init(logger); return mSdkInfo; }
public synchronized SdkLoader getSdkLoader() { if (sdkLoader == null) { if (isRegularSdk) { getAndCheckSdkFolder(); // check if the SDK folder actually exist. // For internal test we provide a fake SDK location through // setTestSdkFolder in order to have an SDK, even though we don't use it // so in this case we ignore the check. if (sTestSdkFolder == null && !sdkFolder.isDirectory()) { throw new RuntimeException(String.format( "The SDK directory '%1$s' does not exist.", sdkFolder)); } sdkLoader = DefaultSdkLoader.getLoader(sdkFolder); } else { sdkLoader = PlatformLoader.getLoader(sdkFolder); } } return sdkLoader; }
@Override @NonNull public TargetInfo getTargetInfo( @NonNull String targetHash, @NonNull FullRevision buildToolRevision, @NonNull ILogger logger) { init(logger); IAndroidTarget target = mSdkManager.getTargetFromHashString(targetHash); if (target == null) { throw new IllegalStateException("failed to find target with hash string '" + targetHash + "' in: " + mSdkLocation); } BuildToolInfo buildToolInfo = mSdkManager.getBuildTool(buildToolRevision); if (buildToolInfo == null) { throw new IllegalStateException("failed to find Build Tools revision " + buildToolRevision.toString()); } return new TargetInfo(target, buildToolInfo); }
private DefaultSdkLoader(@NonNull File sdkLocation) { mSdkLocation = sdkLocation; mRepositories = computeRepositories(); }
public synchronized void unload() { if (sdkLoader != null) { if (isRegularSdk) { DefaultSdkLoader.unload(); } else { PlatformLoader.unload(); } sdkLoader = null; } }
public static synchronized SdkLoader getLoader( @NonNull File sdkLocation) { if (sLoader == null) { sLoader = new DefaultSdkLoader(sdkLocation); } else if (!sdkLocation.equals(sLoader.mSdkLocation)) { throw new IllegalStateException(String.format( "%s already created using %s; cannot also use %s", DefaultSdkLoader.class.getSimpleName(), sLoader.mSdkLocation, sdkLocation)); } return sLoader; }