use of com.android.ide.common.repository.GradleCoordinate in project android by JetBrains.
the class RepositoryUrlManagerTest method testResolvedCoordinate_sdkMissing.
public void testResolvedCoordinate_sdkMissing() throws Exception {
myFileOp.deleteFileOrFolder(SDK_DIR);
GradleCoordinate coordinate = GradleCoordinate.parseCoordinateString("com.google.android.gms:play-services:4.+");
assertNull(resolveDynamicCoordinateVersion(coordinate));
}
use of com.android.ide.common.repository.GradleCoordinate 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));
}
use of com.android.ide.common.repository.GradleCoordinate in project android by JetBrains.
the class RepositoryUrlManagerTest method testResolvedCoordinate.
public void testResolvedCoordinate() throws Exception {
GradleCoordinate coordinate = GradleCoordinate.parseCoordinateString("com.google.android.gms:play-services:4.+");
assertNotNull(coordinate);
assertEquals("4.4.52", resolveDynamicCoordinateVersion(coordinate));
assertEquals(GradleCoordinate.parseCoordinateString("com.google.android.gms:play-services:4.4.52"), resolveDynamicCoordinate(coordinate));
coordinate = GradleCoordinate.parseCoordinateString("com.google.android.gms:play-services:4.+@aar");
assertNotNull(coordinate);
assertEquals("4.4.52", resolveDynamicCoordinateVersion(coordinate));
assertEquals(GradleCoordinate.parseCoordinateString("com.google.android.gms:play-services:4.4.52@aar"), resolveDynamicCoordinate(coordinate));
coordinate = GradleCoordinate.parseCoordinateString("com.android.support:support-v4:+");
assertNotNull(coordinate);
assertEquals("21.0.2", resolveDynamicCoordinateVersion(coordinate));
// Make sure already resolved coordinates are handled correctly
coordinate = GradleCoordinate.parseCoordinateString("com.android.support:support-v4:1.2.3");
assertNotNull(coordinate);
assertEquals("1.2.3", resolveDynamicCoordinateVersion(coordinate));
coordinate = GradleCoordinate.parseCoordinateString("my.group.id:my.bogus.artifact:+");
assertNotNull(coordinate);
assertNull(resolveDynamicCoordinateVersion(coordinate));
}
use of com.android.ide.common.repository.GradleCoordinate in project android by JetBrains.
the class DependencyManager method checkForNewMissingDependencies.
private boolean checkForNewMissingDependencies() {
Set<String> missing = Collections.emptySet();
if (myModule != null) {
GradleDependencyManager manager = GradleDependencyManager.getInstance(myProject);
List<GradleCoordinate> coordinates = toGradleCoordinatesFromIds(myPalette.getGradleCoordinateIds());
missing = fromGradleCoordinatesToIds(manager.findMissingDependencies(myModule, coordinates));
if (myMissingLibraries.equals(missing)) {
return false;
}
}
myMissingLibraries.clear();
myMissingLibraries.addAll(missing);
return true;
}
use of com.android.ide.common.repository.GradleCoordinate in project android by JetBrains.
the class NlOldPalettePanel method checkForNewMissingDependencies.
private boolean checkForNewMissingDependencies() {
Module module = getModule();
List<String> missing = Collections.emptyList();
if (module != null) {
GradleDependencyManager manager = GradleDependencyManager.getInstance(myProject);
Palette palette = myModel.getPalette(myDesignSurface.getLayoutType());
List<GradleCoordinate> dependencies = toGradleCoordinates(palette.getGradleCoordinateIds());
missing = fromGradleCoordinates(manager.findMissingDependencies(module, dependencies));
if (missing.size() == myMissingLibraries.size() && myMissingLibraries.containsAll(missing)) {
return false;
}
}
myMissingLibraries.clear();
myMissingLibraries.addAll(missing);
return true;
}
Aggregations