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();
}
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");
}
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)));
}
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();
}
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);
}
Aggregations