use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testMoveClassFromOneModuleToAnother.
public void testMoveClassFromOneModuleToAnother() {
String file = createFile("src1/A.java", "class A{}");
JpsModule m1 = addModule("m1", PathUtil.getParentPath(file));
JpsModule m2 = addModule("m2", PathUtil.getParentPath(createFile("src2/B.java", "class B{}")));
JpsArtifact a = addArtifact(root().module(m1).module(m2));
buildAll();
assertOutput(a, fs().file("A.class").file("B.class"));
delete(file);
createFile("src2/A.java", "class A{}");
buildAll();
assertOutput(a, fs().file("A.class").file("B.class"));
assertDeletedAndCopied(new String[] { "out/artifacts/a/A.class", "out/production/m1/A.class" }, "out/production/m2/A.class");
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ModuleExcludeIndexTest method testProjectOutput.
public void testProjectOutput() throws IOException {
File out = new File(myRoot, "out");
getJavaService().getOrCreateProjectExtension(myProject).setOutputUrl(JpsPathUtil.pathToUrl(out.getAbsolutePath()));
JpsModule module1 = addModule();
getJavaService().getOrCreateModuleExtension(module1).setInheritOutput(true);
JpsModule module2 = addModule();
addContentRoot(module2, out);
getJavaService().getOrCreateModuleExtension(module2).setInheritOutput(true);
assertNotExcluded(myRoot);
assertExcluded(out);
assertEmpty(getModuleExcludes(module1));
assertSameElements(getModuleExcludes(module2), out);
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ModuleExcludeIndexTest method testContentRootUnderExcluded.
public void testContentRootUnderExcluded() {
File contentRoot = new File(myRoot, "project");
File excluded = new File(contentRoot, "exc");
File unexcluded = new File(excluded, "src");
JpsModule module = addModule();
addContentRoot(module, contentRoot);
addExcludedRoot(module, excluded);
addContentRoot(module, unexcluded);
assertNotExcluded(contentRoot);
assertExcluded(excluded);
assertNotExcluded(unexcluded);
ModuleExcludeIndexImpl index = createIndex();
assertFalse(index.isExcludedFromModule(contentRoot, module));
assertTrue(index.isExcludedFromModule(excluded, module));
assertFalse(index.isExcludedFromModule(unexcluded, module));
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ModuleExcludeIndexTest method testSourceRootUnderExcluded.
public void testSourceRootUnderExcluded() {
File project = new File(myRoot, "project");
File exc = new File(project, "exc");
File src = new File(exc, "src");
JpsModule module = addModule();
addContentRoot(module, project);
addExcludedRoot(module, exc);
addSourceRoot(module, src);
assertNotExcluded(src);
addExcludedRoot(module, src);
assertExcluded(src);
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ModuleExcludeIndexTest method testInnerModuleUnderExcludedRoot.
public void testInnerModuleUnderExcludedRoot() {
File outerRoot = new File(myRoot, "outer");
File exc = new File(outerRoot, "exc");
File innerRoot = new File(exc, "inner");
JpsModule outer = addModule("outer");
addContentRoot(outer, outerRoot);
addExcludedRoot(outer, exc);
JpsModule inner = addModule("inner");
addContentRoot(inner, innerRoot);
assertNotExcluded(outerRoot);
assertNotExcluded(innerRoot);
assertSameElements(getModuleExcludes(outer), exc, innerRoot);
assertEmpty(getModuleExcludes(inner));
ModuleExcludeIndexImpl index = createIndex();
assertTrue(index.isExcludedFromModule(innerRoot, outer));
assertFalse(index.isExcludedFromModule(innerRoot, inner));
}
Aggregations