Search in sources :

Example 16 with ErlangProjectProperties

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

the class EmakeProjectConfigurationTest method configCanBeParsed.

@Override
@Test
public void configCanBeParsed() throws CoreException {
    project.setConfigType(ProjectConfigType.EMAKE);
    final IProjectConfigurator config = ProjectConfiguratorFactory.getDefault().getConfig(project.getConfigType(), project);
    final ErlangProjectProperties expected = ErlangProjectProperties.DEFAULT;
    final ErlangProjectProperties actual = config.getConfiguration();
    assertThat(actual).isEqualTo(expected);
}
Also used : IProjectConfigurator(org.erlide.engine.model.root.IProjectConfigurator) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) Test(org.junit.Test)

Example 17 with ErlangProjectProperties

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

the class RebarProjectConfigurationTest method propertiesShouldFollowConfigFileChange.

@Test
public void propertiesShouldFollowConfigFileChange() throws CoreException {
    project.setConfigType(ProjectConfigType.REBAR);
    final String cfgFile = ProjectConfigType.REBAR.getConfigName();
    final String config = getFileContent(cfgFile);
    final String config1 = config + "{erl_opts, [{i, \"myinclude\"}, " + "{src_dirs, [\"src\", \"src2\"]}]}.";
    setFileContent(cfgFile, config1);
    final ErlangProjectProperties p2 = project.getProperties();
    final Collection<IPath> actualSources = p2.getSourceDirs();
    assertThat(actualSources).hasSize(2);
    assertThat(actualSources).contains(new Path("src2"));
    final Collection<IPath> actualIncludes = p2.getIncludeDirs();
    assertThat(actualIncludes).hasSize(1);
    assertThat(actualIncludes).contains(new Path("myinclude"));
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) Test(org.junit.Test)

Example 18 with ErlangProjectProperties

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

the class ModuleLocatorTest method checkProjectDirectories.

private void checkProjectDirectories(final IErlProject project, final Object[] expectedSources, final Object[] expectedIncludes) {
    final ErlangProjectProperties properties = project.getProperties();
    Truth.<Object>assertThat(properties.getSourceDirs().toArray()).isEqualTo(expectedSources);
    Truth.<Object>assertThat(properties.getIncludeDirs().toArray()).isEqualTo(expectedIncludes);
}
Also used : ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties)

Example 19 with ErlangProjectProperties

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

the class BuildersTest method setupProject.

@Before
public void setupProject() throws CoreException {
    ErlideTestUtils.initProjects();
    prj = ErlideTestUtils.createProject("builders");
    ErlideTestUtils.createFolder(prj, "src");
    ErlideTestUtils.createFile(prj, "src/mod.erl", BuildersTest.MOD);
    ErlideTestUtils.createFolder(prj, "include");
    ErlideTestUtils.createFile(prj, "include/hdr.hrl", BuildersTest.HDR);
    ErlideTestUtils.createFile(prj, "src/builders.app.src", APP);
    ErlideTestUtils.createFile(prj, "Emakefile", BuildersTest.EMAKEFILE);
    ErlideTestUtils.createFile(prj, "Makefile", BuildersTest.MAKEFILE);
    prj.refreshLocal(IResource.DEPTH_INFINITE, null);
    final IErlProject erlPrj = ErlideTestUtils.createErlProject(prj);
    final ErlangProjectProperties properties = erlPrj.getProperties();
    final RuntimeVersion _runtimeVersion = new RuntimeVersion(18);
    properties.setRequiredRuntimeVersion(_runtimeVersion);
    erlPrj.setProperties(properties);
    ExternalBuilder.DEBUG = true;
}
Also used : IErlProject(org.erlide.engine.model.root.IErlProject) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) Before(org.junit.Before)

Example 20 with ErlangProjectProperties

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

the class NewProjectData method detectProjectConfig.

public String detectProjectConfig() {
    String _xblockexpression = null;
    {
        System.out.println("ยป DETECT builder config");
        String _xifexpression = null;
        if (location != null) {
            String _xblockexpression_1 = null;
            {
                System.out.println("DETECT builder config");
                final String _portableString = location.toPortableString();
                final File directory = new File(_portableString);
                String _xifexpression_1 = null;
                if (directory.isDirectory() && directory.exists()) {
                    String _xblockexpression_2 = null;
                    {
                        final IProjectConfigurator persister = factory.getConfig(configType, directory);
                        System.out.println("PERSISTER " + persister);
                        String _xifexpression_2 = null;
                        if (persister != null) {
                            String _xblockexpression_3 = null;
                            {
                                final ErlangProjectProperties props = persister.getConfiguration();
                                _xblockexpression_3 = "detected PROPS: " + props;
                                System.out.println(_xblockexpression_3);
                            }
                            _xifexpression_2 = _xblockexpression_3;
                        }
                        _xblockexpression_2 = _xifexpression_2;
                    }
                    _xifexpression_1 = _xblockexpression_2;
                }
                _xblockexpression_1 = _xifexpression_1;
            }
            _xifexpression = _xblockexpression_1;
        }
        _xblockexpression = _xifexpression;
    }
    return _xblockexpression;
}
Also used : IProjectConfigurator(org.erlide.engine.model.root.IProjectConfigurator) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) File(java.io.File)

Aggregations

ErlangProjectProperties (org.erlide.engine.model.root.ErlangProjectProperties)29 IPath (org.eclipse.core.runtime.IPath)21 Test (org.junit.Test)19 Path (org.eclipse.core.runtime.Path)18 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)10 IterableSubject (com.google.common.truth.IterableSubject)4 IErlProject (org.erlide.engine.model.root.IErlProject)4 IProjectConfigurator (org.erlide.engine.model.root.IProjectConfigurator)4 IProject (org.eclipse.core.resources.IProject)3 Subject (com.google.common.truth.Subject)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)2 CoreException (org.eclipse.core.runtime.CoreException)2 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)1 OtpErlangString (com.ericsson.otp.erlang.OtpErlangString)1 IResource (org.eclipse.core.resources.IResource)1 ProjectScope (org.eclipse.core.resources.ProjectScope)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)1