Search in sources :

Example 1 with NdkFacetType

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

the class NdkFacetModuleSetupStep method doSetUpModule.

@Override
protected void doSetUpModule(@NotNull Module module, @NotNull IdeModifiableModelsProvider ideModelsProvider, @NotNull NdkModuleModel ndkModuleModel, @Nullable SyncAction.ModuleModels gradleModels, @Nullable ProgressIndicator indicator) {
    NdkFacet facet = findFacet(module, ideModelsProvider, NdkFacet.getFacetTypeId());
    if (facet != null) {
        configureFacet(facet, ndkModuleModel);
    } else {
        // Module does not have Native Android facet. Create one and add it.
        ModifiableFacetModel model = ideModelsProvider.getModifiableFacetModel(module);
        NdkFacetType facetType = NdkFacet.getFacetType();
        facet = facetType.createFacet(module, NdkFacet.getFacetName(), facetType.createDefaultConfiguration(), null);
        model.addFacet(facet);
        configureFacet(facet, ndkModuleModel);
    }
}
Also used : NdkFacetType(com.android.tools.idea.gradle.project.facet.ndk.NdkFacetType) ModifiableFacetModel(com.intellij.facet.ModifiableFacetModel) NdkFacet(com.android.tools.idea.gradle.project.facet.ndk.NdkFacet)

Example 2 with NdkFacetType

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

the class ContentRootsModuleSetupStepTest method addNativeAndroidFacet.

@NotNull
private NdkFacet addNativeAndroidFacet(@NotNull IdeModifiableModelsProvider modelsProvider) {
    Module module = getModule();
    ModifiableFacetModel model = modelsProvider.getModifiableFacetModel(module);
    NdkFacetType facetType = NdkFacet.getFacetType();
    NdkFacet facet = facetType.createFacet(module, NdkFacet.getFacetName(), facetType.createDefaultConfiguration(), null);
    model.addFacet(facet);
    return facet;
}
Also used : NdkFacetType(com.android.tools.idea.gradle.project.facet.ndk.NdkFacetType) ModifiableFacetModel(com.intellij.facet.ModifiableFacetModel) NdkFacet(com.android.tools.idea.gradle.project.facet.ndk.NdkFacet) Module(com.intellij.openapi.module.Module) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NdkFacet (com.android.tools.idea.gradle.project.facet.ndk.NdkFacet)2 NdkFacetType (com.android.tools.idea.gradle.project.facet.ndk.NdkFacetType)2 ModifiableFacetModel (com.intellij.facet.ModifiableFacetModel)2 Module (com.intellij.openapi.module.Module)1 NotNull (org.jetbrains.annotations.NotNull)1