mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Backward compatibility fix: saveBuildInfo should NOT fail in case the root rule can not be obtained
This commit is contained in:
parent
22f4e30577
commit
ad7f173337
1 changed files with 19 additions and 1 deletions
|
@ -1392,12 +1392,30 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
return true;
|
||||
}
|
||||
|
||||
public static boolean saveBuildInfo(IProject project, boolean force) {
|
||||
public static boolean saveBuildInfo(final IProject project, final boolean force) {
|
||||
try {
|
||||
return updateBuildInfo(project, force);
|
||||
} catch (CoreException e) {
|
||||
ManagedBuilderCorePlugin.log(e);
|
||||
return false;
|
||||
} catch (IllegalArgumentException e){
|
||||
//can not acquire the root rule
|
||||
Job j = new Job("save build info job"){
|
||||
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
updateBuildInfo(project, force);
|
||||
} catch (CoreException e) {
|
||||
return e.getStatus();
|
||||
}
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
||||
};
|
||||
j.setRule(ResourcesPlugin.getWorkspace().getRoot());
|
||||
j.setSystem(true);
|
||||
j.schedule();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue