Search in sources :

Example 11 with IdeModifiableModelsProviderImpl

use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project android by JetBrains.

the class JavaFacetModuleSetupStepTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myModelsProvider = new IdeModifiableModelsProviderImpl(getProject());
    mySetupStep = new JavaFacetModuleSetupStep();
}
Also used : IdeModifiableModelsProviderImpl(com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl)

Example 12 with IdeModifiableModelsProviderImpl

use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project android by JetBrains.

the class NdkModuleModelDataServiceTest method testGetTargetDataKey.

public void testGetTargetDataKey() {
    myModelsProvider = new IdeModifiableModelsProviderImpl(getProject());
    assertSame(NDK_MODEL, myDataService.getTargetDataKey());
}
Also used : IdeModifiableModelsProviderImpl(com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl)

Example 13 with IdeModifiableModelsProviderImpl

use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project android by JetBrains.

the class GradleModuleModelDataServiceTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    initMocks(this);
    myModelsProvider = new IdeModifiableModelsProviderImpl(getProject());
    myDataService = new GradleModuleModelDataService(myModuleSetup);
}
Also used : IdeModifiableModelsProviderImpl(com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl)

Example 14 with IdeModifiableModelsProviderImpl

use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project android by JetBrains.

the class JavaModuleModelDataServiceTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    initMocks(this);
    myModelsProvider = new IdeModifiableModelsProviderImpl(getProject());
    myDataService = new JavaModuleModelDataService(myModuleSetup);
}
Also used : IdeModifiableModelsProviderImpl(com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl)

Example 15 with IdeModifiableModelsProviderImpl

use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project android by JetBrains.

the class ModuleDisposalDataServiceTest method testImportDataWithAndroidStudioAndSuccessfulSync.

public void testImportDataWithAndroidStudioAndSuccessfulSync() {
    when(myIdeInfo.isAndroidStudio()).thenReturn(true);
    when(mySyncState.lastSyncFailedOrHasIssues()).thenReturn(false);
    IdeaModule moduleModel = mock(IdeaModule.class);
    when(moduleModel.getName()).thenReturn(getModule().getName());
    ImportedModule importedModule = new ImportedModule(moduleModel);
    // This module should be disposed.
    Module libModule = createModule("lib");
    Project project = getProject();
    IdeModifiableModelsProvider modelsProvider = new IdeModifiableModelsProviderImpl(project);
    Collection<DataNode<ImportedModule>> nodes = Collections.singleton(new DataNode<>(IMPORTED_MODULE, importedModule, null));
    myDataService.importData(nodes, null, project, modelsProvider);
    ApplicationManager.getApplication().runWriteAction(modelsProvider::dispose);
    Collection<Module> modulesToDispose = Collections.singletonList(libModule);
    verify(myModuleDisposer).disposeModulesAndMarkImlFilesForDeletion(modulesToDispose, getProject(), modelsProvider);
}
Also used : Project(com.intellij.openapi.project.Project) IdeaModule(org.gradle.tooling.model.idea.IdeaModule) DataNode(com.intellij.openapi.externalSystem.model.DataNode) ImportedModule(com.android.tools.idea.gradle.ImportedModule) IdeModifiableModelsProviderImpl(com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl) ImportedModule(com.android.tools.idea.gradle.ImportedModule) IdeaModule(org.gradle.tooling.model.idea.IdeaModule) Module(com.intellij.openapi.module.Module) IdeModifiableModelsProvider(com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider)

Aggregations

IdeModifiableModelsProviderImpl (com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl)36 IdeModifiableModelsProvider (com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider)18 Module (com.intellij.openapi.module.Module)16 Project (com.intellij.openapi.project.Project)9 File (java.io.File)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 DataNode (com.intellij.openapi.externalSystem.model.DataNode)4 Library (com.intellij.openapi.roots.libraries.Library)4 JavaModuleModel (com.android.tools.idea.gradle.project.model.JavaModuleModel)3 ProjectData (com.intellij.openapi.externalSystem.model.project.ProjectData)3 HashMap (java.util.HashMap)3 Set (java.util.Set)3 FacetManager (com.intellij.facet.FacetManager)2 ModifiableFacetModel (com.intellij.facet.ModifiableFacetModel)2 IdeUIModifiableModelsProvider (com.intellij.openapi.externalSystem.service.project.IdeUIModifiableModelsProvider)2 LibraryOrderEntry (com.intellij.openapi.roots.LibraryOrderEntry)2 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)2 ArrayList (java.util.ArrayList)2 MavenRootModelAdapter (org.jetbrains.idea.maven.importing.MavenRootModelAdapter)2 AndroidProject (com.android.builder.model.AndroidProject)1