Search in sources :

Example 6 with GradleDependencyManager

use of com.android.tools.idea.gradle.dependencies.GradleDependencyManager 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;
}
Also used : GradleCoordinate(com.android.ide.common.repository.GradleCoordinate) GradleDependencyManager(com.android.tools.idea.gradle.dependencies.GradleDependencyManager)

Example 7 with GradleDependencyManager

use of com.android.tools.idea.gradle.dependencies.GradleDependencyManager 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;
}
Also used : GradleCoordinate(com.android.ide.common.repository.GradleCoordinate) Module(com.intellij.openapi.module.Module) GradleDependencyManager(com.android.tools.idea.gradle.dependencies.GradleDependencyManager)

Example 8 with GradleDependencyManager

use of com.android.tools.idea.gradle.dependencies.GradleDependencyManager in project android by JetBrains.

the class DependencyManager method ensureLibraryIsIncluded.

public boolean ensureLibraryIsIncluded(@NotNull Palette.Item item) {
    String coordinateId = item.getGradleCoordinateId();
    assert coordinateId != null;
    assert myModule != null;
    GradleDependencyManager manager = GradleDependencyManager.getInstance(myProject);
    return manager.ensureLibraryIsIncluded(myModule, toGradleCoordinatesFromIds(Collections.singletonList(coordinateId)), null);
}
Also used : GradleDependencyManager(com.android.tools.idea.gradle.dependencies.GradleDependencyManager)

Aggregations

GradleDependencyManager (com.android.tools.idea.gradle.dependencies.GradleDependencyManager)8 GradleCoordinate (com.android.ide.common.repository.GradleCoordinate)5 Module (com.intellij.openapi.module.Module)2 Project (com.intellij.openapi.project.Project)2 RepoPackage (com.android.repository.api.RepoPackage)1 AndroidSdkHandler (com.android.sdklib.repository.AndroidSdkHandler)1 GradleSyncListener (com.android.tools.idea.gradle.project.sync.GradleSyncListener)1 StudioLoggerProgressIndicator (com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator)1 DnDTransferItem (com.android.tools.idea.uibuilder.model.DnDTransferItem)1 NlComponent (com.android.tools.idea.uibuilder.model.NlComponent)1 NlModel (com.android.tools.idea.uibuilder.model.NlModel)1 ScreenView (com.android.tools.idea.uibuilder.surface.ScreenView)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)1 NotNull (org.jetbrains.annotations.NotNull)1