1
0
Fork 0
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:
Mikhail Sennikovsky 2007-06-14 11:27:21 +00:00
parent 22f4e30577
commit ad7f173337

View file

@ -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;
}
}