Search in sources :

Example 6 with JpsModule

use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.

the class FormsBuilderTest method testRecompileFormForChangedClass.

public void testRecompileFormForChangedClass() {
    JpsModule m = addModule("m", copyToProject(SIMPLE_FORM_PATH, "src"));
    buildAllModules().assertSuccessful();
    assertInstrumented(m, "xxx/MyForm.class");
    change(getAbsolutePath("src/xxx/MyForm.java"));
    buildAllModules().assertSuccessful();
    assertCompiled(JavaBuilder.BUILDER_NAME, "src/xxx/MyForm.java");
    assertCompiled(FormsInstrumenter.BUILDER_NAME, "src/xxx/MyForm.form");
    assertInstrumented(m, "xxx/MyForm.class");
    buildAllModules().assertUpToDate();
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule)

Example 7 with JpsModule

use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.

the class FormsBuilderTest method testDisableInstrumenting.

public void testDisableInstrumenting() {
    JpsModule m = addModule("m", copyToProject(SIMPLE_FORM_PATH, "src"));
    buildAllModules().assertSuccessful();
    assertInstrumented(m, "xxx/MyForm.class");
    JpsUiDesignerExtensionService.getInstance().getOrCreateUiDesignerConfiguration(myProject).setInstrumentClasses(false);
    //todo[nik,jeka] perhaps we shouldn't require rebuild to remove instrumented code
    rebuildAllModules();
    assertNotInstrumented(m, "xxx/MyForm.class");
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule)

Example 8 with JpsModule

use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.

the class JpsMavenModuleSerializationTest method testLoadProject.

public void testLoadProject() {
    loadProject("plugins/maven/jps-plugin/testData/compiler/classpathTest");
    List<JpsModule> modules = myProject.getModules();
    assertEquals(3, modules.size());
    JpsModule main = modules.get(0);
    assertEquals("main", main.getName());
    JpsModule dep = modules.get(1);
    assertEquals("dep", dep.getName());
    JpsModule depTest = modules.get(2);
    assertEquals("dep-test", depTest.getName());
    for (JpsModule module : modules) {
        assertNotNull(getService().getExtension(module));
    }
    List<JpsDependencyElement> dependencies = main.getDependenciesList().getDependencies();
    assertEquals(5, dependencies.size());
    assertTrue(getService().isProductionOnTestDependency(dependencies.get(3)));
    assertFalse(getService().isProductionOnTestDependency(dependencies.get(4)));
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule) JpsDependencyElement(org.jetbrains.jps.model.module.JpsDependencyElement)

Example 9 with JpsModule

use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.

the class JpsProjectLoader method loadModules.

private void loadModules(Element root, @Nullable final JpsSdkType<?> projectSdkType) {
    Runnable timingLog = TimingLog.startActivity("loading modules");
    Element componentRoot = JDomSerializationUtil.findComponent(root, "ProjectModuleManager");
    if (componentRoot == null)
        return;
    final Set<File> foundFiles = new THashSet<>(FileUtil.FILE_HASHING_STRATEGY);
    final List<File> moduleFiles = new ArrayList<>();
    for (Element moduleElement : JDOMUtil.getChildren(componentRoot.getChild("modules"), "module")) {
        final String path = moduleElement.getAttributeValue("filepath");
        final File file = new File(path);
        if (foundFiles.add(file) && file.exists()) {
            moduleFiles.add(file);
        } else {
            LOG.info("Module '" + FileUtil.getNameWithoutExtension(file) + "' is skipped: " + file.getAbsolutePath() + " doesn't exist");
        }
    }
    List<JpsModule> modules = loadModules(moduleFiles, projectSdkType, myPathVariables);
    for (JpsModule module : modules) {
        myProject.addModule(module);
    }
    timingLog.run();
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule) JpsElement(org.jetbrains.jps.model.JpsElement) JpsDummyElement(org.jetbrains.jps.model.JpsDummyElement) Element(org.jdom.Element) ArrayList(java.util.ArrayList) File(java.io.File) THashSet(gnu.trove.THashSet)

Example 10 with JpsModule

use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.

the class ModuleExcludeIndexTest method testExcludedFolder.

public void testExcludedFolder() {
    File exc = new File(myRoot, "exc");
    JpsModule module = addModule();
    addExcludedRoot(module, exc);
    assertNotExcluded(myRoot);
    assertExcluded(exc);
    assertSameElements(getModuleExcludes(module), exc);
}
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