use of org.eclipse.core.runtime.MultiStatus in project arduino-eclipse-plugin by Sloeber.
the class ArduinoGnuMakefileGenerator method regenerateMakefiles.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator#
* regenerateMakefiles()
*/
@Override
public MultiStatus regenerateMakefiles() throws CoreException {
MultiStatus status;
// Visit the resources in the project
ResourceProxyVisitor visitor = new ResourceProxyVisitor(this, this.config);
this.project.accept(visitor, IResource.NONE);
// See if the user has cancelled the build
checkCancel();
// in the project
if (getSubdirList().isEmpty()) {
String info = ManagedMakeMessages.getFormattedString("MakefileGenerator.warning.no.source", this.project.getName());
updateMonitor(info);
status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.INFO, new String(), null);
status.add(new Status(IStatus.INFO, ManagedBuilderCorePlugin.getUniqueIdentifier(), NO_SOURCE_FOLDERS, info, null));
return status;
}
// Create the top-level directory for the build output
this.topBuildDir = createDirectory(this.config.getName());
checkCancel();
// Get the list of subdirectories
IPath srcsFilePath = this.topBuildDir.append(SRCSFILE_NAME);
IFile srcsFileHandle = createFile(srcsFilePath);
this.buildSrcVars.clear();
this.buildOutVars.clear();
this.buildDepVars.clear();
this.topBuildOutVars.clear();
populateSourcesMakefile(srcsFileHandle);
checkCancel();
// Now populate the module makefiles
for (IResource res : getSubdirList()) {
IContainer subDir = (IContainer) res;
try {
populateFragmentMakefile(subDir);
} catch (CoreException e) {
// Probably should ask user if they want to continue
checkCancel();
continue;
}
checkCancel();
}
// Calculate the inputs and outputs of the Tools to be generated in the
// main makefile
calculateToolInputsOutputs();
checkCancel();
// Create the top-level makefile
IPath makefilePath = this.topBuildDir.append(MAKEFILE_NAME);
IFile makefileHandle = createFile(makefilePath);
populateTopMakefile(makefileHandle, true);
checkCancel();
// Now finish up by adding all the object files
IPath objFilePath = this.topBuildDir.append(OBJECTS_MAKFILE);
IFile objsFileHandle = createFile(objFilePath);
populateObjectsMakefile(objsFileHandle);
checkCancel();
// How did we do
if (!getInvalidDirList().isEmpty()) {
status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.WARNING, new String(), null);
// TODO: fix error message
for (IResource dir : getInvalidDirList()) {
status.add(new Status(IStatus.WARNING, ManagedBuilderCorePlugin.getUniqueIdentifier(), SPACES_IN_PATH, dir.getFullPath().toString(), null));
}
} else {
status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, new String(), null);
}
return status;
}
use of org.eclipse.core.runtime.MultiStatus in project arduino-eclipse-plugin by Sloeber.
the class PlatformSelectionPage method updateInstallation.
protected IStatus updateInstallation(IProgressMonitor monitor) {
MultiStatus status = new MultiStatus(Activator.getId(), 0, Messages.ui_installing_platforms, null);
PackageManager.setPlatformTree(this.myPlatformTree, monitor, status);
return status;
}
use of org.eclipse.core.runtime.MultiStatus in project n4js by eclipse.
the class WorkingSetManagerBrokerImpl method saveState.
@Override
public IStatus saveState(final IProgressMonitor monitor) {
final Collection<WorkingSetManager> managers = getWorkingSetManagers();
final SubMonitor subMonitor = SubMonitor.convert(monitor, managers.size() + 1);
final MultiStatus error = statusHelper.createMultiError("Error occurred while saving state.");
for (final WorkingSetManager manager : managers) {
final IStatus result = manager.saveState(subMonitor.newChild(1));
if (!result.isOK()) {
error.add(result);
}
}
final IStatus result = saveState();
if (!result.isOK()) {
error.add(result);
}
return Arrays2.isEmpty(error.getChildren()) ? statusHelper.OK() : error;
}
use of org.eclipse.core.runtime.MultiStatus in project n4js by eclipse.
the class WorkingSetManagerBrokerImpl method restoreState.
@Override
public IStatus restoreState(final IProgressMonitor monitor) {
final Collection<WorkingSetManager> managers = getWorkingSetManagers();
final SubMonitor subMonitor = SubMonitor.convert(monitor, managers.size() + 1);
final MultiStatus error = statusHelper.createMultiError("Error occurred while restoring state.");
for (final WorkingSetManager manager : managers) {
final IStatus result = manager.restoreState(subMonitor.newChild(1));
if (!result.isOK()) {
error.add(result);
}
}
final IStatus result = restoreState();
if (!result.isOK()) {
error.add(result);
}
return Arrays2.isEmpty(error.getChildren()) ? statusHelper.OK() : error;
}
use of org.eclipse.core.runtime.MultiStatus in project n4js by eclipse.
the class ExternalLibraryPreferencePage method runMaintananceActions.
/**
* Handler for executing maintenance action based on the provided {@link MaintenanceActionsChoice user choice}.
*/
private MultiStatus runMaintananceActions(final MaintenanceActionsChoice userChoice, IProgressMonitor monitor) {
final MultiStatus multistatus = statusHelper.createMultiStatus("Status of executing maintenance actions.");
// persist state for reinstall
Map<String, String> oldPackages = new HashMap<>();
if (userChoice.decisionReinstall)
oldPackages.putAll(getInstalledNpms());
// keep the order Cache->TypeDefs->NPMs->Reinstall->Update
// actions have side effects that can interact with each other
maintenanceCleanNpmCache(userChoice, multistatus, monitor);
maintenanceResetTypeDefinitions(userChoice, multistatus);
maintenanceDeleteNpms(userChoice, multistatus);
maintenanceReinstallNpms(userChoice, multistatus, monitor, oldPackages);
maintenanceUpateState(userChoice, multistatus, monitor);
return multistatus;
}
Aggregations