Search in sources :

Example 1 with ISimpleProjectService

use of org.metaborg.core.project.ISimpleProjectService in project spoofax by metaborg.

the class CLIUtils method getOrCreateProject.

/**
 * Get or create project for the given resource
 */
public IProject getOrCreateProject(FileObject resource) throws MetaborgException {
    final ISimpleProjectService projectService = spoofax.injector.getInstance(ISimpleProjectService.class);
    final IProject project = projectService.get(resource);
    if (project == null) {
        return projectService.create(resource);
    }
    return project;
}
Also used : ISimpleProjectService(org.metaborg.core.project.ISimpleProjectService) IProject(org.metaborg.core.project.IProject)

Aggregations

IProject (org.metaborg.core.project.IProject)1 ISimpleProjectService (org.metaborg.core.project.ISimpleProjectService)1