use of org.erlide.core.builder.CompilerOptions in project erlide_eclipse by erlang.
the class CompileAction method run.
@Override
public void run() {
final AbstractErlangEditor editor = (AbstractErlangEditor) getSite().getPage().getActiveEditor();
final IErlModule module = editor.getModule();
if (module == null) {
return;
}
final IResource resource = module.getResource();
final IProject project = resource.getProject();
if (project == null) {
return;
}
final IErlProject eproject = ErlangEngine.getInstance().getModelUtilService().getProject(module);
if (eproject == null) {
return;
}
final IOtpRpc b = BackendCore.getBuildBackend(eproject);
final BuildResource bres = new BuildResource(resource);
final CompilerOptions prefs = new CompilerOptions(project);
prefs.load();
final OtpErlangList compilerOptions = prefs.export();
final IErlProject erlProject = ErlangEngine.getInstance().getModel().getErlangProject(project);
if ("erl".equals(resource.getFileExtension())) {
helper.compileErl(project, bres, erlProject.getProperties().getOutputDir().toString(), b, compilerOptions);
}
if ("yrl".equals(resource.getFileExtension())) {
helper.compileYrl(project, bres, b, compilerOptions);
}
final ErlEditorActionBarContributor status = (ErlEditorActionBarContributor) editor.getEditorSite().getActionBarContributor();
status.displayMessage(String.format("File '%s' was compiled.", resource.getName()));
}
use of org.erlide.core.builder.CompilerOptions in project erlide_eclipse by erlang.
the class CompilerOptionsTest method test_8.
@Test
public void test_8() {
final CompilerOptions prefs = new CompilerOptions();
prefs.setBooleanOption(CompilerOptions.WARN_EXPORT_ALL, true);
final String actual = prefs.export().toString();
final String expect = "[" + CompilerOptionsTest.DEF_VALUES.substring(2) + "]";
Assert.assertEquals(expect, actual);
}
use of org.erlide.core.builder.CompilerOptions in project erlide_eclipse by erlang.
the class CompilerOptionsTest method test_10.
@Test
public void test_10() {
final CompilerOptions prefs = new CompilerOptions();
prefs.setPathOption(CompilerOptions.INCLUDE_DIRS, parseIncludes(""));
final String actual = prefs.export().toString();
final String expect = "[" + CompilerOptionsTest.DEF_VALUES + "]";
Assert.assertEquals(expect, actual);
}
use of org.erlide.core.builder.CompilerOptions in project erlide_eclipse by erlang.
the class CompilerOptionsTest method test_0.
@Test
public void test_0() {
final CompilerOptions prefs = new CompilerOptions();
final String actual = prefs.export().toString();
final String expect = "[" + CompilerOptionsTest.DEF_VALUES + "]";
Assert.assertEquals(expect, actual);
}
use of org.erlide.core.builder.CompilerOptions in project erlide_eclipse by erlang.
the class CompilerOptionsTest method test_11.
@Test
public void test_11() {
final CompilerOptions prefs = new CompilerOptions();
prefs.setPathOption(CompilerOptions.INCLUDE_DIRS, parseIncludes("/tmp/x"));
final String actual = prefs.export().toString();
final String expect = "[{i,\"/tmp/x\"}," + CompilerOptionsTest.DEF_VALUES + "]";
Assert.assertEquals(expect, actual);
}
Aggregations