use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class JpsDependenciesEnumeratorTest method testNotExportedLibrary.
public void testNotExportedLibrary() throws Exception {
final JpsModule dep = addModule("dep");
JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, false);
JpsModuleRootModificationUtil.addDependency(myModule, createAsmLibrary(), JpsJavaDependencyScope.COMPILE, false);
JpsModuleRootModificationUtil.addDependency(myModule, dep, JpsJavaDependencyScope.COMPILE, false);
assertClassRoots(dependencies(myModule).withoutSdk(), getAsmJar());
assertClassRoots(dependencies(myModule).withoutSdk().recursively(), getAsmJar(), getJDomJar());
assertClassRoots(dependencies(myModule).withoutSdk().recursivelyExportedOnly(), getAsmJar());
assertClassRoots(dependencies(myModule).withoutSdk().exportedOnly().recursively());
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class JpsJavaExtensionTest method testDependency.
public void testDependency() {
final JpsModel model = myModel.createModifiableModel(new TestJpsEventDispatcher());
final JpsModule module = model.getProject().addModule("m", JpsJavaModuleType.INSTANCE);
final JpsLibrary library = model.getProject().addLibrary("l", JpsJavaLibraryType.INSTANCE);
final JpsLibraryDependency dependency = module.getDependenciesList().addLibraryDependency(library);
getJavaService().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.TEST);
getJavaService().getOrCreateDependencyExtension(dependency).setExported(true);
model.commit();
List<JpsDependencyElement> dependencies = assertOneElement(myProject.getModules()).getDependenciesList().getDependencies();
assertEquals(2, dependencies.size());
final JpsDependencyElement dep = dependencies.get(1);
final JpsJavaDependencyExtension extension = getJavaService().getDependencyExtension(dep);
assertNotNull(extension);
assertTrue(extension.isExported());
assertSame(JpsJavaDependencyScope.TEST, extension.getScope());
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class JpsGantProjectBuilder method buildModules.
public void buildModules(List<JpsModule> modules) {
Set<String> names = new LinkedHashSet<>();
info("Collecting dependencies for " + modules.size() + " modules");
for (JpsModule module : modules) {
Set<String> dependencies = getModuleDependencies(module, false);
for (String dependency : dependencies) {
if (names.add(dependency)) {
info(" adding " + dependency + " required for " + module.getName());
}
}
}
runBuild(names, false, false);
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class JpsGantProjectBuilder method exportModuleOutputProperties.
public void exportModuleOutputProperties() {
for (JpsModule module : myModel.getProject().getModules()) {
for (boolean test : new boolean[] { true, false }) {
String propertyName = "module." + module.getName() + ".output." + (test ? "test" : "main");
String outputPath = getModuleOutput(module, test);
myProject.setProperty(propertyName, outputPath);
}
}
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class CommonTest method testMoveClassToDependentModuleWithSameOutput.
public void testMoveClassToDependentModuleWithSameOutput() throws Exception {
final JpsSdk<JpsDummyElement> sdk = getOrCreateJdk();
final String commonOutput = getAbsolutePath("out");
JpsModule moduleA = addModule("moduleA", new String[] { getAbsolutePath("moduleA/src") }, commonOutput, commonOutput, sdk);
JpsModule moduleB = addModule("moduleB", new String[] { getAbsolutePath("moduleB/src") }, commonOutput, commonOutput, sdk);
JpsModuleRootModificationUtil.addDependency(moduleB, moduleA);
doTestBuild(1).assertSuccessful();
}
Aggregations