use of org.eclipse.xtext.workspace.FileSourceFolder in project xtext-xtend by eclipse.
the class TestBatchCompiler method testProjectConfigMultipleSourceDirs4.
@Test
public void testProjectConfigMultipleSourceDirs4() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("ws/prj1/src");
_builder.append(File.pathSeparator);
_builder.append("ws/prj1/dir1/src-gen");
this.batchCompiler.setSourcePath(_builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("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("dir1/src-gen", 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", it);
Assert.assertEquals("bin", output.getOutputDirectory(it));
};
ObjectExtensions.<String>operator_doubleArrow(_get_1, _function_2);
}
use of org.eclipse.xtext.workspace.FileSourceFolder in project xtext-xtend by eclipse.
the class TestBatchCompiler method testProjectConfigMultipleSourceDirs1.
@Test
public void testProjectConfigMultipleSourceDirs1() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("ws/prj1/src");
_builder.append(File.pathSeparator);
_builder.append("ws/prj1/src-gen");
this.batchCompiler.setSourcePath(_builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("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).toString());
};
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).toString());
};
ObjectExtensions.<String>operator_doubleArrow(_get_1, _function_2);
}
use of org.eclipse.xtext.workspace.FileSourceFolder in project xtext-xtend by eclipse.
the class TestBatchCompiler method testProjectConfigMultipleSourceDirs5.
@Test
public void testProjectConfigMultipleSourceDirs5() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("ws/prj1/dir1/dir1a/src");
_builder.append(File.pathSeparator);
_builder.append("ws/prj1/dir3/dir3a/src-gen");
this.batchCompiler.setSourcePath(_builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("ws/prj1/dir2/dir2a/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("dir1/dir1a/src", it);
Assert.assertEquals("dir2/dir2a/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("dir3/dir3a/src-gen", it);
Assert.assertEquals("dir2/dir2a/bin", output.getOutputDirectory(it));
};
ObjectExtensions.<String>operator_doubleArrow(_get_1, _function_2);
}
use of org.eclipse.xtext.workspace.FileSourceFolder in project xtext-xtend by eclipse.
the class TestBatchCompiler method testProjectConfigMultipleSourceDirs3.
@Test
public void testProjectConfigMultipleSourceDirs3() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("ws/prj1/dir1/src");
_builder.append(File.pathSeparator);
_builder.append("ws/prj1/src-gen");
this.batchCompiler.setSourcePath(_builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("ws/prj1/dir2/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("dir1/src", it);
Assert.assertEquals("dir2/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("dir2/bin", output.getOutputDirectory(it));
};
ObjectExtensions.<String>operator_doubleArrow(_get_1, _function_2);
}
use of org.eclipse.xtext.workspace.FileSourceFolder in project xtext-xtend by eclipse.
the class TestBatchCompiler method testProjectConfigMultipleSourceDirs6.
@Test
public void testProjectConfigMultipleSourceDirs6() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("dir1/ws/prj1/dir2/dir3/dir4/src1");
_builder.append(File.pathSeparator);
_builder.append("dir1/ws/prj1/dir2/dir3/src2");
_builder.append(File.pathSeparator);
_builder.append("dir1/ws/prj1/dir2/src3");
_builder.append(File.pathSeparator);
_builder.append("dir1/ws/prj1/src4");
this.batchCompiler.setSourcePath(_builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("dir1/ws/prj1/dir2/dir3/dir4/dir5/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(4, 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("dir2/dir3/dir4/src1", it);
Assert.assertEquals("dir2/dir3/dir4/dir5/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("dir2/dir3/src2", it);
Assert.assertEquals("dir2/dir3/dir4/dir5/bin", output.getOutputDirectory(it));
};
ObjectExtensions.<String>operator_doubleArrow(_get_1, _function_2);
String _get_2 = keyPaths.get(2);
final Procedure1<String> _function_3 = (String it) -> {
Assert.assertEquals("dir2/src3", it);
Assert.assertEquals("dir2/dir3/dir4/dir5/bin", output.getOutputDirectory(it));
};
ObjectExtensions.<String>operator_doubleArrow(_get_2, _function_3);
String _get_3 = keyPaths.get(3);
final Procedure1<String> _function_4 = (String it) -> {
Assert.assertEquals("src4", it);
Assert.assertEquals("dir2/dir3/dir4/dir5/bin", output.getOutputDirectory(it));
};
ObjectExtensions.<String>operator_doubleArrow(_get_3, _function_4);
}
Aggregations