Search in sources :

Example 1 with SourcePathProvider

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

the class ParserDB method create.

public static void create() {
    final Runnable x = new Runnable() {

        @Override
        public void run() {
            ParserDB.running = true;
            try {
                ParserDB.db = new ParserDB();
                // out = new PrintStream(
                // new File("/home/qvladum/parserDB.txt"));
                ParserDB.out = System.out;
                final IErlModel model = ErlangEngine.getInstance().getModel();
                final Collection<SourcePathProvider> sourcePathProviders = SourcePathUtils.getSourcePathProviders();
                final long time = System.currentTimeMillis();
                ParserDB.db.run(model, sourcePathProviders, false);
                System.out.println(" took " + (System.currentTimeMillis() - time) / 1000);
            } catch (final Exception e) {
                ErlLogger.error(e);
            }
            ParserDB.running = false;
        }
    };
    if (!ParserDB.running) {
        new Thread(x).start();
    }
}
Also used : IErlModel(org.erlide.engine.model.root.IErlModel) SourcePathProvider(org.erlide.engine.model.root.SourcePathProvider) ErlModelException(org.erlide.engine.model.ErlModelException)

Example 2 with SourcePathProvider

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

the class ParserDB method getTestSourcePaths.

public List<String> getTestSourcePaths(final Collection<SourcePathProvider> sourcePathProviders, final Collection<IErlProject> projects) {
    final List<String> spaths = Lists.newArrayList();
    for (final IErlProject project : projects) {
        final Set<IPath> paths = Sets.newHashSet();
        for (final SourcePathProvider provider : sourcePathProviders) {
            final IProject resource = (IProject) project.getResource();
            paths.addAll(provider.getSourcePathsForModel(resource));
        }
        for (final IPath path : paths) {
            spaths.add(path.toPortableString());
        }
    }
    Collections.sort(spaths);
    return spaths;
}
Also used : IErlProject(org.erlide.engine.model.root.IErlProject) IPath(org.eclipse.core.runtime.IPath) SourcePathProvider(org.erlide.engine.model.root.SourcePathProvider) IProject(org.eclipse.core.resources.IProject)

Example 3 with SourcePathProvider

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

the class SourcePathUtils method getExtraSourcePathsGeneric.

private static Collection<IPath> getExtraSourcePathsGeneric(final IProject project, final SPPMethod method) {
    final List<IPath> result = Lists.newArrayList();
    Collection<SourcePathProvider> spps;
    try {
        spps = SourcePathUtils.getSourcePathProviders();
        for (final SourcePathProvider spp : spps) {
            method.setTarget(spp);
            final Collection<IPath> paths = method.call(project);
            result.addAll(paths);
        }
    } catch (final Exception e) {
        ErlLogger.error(e);
    }
    return result;
}
Also used : IPath(org.eclipse.core.runtime.IPath) SourcePathProvider(org.erlide.engine.model.root.SourcePathProvider)

Aggregations

SourcePathProvider (org.erlide.engine.model.root.SourcePathProvider)3 IPath (org.eclipse.core.runtime.IPath)2 IProject (org.eclipse.core.resources.IProject)1 ErlModelException (org.erlide.engine.model.ErlModelException)1 IErlModel (org.erlide.engine.model.root.IErlModel)1 IErlProject (org.erlide.engine.model.root.IErlProject)1