use of com.liferay.ide.service.core.job.BuildServiceJob in project liferay-ide by liferay.
the class BuildServiceHandler method executeServiceBuild.
protected IStatus executeServiceBuild(IProject project) {
IStatus retval = null;
try {
new BuildServiceJob(project).schedule();
retval = Status.OK_STATUS;
} catch (Exception e) {
retval = ServiceCore.createErrorStatus("Unable to execute build-service command", e);
}
return retval;
}
use of com.liferay.ide.service.core.job.BuildServiceJob in project liferay-ide by liferay.
the class BuildServicesActionHandler method run.
@Override
protected Object run(Presentation context) {
Element modelElement = context.part().getModelElement();
IFile file = modelElement.adapt(IFile.class);
if (FileUtil.exists(file)) {
if (ServiceUIUtil.shouldCreateServiceBuilderJob(file)) {
new BuildServiceJob(file.getProject()).schedule();
}
} else {
MessageDialog.openWarning(((SwtPresentation) context).shell(), Msgs.buildServices, Msgs.actionUnavailableImportProject);
}
return null;
}
use of com.liferay.ide.service.core.job.BuildServiceJob in project liferay-ide by liferay.
the class UpgradeServiceBuilderHandler method execute.
@Override
public Status execute(IProject project, String runtimeName, IProgressMonitor monitor, int perUnit) {
Status retval = Status.createOkStatus();
try {
int worked = 0;
IProgressMonitor submon = CoreUtil.newSubMonitor(monitor, 25);
submon.subTask("Executing build-service for " + project.getName());
worked = worked + perUnit;
submon.worked(worked);
BuildServiceJob job = new BuildServiceJob(project);
job.schedule();
job.join();
IStatus result = job.getResult();
if (!result.isOK()) {
throw new CoreException(result);
}
worked = worked + perUnit;
submon.worked(worked);
} catch (Exception e) {
IStatus error = ServiceCore.createErrorStatus("Unable to run service build task for " + project.getName(), e);
ServiceCore.logError("Unable to run service build task for " + project.getName(), e);
retval = StatusBridge.create(error);
}
return retval;
}
Aggregations