Package org.erlide.engine.model.root

Examples of org.erlide.engine.model.root.ErlangProjectProperties


    }
    body.setChildren(((IHandle[])Conversions.unwrapArray(erlProjects, IHandle.class)));
  }
 
  public ErlangProjectProperties getProjectProperties(final IProject project) {
    return new ErlangProjectProperties();
  }
View Full Code Here


  }
 
  public IErlProject getProject(final String name) {
    IWorkspaceRoot _root = this.workspace.getRoot();
    IProject _project = _root.getProject(name);
    ErlangProjectProperties _erlangProjectProperties = new ErlangProjectProperties();
    return new ErlProject(this, _project, _erlangProjectProperties);
  }
View Full Code Here

  }
 
  public void clean(final IErlProject erlProject, final BuildNotifier notifier) {
    final IProject project = erlProject.getWorkspaceProject();
    MarkerUtils.removeProblemMarkersFor(project);
    ErlangProjectProperties _properties = erlProject.getProperties();
    IPath _outputDir = _properties.getOutputDir();
    final IFolder bf = project.getFolder(_outputDir);
    final Procedure1<IFolder> _function = new Procedure1<IFolder>() {
      public void apply(final IFolder it) {
        try {
          boolean _exists = it.exists();
View Full Code Here

        this.node = node;
        this.oldNode = oldNode;
    }

    public ErlangProjectProperties getConfiguration(final IEclipsePreferences aNode) {
        final ErlangProjectProperties result = new ErlangProjectProperties();

        final String sourceDirsStr = aNode.get(ProjectPreferencesConstants.SOURCE_DIRS,
                ProjectPreferencesConstants.DEFAULT_SOURCE_DIRS);
        result.setSourceDirs(PathSerializer.unpackList(sourceDirsStr));
        final String includeDirsStr = aNode.get(ProjectPreferencesConstants.INCLUDE_DIRS,
                ProjectPreferencesConstants.DEFAULT_INCLUDE_DIRS);
        result.setIncludeDirs(PathSerializer.unpackList(includeDirsStr));
        final String outputDirStr = aNode.get(ProjectPreferencesConstants.OUTPUT_DIR,
                ProjectPreferencesConstants.DEFAULT_OUTPUT_DIR);
        final String outputStr = outputDirStr.replaceAll(";", "");
        result.setOutputDir(new Path(outputStr));
        result.setRequiredRuntimeVersion(RuntimeVersion.Serializer.parse(aNode.get(
                ProjectPreferencesConstants.RUNTIME_VERSION, null)));
        if (!result.getRequiredRuntimeVersion().isDefined()) {
            result.setRequiredRuntimeVersion(ProjectPreferencesConstants.FALLBACK_RUNTIME_VERSION);
        }
        result.setExternalModulesFile(aNode.get(
                ProjectPreferencesConstants.PROJECT_EXTERNAL_MODULES,
                ProjectPreferencesConstants.DEFAULT_EXTERNAL_MODULES));
        result.setExternalIncludesFile(aNode.get(
                ProjectPreferencesConstants.EXTERNAL_INCLUDES,
                ProjectPreferencesConstants.DEFAULT_EXTERNAL_INCLUDES));
        return result;
    }
View Full Code Here

        return result;
    }

    @Override
    public ErlangProjectProperties getConfiguration(final IPath baseDir) {
        ErlangProjectProperties result = null;
        // new config takes precedence
        if (hasData(node)) {
            result = getConfiguration(node);
        } else if (hasData(oldNode)) {
            result = getConfiguration(oldNode);
            setConfiguration(result);
            try {
                oldNode.removeNode();
                // oldNode.flush();
            } catch (final BackingStoreException e) {
                // ignore, projects may be read-only
                ErlLogger
                        .warn("Could not delete old project configuration, is project read-only? "
                                + e.getMessage());
            }
        } else {
            result = getConfiguration(node);
        }
        result.setBaseDir(baseDir);
        return result;
    }
View Full Code Here

            // couldn't we just assume all links in external files should be
            // matchable?
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            final IErlProject erlProject = model.findProject(project);
            if (erlProject != null) {
                final ErlangProjectProperties properties = erlProject.getProperties();
                final String extMods = properties.getExternalModules();
                final List<String> files = new ArrayList<String>();
                files.addAll(PreferencesUtils.unpackList(extMods));
                final String extIncs = properties.getExternalIncludes();
                files.addAll(PreferencesUtils.unpackList(extIncs));

                final IPathVariableManager pvm = ResourcesPlugin.getWorkspace()
                        .getPathVariableManager();
                for (final String file : files) {
View Full Code Here

    @Test
    public void setProperties() throws Exception {
        final IErlProject aProject = project2;
        final Collection<IPath> sourceDirs = aProject.getProperties().getSourceDirs();
        try {
            final ErlangProjectProperties properties = aProject.getProperties();
            final IPath srcx = new Path("srcx");
            properties.setSourceDirs(Lists.newArrayList(srcx));
            aProject.setProperties(properties);
            final Collection<IPath> sourceDirs2 = aProject.getProperties()
                    .getSourceDirs();
            assertEquals(1, sourceDirs2.size());
            assertEquals(srcx, sourceDirs2.iterator().next());
View Full Code Here

                return true;
            }

            final IPath path = resource.getParent().getProjectRelativePath();
            final String ext = resource.getFileExtension();
            final ErlangProjectProperties properties = erlProject.getProperties();
            if (properties.getSourceDirs().contains(path)) {
                if (ERL.equals(ext)) {
                    handleErlFile(kind, resource);
                    return false;
                }
                if (YRL.equals(ext)) {
                    handleYrlFile(kind, resource);
                    return false;
                }
            }
            if (properties.getIncludeDirs().contains(path) && HRL.equals(ext)) {
                try {
                    handleHrlFile(kind, resource, fullBuild);
                } catch (final ErlModelException e) {
                    ErlLogger.warn(e);
                }
                return false;
            }
            if (properties.getOutputDir().equals(path) && BEAM.equals(ext)) {
                try {
                    handleBeamFile(kind, resource);
                } catch (final CoreException e) {
                    ErlLogger.warn(e);
                }
View Full Code Here

        assertThat(prj, is(not(nullValue())));

        final IErlProject erlPrj = ErlangEngine.getInstance().getModel().findProject(prj);
        assertThat(erlPrj, is(not(nullValue())));

        final ErlangProjectProperties props = erlPrj.getProperties();
        assertThat(props.getOutputDir(), is((IPath) new Path("ebin")));

    }
View Full Code Here

        assertThat(prj, is(not(nullValue())));

        final IErlProject erlPrj = ErlangEngine.getInstance().getModel().findProject(prj);
        assertThat(erlPrj, is(not(nullValue())));

        final ErlangProjectProperties props = erlPrj.getProperties();
        assertThat(props.getSourceDirs(),
                contains((IPath) new Path("src"), (IPath) new Path("foz")));

        final IResource r = prj.findMember(ProjectConfigType.REBAR.getConfigName());
        assertThat(r, is(not(nullValue())));
        assertThat("config file doesn't exist", r.exists());
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.root.ErlangProjectProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.