use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class ErlideTestUtils method createErlProject.
public static IErlProject createErlProject(final IProject project) throws CoreException {
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
final IErlProject erlProject = ErlangEngine.getInstance().getModel().findProject(project);
erlProject.getBuilderProperties().setBuilderTool(BuilderTool.INTERNAL);
final ErlangProjectProperties prefs = erlProject.getProperties();
final List<IPath> srcDirs = new ArrayList<>();
srcDirs.add(new Path("src"));
prefs.setSourceDirs(srcDirs);
ErlideTestUtils.buildPaths(root, project, srcDirs);
final List<IPath> includeDirs = new ArrayList<>();
includeDirs.add(new Path("include"));
ErlideTestUtils.buildPaths(root, project, includeDirs);
prefs.setIncludeDirs(includeDirs);
final IPath ebinDir = new Path("ebin");
ErlideTestUtils.buildPaths(root, project, Lists.newArrayList(ebinDir));
prefs.setOutputDir(ebinDir);
ErlideTestUtils.projects.add(erlProject);
return erlProject;
}
use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class ErlProjectPropertiesTest method equalsTest.
@Test
public void equalsTest() {
final ErlangProjectProperties p1 = new ErlangProjectProperties();
final ErlangProjectProperties p2 = new ErlangProjectProperties();
assertThat(p2).isEqualTo(p1);
}
use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class IErlProjectTest method setProperties.
// TODO check more properties than source dirs property
@Test
public void setProperties() throws Exception {
final IErlProject aProject = ErlModelTestBase.projects[0];
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());
} finally {
((ErlProject) aProject).setSourceDirs(sourceDirs);
}
}
use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class RebarProjectConfigurationTest method configCanBeParsed.
@Override
@Test
public void configCanBeParsed() throws CoreException {
project.setConfigType(ProjectConfigType.REBAR);
project.storeAllProperties();
setFileContent(ProjectConfigType.REBAR.getConfigName(), "");
final IProjectConfigurator persister = ProjectConfiguratorFactory.getDefault().getConfig(project.getConfigType(), project);
final ProjectConfigurationSerializer configurator = ((FileProjectConfigurator) persister).getSerializer();
final ErlangProjectProperties expected = new ErlangProjectProperties();
expected.setOutputDir(new Path("ebin"));
final ErlangProjectProperties actual = configurator.decodeConfig("");
assertThat(actual).isEqualTo(expected);
}
use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class EmakeConfiguratorTest method multipleIncludeDirectoriesShouldBeConfigured.
@Test
public void multipleIncludeDirectoriesShouldBeConfigured() {
final StringConcatenation _builder = new StringConcatenation();
_builder.append("{\'src1/*\',[debug_info,{i, \"myinclude\"}, {i, \"myinclude2\"}]}.");
_builder.newLine();
final String input = _builder.toString();
final ErlangProjectProperties actual = configurator.decodeConfig(input);
final Path _path = new Path("myinclude");
final Path _path_1 = new Path("myinclude2");
Truth.<IPath, Iterable<IPath>>assertThat(actual.getIncludeDirs()).containsAtLeastElementsIn(Collections.<Object>unmodifiableList(CollectionLiterals.<Object>newArrayList(_path, _path_1)));
}
Aggregations