Search in sources :

Example 1 with GradleFacetType

use of com.android.tools.idea.gradle.project.facet.gradle.GradleFacetType in project android by JetBrains.

the class GradleModuleSetup method setUpModule.

public void setUpModule(@NotNull Module module, @NotNull IdeModifiableModelsProvider ideModelsProvider, @NotNull GradleModuleModel model) {
    GradleFacet facet = findFacet(module, ideModelsProvider, GradleFacet.getFacetTypeId());
    if (facet == null) {
        ModifiableFacetModel facetModel = ideModelsProvider.getModifiableFacetModel(module);
        GradleFacetType facetType = GradleFacet.getFacetType();
        facet = facetType.createFacet(module, GradleFacet.getFacetName(), facetType.createDefaultConfiguration(), null);
        facetModel.addFacet(facet);
    }
    facet.setGradleModuleModel(model);
    String gradleVersion = model.getGradleVersion();
    GradleSyncSummary syncReport = GradleSyncState.getInstance(module.getProject()).getSummary();
    if (isNotEmpty(gradleVersion) && syncReport.getGradleVersion() == null) {
        syncReport.setGradleVersion(GradleVersion.parse(gradleVersion));
    }
}
Also used : ModifiableFacetModel(com.intellij.facet.ModifiableFacetModel) GradleFacet(com.android.tools.idea.gradle.project.facet.gradle.GradleFacet) GradleFacetType(com.android.tools.idea.gradle.project.facet.gradle.GradleFacetType) GradleSyncSummary(com.android.tools.idea.gradle.project.sync.GradleSyncSummary)

Aggregations

GradleFacet (com.android.tools.idea.gradle.project.facet.gradle.GradleFacet)1 GradleFacetType (com.android.tools.idea.gradle.project.facet.gradle.GradleFacetType)1 GradleSyncSummary (com.android.tools.idea.gradle.project.sync.GradleSyncSummary)1 ModifiableFacetModel (com.intellij.facet.ModifiableFacetModel)1