use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class ErlProject method addExternals.
private void addExternals(final List<IErlElement> children) {
final ErlangProjectProperties myProperties = getProperties();
final String externalIncludes = myProperties.getExternalIncludes();
final String externalModules = myProperties.getExternalModules();
final Collection<IPath> includeDirs = myProperties.getIncludeDirs();
final List<String> projectIncludes = Lists.newArrayList();
for (final IPath path : new PathResolver().resolvePaths(includeDirs)) {
if (path.isAbsolute() && !fProject.getLocation().isPrefixOf(path)) {
final Collection<String> includes = ErlangEngine.getInstance().getOpenService().getIncludesInDir(path.toPortableString());
if (includes != null) {
for (final String include : includes) {
projectIncludes.add(path.append(include).toPortableString());
}
}
}
}
if (!externalIncludes.isEmpty() || !externalModules.isEmpty() || !projectIncludes.isEmpty()) {
final IErlExternalRoot external = new ErlExternalReferenceEntryList(this, "Externals", externalIncludes, projectIncludes, externalModules);
children.add(external);
}
}
use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class ErlideTestUtils method createErlProject.
public static IErlProject createErlProject(final String name) throws CoreException {
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
final IProject project2 = root.getProject(name);
try {
project2.delete(true, null);
} catch (final CoreException x) {
// ignore
}
final IErlProject erlProject = ErlangEngine.getInstance().getModel().newProject(name);
erlProject.getBuilderProperties().setBuilderTool(BuilderTool.INTERNAL);
final IProject project = erlProject.getWorkspaceProject();
final ErlangProjectProperties prefs = erlProject.getProperties();
final List<IPath> srcDirs = new ArrayList<>();
ErlideTestUtils.createFolder(project2, "src");
srcDirs.add(new Path("src"));
prefs.setSourceDirs(srcDirs);
ErlideTestUtils.buildPaths(root, project, srcDirs);
final List<IPath> includeDirs = new ArrayList<>();
ErlideTestUtils.createFolder(project2, "include");
includeDirs.add(new Path("include"));
ErlideTestUtils.buildPaths(root, project, includeDirs);
prefs.setIncludeDirs(includeDirs);
ErlideTestUtils.createFolder(project2, "ebin");
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 EmakeConfiguratorTest method sourceDirectoriesShouldBeConfigured.
@Test
public void sourceDirectoriesShouldBeConfigured() {
final StringConcatenation _builder = new StringConcatenation();
_builder.append("{\'src1/*\',[debug_info]}.");
_builder.newLine();
_builder.append("{\'src2/*\',[debug_info]}.");
_builder.newLine();
final String input = _builder.toString();
final ErlangProjectProperties actual = configurator.decodeConfig(input);
final Path _path = new Path("src1");
final Path _path_1 = new Path("src2");
Truth.<IPath, Iterable<IPath>>assertThat(actual.getSourceDirs()).containsAtLeastElementsIn(Collections.<Object>unmodifiableList(CollectionLiterals.<Object>newArrayList(_path, _path_1)));
}
use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class EmakeConfiguratorTest method includeDirectoriesShouldBeConfigured.
@Test
public void includeDirectoriesShouldBeConfigured() {
final StringConcatenation _builder = new StringConcatenation();
_builder.append("{\'src1/*\',[debug_info,{i,\"myinclude\"}]}.");
_builder.newLine();
final String input = _builder.toString();
final ErlangProjectProperties actual = configurator.decodeConfig(input);
final IterableSubject _assertThat = Truth.<IPath, Iterable<IPath>>assertThat(actual.getIncludeDirs());
final Path _path = new Path("myinclude");
_assertThat.contains(_path);
}
use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.
the class RebarConfiguratorTest method handleMultipleOptions.
@Test
public void handleMultipleOptions() {
final StringConcatenation _builder = new StringConcatenation();
_builder.append("{erl_opts, [{i, \"inc1\"}]}.");
_builder.newLine();
_builder.append("{erl_opts, [{src_dirs, [\"src1\", \"src2\"]}]}.");
_builder.newLine();
_builder.append("{erl_opts, [{i, \"inc2\"}]}.");
_builder.newLine();
_builder.append("{erl_opts, [{src_dirs, [\"src3\", \"src4\"]}]}.");
_builder.newLine();
final String input = _builder.toString();
final ErlangProjectProperties actual = configurator.decodeConfig(input);
final Path _path = new Path("inc1");
final Path _path_1 = new Path("inc2");
Truth.<IPath, Iterable<IPath>>assertThat(actual.getIncludeDirs()).containsAtLeastElementsIn(Collections.<Object>unmodifiableList(CollectionLiterals.<Object>newArrayList(_path, _path_1)));
final Path _path_2 = new Path("src3");
final Path _path_3 = new Path("src4");
Truth.<IPath, Iterable<IPath>>assertThat(actual.getSourceDirs()).containsAtLeastElementsIn(Collections.<Object>unmodifiableList(CollectionLiterals.<Object>newArrayList(_path_2, _path_3)));
}
Aggregations