use of org.jetbrains.jps.model.java.JpsJavaModuleExtension in project intellij-community by JetBrains.
the class ModuleExcludeIndexTest method testModuleOutput.
public void testModuleOutput() {
File out = new File(myRoot, "out");
JpsModule module = addModule();
JpsJavaModuleExtension extension = getJavaService().getOrCreateModuleExtension(module);
extension.setExcludeOutput(true);
extension.setOutputUrl(JpsPathUtil.pathToUrl(out.getAbsolutePath()));
assertNotExcluded(myRoot);
assertExcluded(out);
assertSameElements(getModuleExcludes(module), out);
extension.setExcludeOutput(false);
assertNotExcluded(out);
assertEmpty(getModuleExcludes(module));
}
use of org.jetbrains.jps.model.java.JpsJavaModuleExtension in project intellij-community by JetBrains.
the class ForcedCompilationTest method testDontClearModuleOutputOnForcedCompilation.
public void testDontClearModuleOutputOnForcedCompilation() {
JpsModule m1 = addModule("m1", PathUtil.getParentPath(createFile("src/A.java", "class A{ }")));
JpsModule m2 = addModule("m2", PathUtil.getParentPath(createFile("src/B.java", "class B{ }")));
JpsJavaModuleExtension m1Ext = JpsJavaExtensionService.getInstance().getOrCreateModuleExtension(m1);
JpsJavaModuleExtension m2Ext = JpsJavaExtensionService.getInstance().getOrCreateModuleExtension(m2);
m2Ext.setOutputUrl(m1Ext.getOutputUrl());
m2Ext.setTestOutputUrl(m1Ext.getOutputUrl());
rebuildAllModules();
File b = new File(createFile(getModuleOutputRelativePath(m1) + "/a.txt", "qwerty"));
buildAllModules();
assertExists(b);
assertExists(new File(getOrCreateProjectDir(), getModuleOutputRelativePath(m1) + "/A.class"));
assertExists(new File(getOrCreateProjectDir(), getModuleOutputRelativePath(m1) + "/B.class"));
doBuild(CompileScopeTestBuilder.recompile().module(m1)).assertSuccessful();
assertExists(b);
assertExists(new File(getOrCreateProjectDir(), getModuleOutputRelativePath(m1) + "/A.class"));
assertExists(new File(getOrCreateProjectDir(), getModuleOutputRelativePath(m1) + "/B.class"));
}
Aggregations