use of com.android.repository.api.RepoManager in project android by JetBrains.
the class RepositoryUrlManagerTest method testResolvedCoordinateRemoteSdk.
public void testResolvedCoordinateRemoteSdk() throws Exception {
RemotePackage pkg = new FakePackage.FakeRemotePackage("extras;m2repository;com;google;android;gms;play-services;4.5.0");
RepositoryPackages pkgs = new RepositoryPackages(ImmutableList.of(), ImmutableList.of(pkg));
RepoManager mgr = new FakeRepoManager(pkgs);
mySdkHandler = new AndroidSdkHandler(new File("/emptysdk"), ANDROID_HOME, myFileOp, mgr);
GradleCoordinate coordinate = GradleCoordinate.parseCoordinateString("com.google.android.gms:play-services:4.+");
assertNotNull(coordinate);
assertEquals("4.5.0", resolveDynamicCoordinateVersion(coordinate));
}
use of com.android.repository.api.RepoManager in project android by JetBrains.
the class StudioSdkUtil method reloadRemoteSdkWithModalProgress.
/**
* Convenience method to reload the local and remote SDK, showing a modal, non-cancellable progress window.
*/
public static void reloadRemoteSdkWithModalProgress() {
final AndroidSdkHandler sdkHandler = AndroidSdks.getInstance().tryToChooseSdkHandler();
StudioProgressRunner runner = new StudioProgressRunner(true, false, "Refreshing SDK", false, null);
StudioLoggerProgressIndicator progress = new StudioLoggerProgressIndicator(StudioSdkUtil.class);
RepoManager sdkManager = sdkHandler.getSdkManager(progress);
sdkManager.load(RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, null, null, null, runner, new StudioDownloader(null), StudioSettingsController.getInstance(), true);
}
use of com.android.repository.api.RepoManager in project android by JetBrains.
the class AvdWizardUtilsTest method createMockSdk.
@NotNull
private static AndroidSdkHandler createMockSdk(String versionString, String path) {
FakeLocalPackage p = new FakeLocalPackage(path);
p.setRevision(Revision.parseRevision(versionString));
RepositoryPackages packages = new RepositoryPackages();
packages.setLocalPkgInfos(ImmutableList.of(p));
RepoManager mgr = new FakeRepoManager(null, packages);
return new AndroidSdkHandler(null, null, new MockFileOp(), mgr);
}
use of com.android.repository.api.RepoManager in project android by JetBrains.
the class SdkMergerTest method getSdkFingerprint.
private String getSdkFingerprint(File sdk) {
StringBuilder s = new StringBuilder();
RepoManager sdkManager = AndroidSdkHandler.getInstance(sdk).getSdkManager(new StudioLoggerProgressIndicator(getClass()));
for (LocalPackage p : Sets.newTreeSet(sdkManager.getPackages().getLocalPackages().values())) {
s.append(p.getPath());
s.append(',');
s.append(p.getVersion());
s.append('\n');
}
return s.toString();
}
use of com.android.repository.api.RepoManager in project android by JetBrains.
the class RepositoryUrlManagerTest method testResolvedCoordinateLocalFirst.
public void testResolvedCoordinateLocalFirst() throws Exception {
RemotePackage pkg = new FakePackage.FakeRemotePackage("extras;m2repository;com;google;android;gms;play-services;4.5.0");
RepositoryPackages pkgs = new RepositoryPackages(ImmutableList.of(), ImmutableList.of(pkg));
RepoManager mgr = new FakeRepoManager(pkgs);
mySdkHandler = new AndroidSdkHandler(SDK_DIR, ANDROID_HOME, myFileOp, mgr);
GradleCoordinate coordinate = GradleCoordinate.parseCoordinateString("com.google.android.gms:play-services:4.+");
assertNotNull(coordinate);
assertEquals("4.4.52", resolveDynamicCoordinateVersion(coordinate));
}
Aggregations