Search in sources :

Example 21 with JpsModule

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();
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule)

Example 22 with JpsModule

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();
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule)

Example 23 with JpsModule

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();
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule)

Example 24 with JpsModule

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();
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule)

Example 25 with JpsModule

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);
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule) File(java.io.File)

Aggregations

JpsModule (org.jetbrains.jps.model.module.JpsModule)128 File (java.io.File)33 NotNull (org.jetbrains.annotations.NotNull)15 CompilerMessage (org.jetbrains.jps.incremental.messages.CompilerMessage)15 JpsAndroidModuleExtension (org.jetbrains.jps.android.model.JpsAndroidModuleExtension)14 JpsAndroidModuleExtensionImpl (org.jetbrains.jps.android.model.impl.JpsAndroidModuleExtensionImpl)13 JpsAndroidModuleProperties (org.jetbrains.jps.android.model.impl.JpsAndroidModuleProperties)13 THashSet (gnu.trove.THashSet)11 JpsLibrary (org.jetbrains.jps.model.library.JpsLibrary)11 ProgressMessage (org.jetbrains.jps.incremental.messages.ProgressMessage)10 JpsSimpleElement (org.jetbrains.jps.model.JpsSimpleElement)10 JpsArtifact (org.jetbrains.jps.model.artifact.JpsArtifact)10 ArrayList (java.util.ArrayList)9 HashMap (com.intellij.util.containers.HashMap)8 IOException (java.io.IOException)8 TObjectLongHashMap (gnu.trove.TObjectLongHashMap)7 JpsDependencyElement (org.jetbrains.jps.model.module.JpsDependencyElement)7 JpsDummyElement (org.jetbrains.jps.model.JpsDummyElement)6 Pair (com.intellij.openapi.util.Pair)5 Nullable (org.jetbrains.annotations.Nullable)5