// Set the environment variables
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
for (int i = 0; i < cfgNamesAndTCIds.size(); i++) {
ICConfigurationDescription configurationDescription = prjDesc.getConfigurationByName(cfgNamesAndTCIds.get(i).Name);
mArduinoPage.saveAllSelections(configurationDescription);
ArduinoHelpers.setTheEnvironmentVariables(project, configurationDescription, cfgNamesAndTCIds.get(i).DebugCompilerSettings);
}
// Set the path variables
ArduinoHelpers.setProjectPathVariables(project, mArduinoPage.getPlatformFolder());
// Intermediately save or the adding code will fail
// Release is the active config (as that is the "IDE" Arduino type....)
ICConfigurationDescription defaultConfigDescription = prjDesc.getConfigurationByName(cfgNamesAndTCIds.get(0).Name);
prjDesc.setActiveConfiguration(defaultConfigDescription);
// Insert The Arduino Code
// NOTE: Not duplicated for debug (the release reference is just to get at some environment variables)
ArduinoHelpers.addArduinoCodeToProject(project, defaultConfigDescription);
//
// add the correct files to the project
//
mNewArduinoSketchWizardCodeSelectionPage.createFiles(project, monitor);
//
// add the libraries to the project if needed
//
mNewArduinoSketchWizardCodeSelectionPage.importLibraries(project, prjDesc.getConfigurations());
ICResourceDescription cfgd = defaultConfigDescription.getResourceDescription(new Path(""), true);
ICExclusionPatternPathEntry[] entries = cfgd.getConfiguration().getSourceEntries();
if (entries.length == 1) {
Path exclusionPath[] = new Path[2];
exclusionPath[0] = new Path("Libraries/*/?xamples");
exclusionPath[1] = new Path("Libraries/*/?xtras");