use of org.eclipse.cdt.core.settings.model.ICProjectDescription in project arduino-eclipse-plugin by Sloeber.
the class SloeberProject method getTargetFile.
public IFile getTargetFile() {
// I assume the extension is .hex as the Arduino Framework does not provide the
// extension nor a key for the uploadable sketch (=build target)
// as currently this method is only used for network upload via yun this is ok
// nor now
CCorePlugin cCorePlugin = CCorePlugin.getDefault();
ICProjectDescription prjCDesc = cCorePlugin.getProjectDescription(myProject);
String activeConfig = prjCDesc.getActiveConfiguration().getName();
return myProject.getFolder(activeConfig).getFile(myProject.getName() + ".hex");
}
use of org.eclipse.cdt.core.settings.model.ICProjectDescription in project arduino-eclipse-plugin by Sloeber.
the class SloeberProject method configure.
public void configure() {
CCorePlugin cCorePlugin = CCorePlugin.getDefault();
ICProjectDescription prjCDesc = cCorePlugin.getProjectDescription(myProject);
configure(prjCDesc, false);
}
use of org.eclipse.cdt.core.settings.model.ICProjectDescription in project arduino-eclipse-plugin by Sloeber.
the class SloeberProject method sloeberCfgChanged.
/**
* Call this method when the sloeber.cfg file changed
*/
public void sloeberCfgChanged() {
CCorePlugin cCorePlugin = CCorePlugin.getDefault();
ICProjectDescription projDesc = cCorePlugin.getProjectDescription(myProject);
ICConfigurationDescription activeConfig = projDesc.getActiveConfiguration();
myIsInMemory = false;
boolean projDescNeedsSaving = configure(projDesc, true);
Helpers.deleteBuildFolder(myProject, activeConfig.getName());
projDescNeedsSaving = projDescNeedsSaving || setActiveConfig(activeConfig);
if (projDescNeedsSaving) {
try {
cCorePlugin.setProjectDescription(myProject, projDesc);
} catch (CoreException e) {
e.printStackTrace();
}
}
}
use of org.eclipse.cdt.core.settings.model.ICProjectDescription in project arduino-eclipse-plugin by Sloeber.
the class SloeberProject method setActiveConfigInRunnable.
/**
* This method set the active configuration This means the core and library
* folders of the project are updated. To avoid many update notifications this
* is done in a runnable with AVOID_UPDATE
*
* @param confDesc
* a writable configuration setting to be made active
*
* @return true if the configuration setting has been changed and needs tioo be
* saved
*/
private boolean setActiveConfigInRunnable(ICConfigurationDescription confDesc) {
class MyRunnable implements ICoreRunnable {
public boolean projConfMustBeSaved = false;
@Override
public void run(IProgressMonitor internalMonitor) throws CoreException {
projConfMustBeSaved = setActiveConfig(confDesc);
}
}
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
MyRunnable runnable = new MyRunnable();
try {
workspace.run(runnable, root, IWorkspace.AVOID_UPDATE, null);
} catch (Exception e) {
ICProjectDescription projDesc = confDesc.getProjectDescription();
String confDescName = confDesc.getName();
String projName = projDesc.getProject().getName();
Common.log(new Status(IStatus.INFO, io.sloeber.core.Activator.getId(), "Setting config " + confDescName + " for project " + projName + " failed", // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
e));
}
return runnable.projConfMustBeSaved;
}
use of org.eclipse.cdt.core.settings.model.ICProjectDescription in project arduino-eclipse-plugin by Sloeber.
the class CDT_EnvironmentVariableResolver method getConfigurationDescription.
/**
* Find the active configuration of the project selected in the project manager
*
* @return The configuration description or null if not found
*/
private static ICConfigurationDescription getConfigurationDescription() {
IProject project = getGUISelectedProject();
if (project != null && project.exists() && project.isOpen()) {
CCorePlugin cCorePlugin = CCorePlugin.getDefault();
ICProjectDescription prjCDesc = cCorePlugin.getProjectDescription(project);
return prjCDesc.getActiveConfiguration();
}
return null;
}
Aggregations