Search in sources :

Example 1 with PathResolver

use of org.erlide.engine.model.root.PathResolver in project erlide_eclipse by erlang.

the class ErlProject method addExternals.

private void addExternals(final List<IErlElement> children) {
    final ErlangProjectProperties myProperties = getProperties();
    final String externalIncludes = myProperties.getExternalIncludes();
    final String externalModules = myProperties.getExternalModules();
    final Collection<IPath> includeDirs = myProperties.getIncludeDirs();
    final List<String> projectIncludes = Lists.newArrayList();
    for (final IPath path : new PathResolver().resolvePaths(includeDirs)) {
        if (path.isAbsolute() && !fProject.getLocation().isPrefixOf(path)) {
            final Collection<String> includes = ErlangEngine.getInstance().getOpenService().getIncludesInDir(path.toPortableString());
            if (includes != null) {
                for (final String include : includes) {
                    projectIncludes.add(path.append(include).toPortableString());
                }
            }
        }
    }
    if (!externalIncludes.isEmpty() || !externalModules.isEmpty() || !projectIncludes.isEmpty()) {
        final IErlExternalRoot external = new ErlExternalReferenceEntryList(this, "Externals", externalIncludes, projectIncludes, externalModules);
        children.add(external);
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) IErlExternalRoot(org.erlide.engine.model.root.IErlExternalRoot) PathResolver(org.erlide.engine.model.root.PathResolver)

Aggregations

IPath (org.eclipse.core.runtime.IPath)1 ErlangProjectProperties (org.erlide.engine.model.root.ErlangProjectProperties)1 IErlExternalRoot (org.erlide.engine.model.root.IErlExternalRoot)1 PathResolver (org.erlide.engine.model.root.PathResolver)1