Search in sources :

Example 6 with GradleSyncSummary

use of com.android.tools.idea.gradle.project.sync.GradleSyncSummary in project android by JetBrains.

the class VersionCompatibilityCheckerIntegrationTest method CheckGradle2_14_1AndPlugin2_1_2.

// Disabled. It runs locally but in CI fails with the error:
// "No cached version of com.android.tools.build:gradle:2.1.2 available for offline mode."
// This is something that needs to be fixed in the CI server.
public void CheckGradle2_14_1AndPlugin2_1_2() throws Exception {
    loadSimpleApplication();
    Project project = getProject();
    AndroidPluginVersionUpdater.UpdateResult updateResult = AndroidPluginVersionUpdater.getInstance(project).updatePluginVersion(GradleVersion.parse("2.1.2"), null);
    assertTrue(updateResult.isPluginVersionUpdated());
    assertTrue(updateResult.versionUpdateSuccess());
    requestSyncAndWait();
    String expectedError = "Gradle 2.14.1 requires Android Gradle plugin 2.1.3 (or newer) but project is using version 2.1.2.";
    SyncMessage message = mySyncMessagesStub.getFirstReportedMessage();
    // @formatter:off
    assertAbout(syncMessage()).that(message).hasType(ERROR).hasMessageLine(expectedError, 0);
    // @formatter:on
    GradleSyncSummary summary = GradleSyncState.getInstance(project).getSummary();
    assertTrue(summary.hasSyncErrors());
}
Also used : SyncMessage(com.android.tools.idea.gradle.project.sync.messages.SyncMessage) Project(com.intellij.openapi.project.Project) GradleSyncSummary(com.android.tools.idea.gradle.project.sync.GradleSyncSummary) AndroidPluginVersionUpdater(com.android.tools.idea.gradle.plugin.AndroidPluginVersionUpdater)

Aggregations

GradleSyncSummary (com.android.tools.idea.gradle.project.sync.GradleSyncSummary)6 GradleSyncState (com.android.tools.idea.gradle.project.sync.GradleSyncState)2 SyncMessage (com.android.tools.idea.gradle.project.sync.messages.SyncMessage)2 Project (com.intellij.openapi.project.Project)2 AndroidPluginVersionUpdater (com.android.tools.idea.gradle.plugin.AndroidPluginVersionUpdater)1 GradleFacet (com.android.tools.idea.gradle.project.facet.gradle.GradleFacet)1 GradleFacetType (com.android.tools.idea.gradle.project.facet.gradle.GradleFacetType)1 AndroidModuleModel (com.android.tools.idea.gradle.project.model.AndroidModuleModel)1 SyncMessagesStub (com.android.tools.idea.gradle.project.sync.messages.SyncMessagesStub)1 IdeaProjectStub (com.android.tools.idea.gradle.stubs.gradle.IdeaProjectStub)1 ModifiableFacetModel (com.intellij.facet.ModifiableFacetModel)1 IdeModifiableModelsProviderImpl (com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl)1 Module (com.intellij.openapi.module.Module)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1