}
@Override
protected void clean(IProgressMonitor monitor) throws CoreException {
try {
IProject myProject = getProject();
Project model = Central.getProject(myProject.getLocation().toFile());
if (model == null)
return;
// Delete everything in the target directory
File target = model.getTarget();
if (target.isDirectory() && target.getParentFile() != null) {
IO.delete(target);
if (!target.exists() && !target.mkdirs()) {
throw new IOException("Could not create directory " + target);
}
}
// Tell Eclipse what we did...
IFolder targetFolder = myProject.getFolder(calculateTargetDirPath(model));
targetFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (Exception e) {
throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, "Build Error!", e));
}
}