use of org.jetbrains.jps.ant.model.JpsAntBuildFileOptions in project intellij-community by JetBrains.
the class JpsAntSerializationTest method testLoadAntConfiguration.
public void testLoadAntConfiguration() {
loadProject(PROJECT_PATH);
loadGlobalSettings(OPTIONS_PATH);
String buildXmlUrl = getUrl("build.xml");
JpsAntBuildFileOptions options = JpsAntExtensionService.getOptions(myProject, buildXmlUrl);
assertEquals(128, options.getMaxHeapSize());
assertEquals("-J-Dmy.ant.prop=123", options.getAntCommandLineParameters());
assertContainsElements(toFiles(options.getAdditionalClasspath()), new File(getAbsolutePath("lib/jdom.jar")), new File(getAbsolutePath("ant-lib/a.jar")));
BuildFileProperty property = assertOneElement(options.getProperties());
assertEquals("my.property", property.getPropertyName());
assertEquals("its value", property.getPropertyValue());
String emptyFileUrl = getUrl("empty.xml");
JpsAntBuildFileOptions options2 = JpsAntExtensionService.getOptions(myProject, emptyFileUrl);
assertEquals(256, options2.getMaxHeapSize());
assertEquals(10, options2.getMaxStackSize());
assertEquals("1.6", options2.getCustomJdkName());
JpsAntInstallation bundled = JpsAntExtensionService.getAntInstallationForBuildFile(myModel, buildXmlUrl);
assertNotNull(bundled);
assertEquals("Bundled Ant", bundled.getName());
JpsAntInstallation installation = JpsAntExtensionService.getAntInstallationForBuildFile(myModel, emptyFileUrl);
assertNotNull(installation);
assertEquals("Apache Ant version 1.8.2", installation.getName());
}
Aggregations