Search in sources :

Example 1 with BuilderHelper

use of org.erlide.core.builder.BuilderHelper in project erlide_eclipse by erlang.

the class DialyzerUtils method collectFilesAndIncludeDirs.

public static void collectFilesAndIncludeDirs(final Set<IErlModule> modules, final Set<IErlProject> projects, final Collection<String> files, final Collection<String> names, final Collection<IPath> includeDirs, final boolean fromSource) {
    for (final IErlModule m : modules) {
        final String name = m.getName();
        final IErlProject erlProject = ErlangEngine.getInstance().getModelUtilService().getProject(m);
        final IProject project = erlProject.getWorkspaceProject();
        final IFolder ebin = project.getFolder(erlProject.getProperties().getOutputDir());
        if (SourceKind.hasErlExtension(name)) {
            if (fromSource) {
                final IResource resource = m.getResource();
                files.add(resource.getLocation().toPortableString());
            } else {
                final String moduleName = SystemConfiguration.withoutExtension(name);
                final String beamName = moduleName + ".beam";
                final IResource beam = ebin.findMember(beamName);
                if (beam != null) {
                    files.add(beam.getLocation().toPortableString());
                    names.add(moduleName);
                }
            }
        }
    }
    DialyzerUtils.helper = new BuilderHelper();
    for (final IErlProject p : projects) {
        includeDirs.addAll(DialyzerUtils.helper.getIncludeDirs(p.getWorkspaceProject()));
    }
}
Also used : IErlProject(org.erlide.engine.model.root.IErlProject) BuilderHelper(org.erlide.core.builder.BuilderHelper) IErlModule(org.erlide.engine.model.root.IErlModule) IProject(org.eclipse.core.resources.IProject) IResource(org.eclipse.core.resources.IResource) IFolder(org.eclipse.core.resources.IFolder)

Aggregations

IFolder (org.eclipse.core.resources.IFolder)1 IProject (org.eclipse.core.resources.IProject)1 IResource (org.eclipse.core.resources.IResource)1 BuilderHelper (org.erlide.core.builder.BuilderHelper)1 IErlModule (org.erlide.engine.model.root.IErlModule)1 IErlProject (org.erlide.engine.model.root.IErlProject)1