Search in sources :

Example 36 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 37 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 38 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)

Example 39 with JpsModule

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

Example 40 with JpsModule

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

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