Search in sources :

Example 6 with FileSourceFolder

use of org.eclipse.xtext.workspace.FileSourceFolder in project xtext-xtend by eclipse.

the class TestBatchCompiler method testProjectConfigMultipleSourceDirs2AbsPaths.

@Test
public void testProjectConfigMultipleSourceDirs2AbsPaths() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("/tmp/ws/prj1/src");
    _builder.append(File.pathSeparator);
    _builder.append("/tmp/ws/prj1/src-gen");
    this.batchCompiler.setSourcePath(_builder.toString());
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("/tmp/ws/prj1/bin");
    this.batchCompiler.setOutputPath(_builder_1.toString());
    this.batchCompiler.compile();
    final FileProjectConfig project = this.batchCompiler.getProjectConfig();
    Assert.assertEquals("prj1", project.getName());
    final OutputConfiguration output = this.batchCompiler.getOutputConfiguration();
    Assert.assertEquals(2, project.getSourceFolders().size());
    final Function1<FileSourceFolder, String> _function = (FileSourceFolder it) -> {
        return it.getName();
    };
    final List<String> keyPaths = IterableExtensions.<String>sort(IterableExtensions.<FileSourceFolder, String>map(project.getSourceFolders(), _function));
    String _get = keyPaths.get(0);
    final Procedure1<String> _function_1 = (String it) -> {
        Assert.assertEquals("src", it);
        Assert.assertEquals("bin", output.getOutputDirectory(it));
    };
    ObjectExtensions.<String>operator_doubleArrow(_get, _function_1);
    String _get_1 = keyPaths.get(1);
    final Procedure1<String> _function_2 = (String it) -> {
        Assert.assertEquals("src-gen", it);
        Assert.assertEquals("bin", output.getOutputDirectory(it));
    };
    ObjectExtensions.<String>operator_doubleArrow(_get_1, _function_2);
}
Also used : OutputConfiguration(org.eclipse.xtext.generator.OutputConfiguration) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) FileProjectConfig(org.eclipse.xtext.workspace.FileProjectConfig) FileSourceFolder(org.eclipse.xtext.workspace.FileSourceFolder) IgnoredBySmokeTest(org.eclipse.xtext.testing.smoketest.IgnoredBySmokeTest) Test(org.junit.Test)

Aggregations

StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)6 OutputConfiguration (org.eclipse.xtext.generator.OutputConfiguration)6 IgnoredBySmokeTest (org.eclipse.xtext.testing.smoketest.IgnoredBySmokeTest)6 FileProjectConfig (org.eclipse.xtext.workspace.FileProjectConfig)6 FileSourceFolder (org.eclipse.xtext.workspace.FileSourceFolder)6 Test (org.junit.Test)6