Search in sources :

Example 31 with GradleProjectSettings

use of org.jetbrains.plugins.gradle.settings.GradleProjectSettings in project android by JetBrains.

the class GradleDistributionCleanUpTaskTest method setGradleLocalDistribution.

private void setGradleLocalDistribution(@NotNull String gradleLocalDistributionPath) {
    GradleProjectSettings settings = doGetGradleProjectSettings();
    settings.setDistributionType(LOCAL);
    settings.setGradleHome(gradleLocalDistributionPath);
}
Also used : GradleProjectSettings(org.jetbrains.plugins.gradle.settings.GradleProjectSettings)

Example 32 with GradleProjectSettings

use of org.jetbrains.plugins.gradle.settings.GradleProjectSettings in project android by JetBrains.

the class GradleSyncIntegrationTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    Project project = getProject();
    GradleProjectSettings projectSettings = new GradleProjectSettings();
    projectSettings.setDistributionType(DEFAULT_WRAPPED);
    GradleSettings.getInstance(project).setLinkedProjectsSettings(Collections.singletonList(projectSettings));
}
Also used : Project(com.intellij.openapi.project.Project) GradleProjectSettings(org.jetbrains.plugins.gradle.settings.GradleProjectSettings)

Example 33 with GradleProjectSettings

use of org.jetbrains.plugins.gradle.settings.GradleProjectSettings in project android by JetBrains.

the class IdeFrameFixture method useLocalGradleDistribution.

@NotNull
public IdeFrameFixture useLocalGradleDistribution(@NotNull String gradleHome) {
    GradleProjectSettings settings = getGradleSettings();
    settings.setDistributionType(LOCAL);
    settings.setGradleHome(gradleHome);
    return this;
}
Also used : GradleProjectSettings(org.jetbrains.plugins.gradle.settings.GradleProjectSettings) Assert.assertNotNull(junit.framework.Assert.assertNotNull) NotNull(org.jetbrains.annotations.NotNull)

Example 34 with GradleProjectSettings

use of org.jetbrains.plugins.gradle.settings.GradleProjectSettings in project android by JetBrains.

the class GradleVersionsTest method testReadGradleVersionFromWrapper.

public void testReadGradleVersionFromWrapper() throws Exception {
    loadSimpleApplication();
    Project project = getProject();
    simulateGradleSyncStateReturnNullGradleVersion();
    GradleProjectSettings settings = new GradleProjectSettings();
    settings.setDistributionType(DEFAULT_WRAPPED);
    when(mySettingsFinder.findGradleProjectSettings(any())).thenReturn(settings);
    String expected = getGradleVersionFromWrapper();
    GradleVersion gradleVersion = myGradleVersions.getGradleVersion(project);
    assertNotNull(gradleVersion);
    assertEquals(expected, gradleVersion.toString());
}
Also used : Project(com.intellij.openapi.project.Project) GradleProjectSettings(org.jetbrains.plugins.gradle.settings.GradleProjectSettings) GradleVersion(com.android.ide.common.repository.GradleVersion)

Aggregations

GradleProjectSettings (org.jetbrains.plugins.gradle.settings.GradleProjectSettings)34 File (java.io.File)9 Project (com.intellij.openapi.project.Project)8 VirtualFile (com.intellij.openapi.vfs.VirtualFile)7 Nullable (org.jetbrains.annotations.Nullable)6 NotNull (org.jetbrains.annotations.NotNull)5 IOException (java.io.IOException)4 DistributionType (org.jetbrains.plugins.gradle.settings.DistributionType)4 GradleSettings (org.jetbrains.plugins.gradle.settings.GradleSettings)4 GradleWrapper (com.android.tools.idea.gradle.util.GradleWrapper)3 Sdk (com.intellij.openapi.projectRoots.Sdk)3 GradleVersion (com.android.ide.common.repository.GradleVersion)2 Result (com.intellij.openapi.application.Result)2 WriteAction (com.intellij.openapi.application.WriteAction)2 ExternalSystemSettingsListenerAdapter (com.intellij.openapi.externalSystem.settings.ExternalSystemSettingsListenerAdapter)2 Module (com.intellij.openapi.module.Module)2 JavaSdk (com.intellij.openapi.projectRoots.JavaSdk)2 VfsUtil.findFileByIoFile (com.intellij.openapi.vfs.VfsUtil.findFileByIoFile)2 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)2 BuildParticipant (org.jetbrains.plugins.gradle.model.data.BuildParticipant)2