use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class DependentModulesCompilationTest method testTransitiveDependencyViaDummyModule.
public void testTransitiveDependencyViaDummyModule() {
String depRoot = PathUtil.getParentPath(createFile("dep/A.java", "class A{}"));
String mainRoot = PathUtil.getParentPath(createFile("main/B.java", "class B extends A{}"));
JpsModule main = addModule("main", mainRoot);
JpsModule dep = addModule("dep", depRoot);
JpsModule dummy = addModule("dummy");
JpsModule dummy2 = addModule("dummy2");
//force 'main' to be built before 'dep' unless transitive dependency is correctly considered
dep.getDependenciesList().addModuleDependency(main);
main.getDependenciesList().addModuleDependency(dummy);
addExportedDependency(dummy, dummy2);
addExportedDependency(dummy2, dep);
dummy2.getDependenciesList().addModuleDependency(dummy);
rebuildAllModules();
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ForcedCompilationTest method testRecompileDependentAfterForcedCompilation.
public void testRecompileDependentAfterForcedCompilation() {
String srcRoot = PathUtil.getParentPath(createFile("src/A.java", "class A{ { new B(); } }"));
String b = createFile("depSrc/B.java", "public class B{}");
JpsModule main = addModule("main", srcRoot);
JpsModule dep = addModule("dep", PathUtil.getParentPath(b));
main.getDependenciesList().addModuleDependency(dep);
rebuildAllModules();
change(b, "public class B{ public B(int i){} }");
doBuild(CompileScopeTestBuilder.recompile().module(dep)).assertSuccessful();
doBuild(CompileScopeTestBuilder.make().module(main)).assertFailed();
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ForcedCompilationTest method testClearModuleOutputOnForcedCompilation.
public void testClearModuleOutputOnForcedCompilation() {
String srcRoot = PathUtil.getParentPath(createFile("src/A.java", "class A{ }"));
JpsModule main = addModule("main", srcRoot);
rebuildAllModules();
File b = new File(createFile(getModuleOutputRelativePath(main) + "/a.txt", "qwerty"));
buildAllModules();
assertExists(b);
doBuild(CompileScopeTestBuilder.recompile().module(main)).assertSuccessful();
assertDoesntExist(b);
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ResourceCopyingTest method testSimple.
public void testSimple() {
String file = createFile("src/a.xml");
JpsModule m = addModule("m", PathUtil.getParentPath(file));
rebuildAllModules();
assertOutput(m, fs().file("a.xml"));
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class ResourceCopyingTest method testCaseChange.
public void testCaseChange() {
String file = createFile("src/a.xml");
JpsModule m = addModule("m", PathUtil.getParentPath(file));
rebuildAllModules();
assertOutput(m, fs().file("a.xml"));
rename(file, "A.xml");
buildAllModules();
assertOutput(m, fs().file("A.xml"));
}
Aggregations