}
@Override
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
try {
WGADeploymentManager manager = WGADesignerPlugin.getDefault().getWGADeploymentManager();
WGADeployment deployment = manager.getDeployment(getProject().getName());
if (deployment != null) {
IResourceDelta delta = getDelta(getProject());
if (delta != null) {
if (WGADesignerPlugin.getDefault().isDebugging()) {
System.out.println("Incremental update of WGA deployment '" + deployment.getName() + "'.");
}
deployment.updateWGA(delta, monitor);
} else {
if (WGADesignerPlugin.getDefault().isDebugging()) {
System.out.println("Full update of WGA deployment '" + deployment.getName() + "'.");
}
deployment.updateWGA(getProject(), monitor);
}
} else {
manager.createDeployment(getProject(), monitor);
}
} catch (Exception e) {
throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to create or update wga deployment.", e));
}
return null;