Search in sources :

Example 6 with UpdatableExternalComponent

use of com.intellij.ide.externalComponents.UpdatableExternalComponent in project android by JetBrains.

the class SdkComponentSource method installUpdates.

/**
   * Install the given new versions of components.
   *
   * @param request The components to install.
   */
@Override
public void installUpdates(@NotNull Collection<UpdatableExternalComponent> request) {
    final List<RemotePackage> packages = Lists.newArrayList();
    for (UpdatableExternalComponent p : request) {
        packages.add((RemotePackage) p.getKey());
    }
    new UpdateInfoDialog(true, packages).show();
}
Also used : UpdatableExternalComponent(com.intellij.ide.externalComponents.UpdatableExternalComponent)

Example 7 with UpdatableExternalComponent

use of com.intellij.ide.externalComponents.UpdatableExternalComponent in project android by JetBrains.

the class SdkComponentSourceTest method validateStablePackages.

private static void validateStablePackages(Iterator<UpdatableExternalComponent> componentIter) {
    UpdatableExternalComponent c = componentIter.next();
    assertEquals("package hasPreview", c.getName());
    assertEquals(new Revision(1, 0, 0, 1), ((RepoPackage) c.getKey()).getVersion());
    c = componentIter.next();
    assertEquals("package newerPreview", c.getName());
    assertEquals(new Revision(1, 0, 0, 2), ((RepoPackage) c.getKey()).getVersion());
    c = componentIter.next();
    assertEquals("package newerRemote", c.getName());
    assertEquals(new Revision(1, 1, 0), ((RepoPackage) c.getKey()).getVersion());
    c = componentIter.next();
    assertEquals("package olderPreview", c.getName());
    assertEquals(new Revision(1, 0, 0, 1), ((RepoPackage) c.getKey()).getVersion());
    c = componentIter.next();
    assertEquals("package olderRemote", c.getName());
    assertEquals(new Revision(1, 1, 0), ((RepoPackage) c.getKey()).getVersion());
    c = componentIter.next();
    assertEquals("package onlyRemote", c.getName());
    assertEquals(new Revision(1, 0, 0), ((RepoPackage) c.getKey()).getVersion());
    c = componentIter.next();
    assertEquals("package samePreview", c.getName());
    assertEquals(new Revision(1, 0, 0, 1), ((RepoPackage) c.getKey()).getVersion());
    c = componentIter.next();
    assertEquals("package sameRemote", c.getName());
    assertEquals(new Revision(1, 0, 0), ((RepoPackage) c.getKey()).getVersion());
}
Also used : Revision(com.android.repository.Revision) UpdatableExternalComponent(com.intellij.ide.externalComponents.UpdatableExternalComponent)

Example 8 with UpdatableExternalComponent

use of com.intellij.ide.externalComponents.UpdatableExternalComponent in project android by JetBrains.

the class SdkComponentSourceTest method testAvailableBetaVersions.

public void testAvailableBetaVersions() throws Exception {
    myChannelId = 1;
    ProgressIndicator progress = new StudioProgressIndicatorAdapter(new FakeProgressIndicator(), null);
    Set<UpdatableExternalComponent> components = Sets.newTreeSet(COMPONENT_COMPARATOR);
    components.addAll(myTestComponentSource.getAvailableVersions(progress, null));
    Iterator<UpdatableExternalComponent> componentIter = components.iterator();
    validateStablePackages(componentIter);
    UpdatableExternalComponent c = componentIter.next();
    assertEquals("package zNewerInBeta", c.getName());
    assertEquals(new Revision(2, 0, 0), ((RepoPackage) c.getKey()).getVersion());
    assertFalse(componentIter.hasNext());
}
Also used : Revision(com.android.repository.Revision) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) UpdatableExternalComponent(com.intellij.ide.externalComponents.UpdatableExternalComponent) StudioProgressIndicatorAdapter(com.android.tools.idea.sdk.progress.StudioProgressIndicatorAdapter)

Aggregations

UpdatableExternalComponent (com.intellij.ide.externalComponents.UpdatableExternalComponent)8 Revision (com.android.repository.Revision)6 StudioProgressIndicatorAdapter (com.android.tools.idea.sdk.progress.StudioProgressIndicatorAdapter)5 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)5 ExternalUpdate (com.intellij.openapi.updateSettings.impl.ExternalUpdate)3 UpdateSettings (com.intellij.openapi.updateSettings.impl.UpdateSettings)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)1