Search in sources :

Example 1 with JavaFacetConfiguration

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

the class JavaFacetModuleSetupStep method doSetUpModule.

@Override
protected void doSetUpModule(@NotNull Module module, @NotNull IdeModifiableModelsProvider ideModelsProvider, @NotNull JavaModuleModel javaModuleModel, @Nullable SyncAction.ModuleModels gradleModels, @Nullable ProgressIndicator indicator) {
    JavaFacet facet = setAndGetJavaGradleFacet(module, ideModelsProvider);
    GradleFacet gradleFacet = findFacet(module, ideModelsProvider, GradleFacet.getFacetTypeId());
    if (gradleFacet != null) {
        // This is an actual Gradle module, because it has the GradleFacet. Top-level modules in a multi-module project usually don't
        // have this facet.
        facet.setJavaModuleModel(javaModuleModel);
    }
    File buildFolderPath = javaModuleModel.getBuildFolderPath();
    JavaFacetConfiguration facetProperties = facet.getConfiguration();
    facetProperties.BUILD_FOLDER_PATH = buildFolderPath != null ? toSystemIndependentName(buildFolderPath.getPath()) : "";
    facetProperties.BUILDABLE = javaModuleModel.isBuildable();
}
Also used : JavaFacetConfiguration(com.android.tools.idea.gradle.project.facet.java.JavaFacetConfiguration) JavaFacet(com.android.tools.idea.gradle.project.facet.java.JavaFacet) GradleFacet(com.android.tools.idea.gradle.project.facet.gradle.GradleFacet) File(java.io.File)

Example 2 with JavaFacetConfiguration

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

the class JavaFacetModuleSetupStepTest method verifyFacetConfiguration.

private static void verifyFacetConfiguration(@NotNull JavaFacet facet, @NotNull JavaModuleModel javaModel, @NotNull File buildFolderPath, boolean buildable) {
    assertSame(javaModel, facet.getJavaModuleModel());
    JavaFacetConfiguration configuration = facet.getConfiguration();
    assertEquals(toSystemIndependentName(buildFolderPath.getPath()), configuration.BUILD_FOLDER_PATH);
    assertEquals(buildable, configuration.BUILDABLE);
    verify(javaModel).getBuildFolderPath();
    verify(javaModel).isBuildable();
}
Also used : JavaFacetConfiguration(com.android.tools.idea.gradle.project.facet.java.JavaFacetConfiguration)

Aggregations

JavaFacetConfiguration (com.android.tools.idea.gradle.project.facet.java.JavaFacetConfiguration)2 GradleFacet (com.android.tools.idea.gradle.project.facet.gradle.GradleFacet)1 JavaFacet (com.android.tools.idea.gradle.project.facet.java.JavaFacet)1 File (java.io.File)1