use of io.sloeber.core.api.CompileOptions in project arduino-eclipse-plugin by Sloeber.
the class RegressionTest method is_extern_C_taken_into_account.
/**
* If a .ino file is defining defines before including a include this should
* be handled properly by the ino to cpp parser
* @throws Exception
*/
@SuppressWarnings("static-method")
@Test
public void is_extern_C_taken_into_account() throws Exception {
PackageManager.installLatestPlatform("package_index.json", "arduino", "Arduino AVR Boards");
Map<String, String> unoOptions = new HashMap<>();
BoardDescriptor unoBoardid = PackageManager.getBoardDescriptor("package_index.json", "arduino", "Arduino AVR Boards", "uno", unoOptions);
IProject theTestProject = null;
String projectName = "defines_and_includes";
IPath templateFolder = Shared.getTemplateFolder(projectName);
CodeDescriptor codeDescriptor = CodeDescriptor.createCustomTemplate(templateFolder);
NullProgressMonitor monitor = new NullProgressMonitor();
try {
theTestProject = unoBoardid.createProject(projectName, null, ConfigurationDescriptor.getDefaultDescriptors(), codeDescriptor, new CompileOptions(null), monitor);
// for the indexer
Shared.waitForAllJobsToFinish();
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
if (Shared.hasBuildErrors(theTestProject)) {
fail("Failed to compile the project:" + projectName + " defines have not been taken into account properly.");
}
} catch (Exception e) {
e.printStackTrace();
fail("Failed to create the project:" + projectName);
return;
}
}
use of io.sloeber.core.api.CompileOptions in project arduino-eclipse-plugin by Sloeber.
the class CompileProperties method createControls.
@Override
public void createControls(Composite parent, ICPropertyProvider provider) {
super.createControls(parent, provider);
this.myCompileOptions = new CompileOptions(getConfdesc());
GridLayout theGridLayout = new GridLayout();
theGridLayout.numColumns = 2;
this.usercomp.setLayout(theGridLayout);
// checkbox show all warnings => Set WARNING_LEVEL=wall else
// WARNING_LEVEL=$ARDUINO_WARNING_LEVEL
this.myWarningLevel = new Button(this.usercomp, SWT.CHECK);
this.myWarningLevel.setText(Messages.ui_show_all_warnings);
this.myWarningLevel.setEnabled(true);
this.myWarningLevel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
// checkbox show alternative size
this.mySizeCommand = new Button(this.usercomp, SWT.CHECK);
this.mySizeCommand.setText(Messages.ui_Alternative_size);
this.mySizeCommand.setEnabled(true);
this.mySizeCommand.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
;
createLine(this.usercomp, 2);
this.myCAndCppCommand = makeOptionField(Messages.ui_Apend_c_cpp, Messages.ui_append_c_cpp_text);
this.myCppCommand = makeOptionField(Messages.ui_append_cpp, Messages.ui_append_cpp_text);
this.myCCommand = makeOptionField(Messages.ui_append_c, Messages.ui_append_c_text);
this.myAssemblyCommand = makeOptionField(Messages.ui_Apend_assembly, Messages.ui_append_assembly_text);
this.myArchiveCommand = makeOptionField(Messages.ui_Apend_archive, Messages.ui_append_archive_text);
this.myLinkCommand = makeOptionField(Messages.ui_Apend_link, Messages.ui_append_link_text);
this.myAllCommand = makeOptionField(Messages.ui_Apend_all, Messages.ui_append_all_text);
theGridLayout = new GridLayout();
theGridLayout.numColumns = 2;
this.usercomp.setLayout(theGridLayout);
updateScreenData();
setVisible(true);
}
use of io.sloeber.core.api.CompileOptions in project arduino-eclipse-plugin by Sloeber.
the class CompileProperties method performDefaults.
@Override
protected void performDefaults() {
this.myCompileOptions = new CompileOptions(null);
updateScreenData();
}
Aggregations