Java Code Examples for org.eclipse.xtext.resource.impl.ProjectDescription#getName()

The following examples show how to use org.eclipse.xtext.resource.impl.ProjectDescription#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProjectBuildOrderInfo.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
/** Computes the build order of all projects in the workspace */
protected void computeOrder(ProjectDescription pd, LinkedHashSet<String> orderedProjects,
		LinkedHashSet<String> projectStack) {

	String pdName = pd.getName();
	if (projectStack.contains(pdName)) {
		for (String cyclicPD : projectStack) {
			reportDependencyCycle(cyclicPD);
		}
	} else {
		projectStack.add(pdName);

		for (String depName : pd.getDependencies()) {
			XProjectManager pm = workspaceManager.getProjectManager(depName);
			if (pm != null) { // can be null if project not on disk
				ProjectDescription depPd = pm.getProjectDescription();
				computeOrder(depPd, orderedProjects, projectStack);
			}
		}

		orderedProjects.add(pdName);
		projectStack.remove(pdName);
	}
}
 
Example 2
Source File: XBuildManager.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Run a full build on the workspace
 *
 * @return the delta.
 */
public List<IResourceDescription.Delta> doInitialBuild(List<ProjectDescription> projects,
		CancelIndicator indicator) {

	lspLogger.log("Initial build ...");

	ProjectBuildOrderInfo projectBuildOrderInfo = projectBuildOrderInfoProvider.get();
	ProjectBuildOrderIterator pboIterator = projectBuildOrderInfo.getIterator(projects);
	printBuildOrder();

	List<IResourceDescription.Delta> result = new ArrayList<>();

	while (pboIterator.hasNext()) {
		ProjectDescription description = pboIterator.next();
		String projectName = description.getName();
		XProjectManager projectManager = workspaceManager.getProjectManager(projectName);
		XBuildResult partialresult = projectManager.doInitialBuild(indicator);
		result.addAll(partialresult.getAffectedResources());
	}

	lspLogger.log("... initial build done.");

	return result;
}
 
Example 3
Source File: BuildOrderTest.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public String asString(final List<ProjectDescription> list) {
  final Function1<ProjectDescription, String> _function = (ProjectDescription it) -> {
    return it.getName();
  };
  return IterableExtensions.join(ListExtensions.<ProjectDescription, String>map(list, _function), ", ");
}