Search in sources :

Example 1 with IGenerateConfig

use of org.metaborg.core.config.IGenerateConfig in project spoofax by metaborg.

the class DependencyPathProvider method sourcePaths.

@Override
public Iterable<FileObject> sourcePaths(IProject project, String languageName) throws MetaborgException {
    final Iterable<ILanguageComponent> dependencies = dependencyService.compileDeps(project);
    final Collection<FileObject> sources = Lists.newArrayList();
    for (ILanguageComponent dependency : dependencies) {
        final Collection<IGenerateConfig> generates = dependency.config().generates();
        for (IGenerateConfig generate : generates) {
            if (languageName.equals(generate.languageName())) {
                resolve(project.location(), Iterables2.singleton(generate.directory()), sources);
            }
        }
    }
    return sources;
}
Also used : IGenerateConfig(org.metaborg.core.config.IGenerateConfig) FileObject(org.apache.commons.vfs2.FileObject) ILanguageComponent(org.metaborg.core.language.ILanguageComponent)

Aggregations

FileObject (org.apache.commons.vfs2.FileObject)1 IGenerateConfig (org.metaborg.core.config.IGenerateConfig)1 ILanguageComponent (org.metaborg.core.language.ILanguageComponent)1