use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class MarkDirtyTest method testDoNotMarkDirtyCompiledChunks.
public void testDoNotMarkDirtyCompiledChunks() {
//'b.Client' from production sources of 'b' cannot depend on 'a.ShortName' from module 'a' so it shouldn't be marked as dirty.
//Otherwise we can get 'dirty' sources after full make if production of 'b' was compiled before 'a'
JpsModule b = addModule("b", "moduleB/src");
addTestRoot(b, "moduleB/testSrc");
JpsModule a = addModule("a", "moduleA/src");
addTestRoot(a, "moduleA/testSrc");
JpsModuleRootModificationUtil.addDependency(b, a, JpsJavaDependencyScope.TEST, false);
doTestBuild(2).assertSuccessful();
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class MarkDirtyTest method testTransitiveRecompile.
public void testTransitiveRecompile() {
JpsModule module = addModule();
addTestRoot(module, "testSrc");
JpsModule util = addModule("util", "util/src");
addTestRoot(util, "util/testSrc");
JpsModuleRootModificationUtil.addDependency(module, util);
JpsModule lib = addModule("lib", "lib/src");
addTestRoot(lib, "lib/testSrc");
JpsModuleRootModificationUtil.addDependency(util, lib);
doTestBuild(1).assertSuccessful();
}
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);
}
Aggregations