use of org.eclipse.xtext.resource.impl.ProjectDescription in project xtext-core by eclipse.
the class DefaultProjectDescriptionFactory method getProjectDescription.
@Override
public ProjectDescription getProjectDescription(final IProjectConfig config) {
ProjectDescription _projectDescription = new ProjectDescription();
final Procedure1<ProjectDescription> _function = (ProjectDescription it) -> {
it.setName(config.getName());
};
return ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription, _function);
}
use of org.eclipse.xtext.resource.impl.ProjectDescription in project xtext-core by eclipse.
the class AbstractIncrementalBuilderTest method newBuildRequest.
protected BuildRequest newBuildRequest(final Procedure1<? super BuildRequest> init) {
BuildRequest _buildRequest = new BuildRequest();
final Procedure1<BuildRequest> _function = (BuildRequest it) -> {
final ResourceDescriptionsData newIndex = this.indexState.getResourceDescriptions().copy();
it.setBaseDir(this.uri(""));
XtextResourceSet _get = this.resourceSetProvider.get();
final Procedure1<XtextResourceSet> _function_1 = (XtextResourceSet it_1) -> {
it_1.getURIConverter().getURIHandlers().clear();
EList<URIHandler> _uRIHandlers = it_1.getURIConverter().getURIHandlers();
_uRIHandlers.add(this.inMemoryURIHandler);
it_1.setClasspathURIContext(AbstractIncrementalBuilderTest.class.getClassLoader());
ProjectDescription _projectDescription = new ProjectDescription();
final Procedure1<ProjectDescription> _function_2 = (ProjectDescription it_2) -> {
it_2.setName("test-project");
};
final ProjectDescription projectDescription = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription, _function_2);
projectDescription.attachToEmfObject(it_1);
Map<String, ResourceDescriptionsData> _emptyMap = CollectionLiterals.<String, ResourceDescriptionsData>emptyMap();
final ChunkedResourceDescriptions index = new ChunkedResourceDescriptions(_emptyMap, it_1);
index.setContainer(projectDescription.getName(), newIndex);
};
XtextResourceSet _doubleArrow = ObjectExtensions.<XtextResourceSet>operator_doubleArrow(_get, _function_1);
it.setResourceSet(_doubleArrow);
it.setDirtyFiles(Collections.<URI>unmodifiableList(CollectionLiterals.<URI>newArrayList()));
it.setDeletedFiles(Collections.<URI>unmodifiableList(CollectionLiterals.<URI>newArrayList()));
final BuildRequest.IPostValidationCallback _function_2 = (URI uri, Iterable<Issue> issues) -> {
Iterables.<Issue>addAll(this.issues, issues);
return IterableExtensions.isEmpty(issues);
};
it.setAfterValidate(_function_2);
final Procedure1<URI> _function_3 = (URI it_1) -> {
this.deleted.add(it_1);
};
it.setAfterDeleteFile(_function_3);
final Procedure2<URI, URI> _function_4 = (URI source, URI target) -> {
this.generated.put(source, target);
};
it.setAfterGenerateFile(_function_4);
Source2GeneratedMapping _copy = this.indexState.getFileMappings().copy();
IndexState _indexState = new IndexState(newIndex, _copy);
it.setState(_indexState);
};
final BuildRequest result = ObjectExtensions.<BuildRequest>operator_doubleArrow(_buildRequest, _function);
init.apply(result);
return result;
}
use of org.eclipse.xtext.resource.impl.ProjectDescription in project xtext-core by eclipse.
the class BuildOrderTest method testCycle.
@Test
public void testCycle() {
ProjectDescription _projectDescription = new ProjectDescription();
final Procedure1<ProjectDescription> _function = (ProjectDescription it) -> {
it.setName("a");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("b", "c")));
};
final ProjectDescription a = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription, _function);
ProjectDescription _projectDescription_1 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_1 = (ProjectDescription it) -> {
it.setName("b");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("c", "d")));
};
final ProjectDescription b = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_1, _function_1);
ProjectDescription _projectDescription_2 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_2 = (ProjectDescription it) -> {
it.setName("c");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("d")));
};
final ProjectDescription c = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_2, _function_2);
ProjectDescription _projectDescription_3 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_3 = (ProjectDescription it) -> {
it.setName("d");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("b")));
};
final ProjectDescription d = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_3, _function_3);
ProjectDescription _projectDescription_4 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_4 = (ProjectDescription it) -> {
it.setName("e");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList()));
};
final ProjectDescription e = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_4, _function_4);
final ArrayList<ProjectDescription> cyclic = CollectionLiterals.<ProjectDescription>newArrayList();
final Procedure1<ProjectDescription> _function_5 = (ProjectDescription it) -> {
cyclic.add(it);
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(e)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d, e)), _function_5));
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(b, d, c, a)), cyclic);
}
use of org.eclipse.xtext.resource.impl.ProjectDescription in project xtext-core by eclipse.
the class BuildOrderTest method testDiamond.
@Test
public void testDiamond() {
ProjectDescription _projectDescription = new ProjectDescription();
final Procedure1<ProjectDescription> _function = (ProjectDescription it) -> {
it.setName("a");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("b", "c")));
};
final ProjectDescription a = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription, _function);
ProjectDescription _projectDescription_1 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_1 = (ProjectDescription it) -> {
it.setName("b");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("c")));
};
final ProjectDescription b = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_1, _function_1);
ProjectDescription _projectDescription_2 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_2 = (ProjectDescription it) -> {
it.setName("c");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("d")));
};
final ProjectDescription c = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_2, _function_2);
ProjectDescription _projectDescription_3 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_3 = (ProjectDescription it) -> {
it.setName("d");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList()));
};
final ProjectDescription d = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_3, _function_3);
final Procedure1<ProjectDescription> _function_4 = (ProjectDescription it) -> {
Assert.fail();
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), _function_4));
}
use of org.eclipse.xtext.resource.impl.ProjectDescription in project xtext-core by eclipse.
the class BuildOrderTest method testChain.
@Test
public void testChain() {
ProjectDescription _projectDescription = new ProjectDescription();
final Procedure1<ProjectDescription> _function = (ProjectDescription it) -> {
it.setName("a");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("b")));
};
final ProjectDescription a = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription, _function);
ProjectDescription _projectDescription_1 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_1 = (ProjectDescription it) -> {
it.setName("b");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("c")));
};
final ProjectDescription b = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_1, _function_1);
ProjectDescription _projectDescription_2 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_2 = (ProjectDescription it) -> {
it.setName("c");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("d")));
};
final ProjectDescription c = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_2, _function_2);
ProjectDescription _projectDescription_3 = new ProjectDescription();
final Procedure1<ProjectDescription> _function_3 = (ProjectDescription it) -> {
it.setName("d");
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList()));
};
final ProjectDescription d = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_3, _function_3);
final Procedure1<ProjectDescription> _function_4 = (ProjectDescription it) -> {
Assert.fail();
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), _function_4));
}
Aggregations