use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project intellij-community by JetBrains.
the class MavenFoldersImporterTest method testDoNotUpdateOutputFoldersWhenUpdatingExcludedFolders.
public void testDoNotUpdateOutputFoldersWhenUpdatingExcludedFolders() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
ApplicationManager.getApplication().runWriteAction(() -> {
MavenRootModelAdapter adapter = new MavenRootModelAdapter(myProjectsTree.findProject(myProjectPom), getModule("project"), new IdeModifiableModelsProviderImpl(myProject));
adapter.useModuleOutput(new File(myProjectRoot.getPath(), "target/my-classes").getPath(), new File(myProjectRoot.getPath(), "target/my-test-classes").getPath());
adapter.getRootModel().commit();
});
MavenFoldersImporter.updateProjectFolders(myProject, true);
ModuleRootManager rootManager = ModuleRootManager.getInstance(getModule("project"));
CompilerModuleExtension compiler = rootManager.getModuleExtension(CompilerModuleExtension.class);
assertTrue(compiler.getCompilerOutputUrl(), compiler.getCompilerOutputUrl().endsWith("my-classes"));
assertTrue(compiler.getCompilerOutputUrlForTests(), compiler.getCompilerOutputUrlForTests().endsWith("my-test-classes"));
}
use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project intellij-community by JetBrains.
the class MavenFoldersImporterTest method testDoesNotExcludeRegisteredSources.
public void testDoesNotExcludeRegisteredSources() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
new File(myProjectRoot.getPath(), "target/foo").mkdirs();
final File sourceDir = new File(myProjectRoot.getPath(), "target/src");
sourceDir.mkdirs();
ApplicationManager.getApplication().runWriteAction(() -> {
MavenRootModelAdapter adapter = new MavenRootModelAdapter(myProjectsTree.findProject(myProjectPom), getModule("project"), new IdeModifiableModelsProviderImpl(myProject));
adapter.addSourceFolder(sourceDir.getPath(), JavaSourceRootType.SOURCE);
adapter.getRootModel().commit();
});
updateProjectFolders();
assertSources("project", "target/src");
assertExcludes("project", "target");
}
use of com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProviderImpl in project intellij-community by JetBrains.
the class GroovyImporterTest method testUpdatingGroovySpecificGeneratedSourcesOnFoldersUpdate.
public void testUpdatingGroovySpecificGeneratedSourcesOnFoldersUpdate() throws Exception {
try {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<build>" + " <plugins>" + " <plugin>" + " <groupId>org.codehaus.groovy.maven</groupId>" + " <artifactId>gmaven-plugin</artifactId>" + " <executions>" + " <execution>" + " <goals>" + " <goal>generateStubs</goal>" + " <goal>generateTestStubs</goal>" + " </goals>" + " </execution>" + " </executions>" + " </plugin>" + " </plugins>" + "</build>");
ApplicationManager.getApplication().runWriteAction(() -> {
MavenRootModelAdapter a = new MavenRootModelAdapter(myProjectsTree.findProject(myProjectPom), getModule("project"), new IdeModifiableModelsProviderImpl(myProject));
a.unregisterAll(getProjectPath() + "/target", true, true);
a.getRootModel().commit();
});
assertSources("project");
assertTestSources("project");
assertExcludes("project");
createProjectSubDirs("src/main/groovy", "src/test/groovy", "target/generated-sources/xxx/yyy", "target/generated-sources/groovy-stubs/main/foo", "target/generated-sources/groovy-stubs/test/bar");
resolveFoldersAndImport();
assertSources("project", "src/main/groovy", "target/generated-sources/xxx");
assertTestSources("project", "src/test/groovy");
assertExcludes("project", "target");
} finally {
// do not lock files by maven process
MavenServerManager.getInstance().shutdown(true);
}
}
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());
}
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);
}
Aggregations