mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56: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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean saveBuildInfo(IProject project, boolean force) {
|
public static boolean saveBuildInfo(final IProject project, final boolean force) {
|
||||||
try {
|
try {
|
||||||
return updateBuildInfo(project, force);
|
return updateBuildInfo(project, force);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
ManagedBuilderCorePlugin.log(e);
|
ManagedBuilderCorePlugin.log(e);
|
||||||
return false;
|
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