Search in sources :

Example 1 with JpsAntBuildFileOptions

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());
}
Also used : BuildFileProperty(com.intellij.lang.ant.config.impl.BuildFileProperty) JpsAntInstallation(org.jetbrains.jps.ant.model.JpsAntInstallation) JpsAntBuildFileOptions(org.jetbrains.jps.ant.model.JpsAntBuildFileOptions) File(java.io.File)

Aggregations

BuildFileProperty (com.intellij.lang.ant.config.impl.BuildFileProperty)1 File (java.io.File)1 JpsAntBuildFileOptions (org.jetbrains.jps.ant.model.JpsAntBuildFileOptions)1 JpsAntInstallation (org.jetbrains.jps.ant.model.JpsAntInstallation)1