use of com.liferay.ide.core.IBundleProject in project liferay-ide by liferay.
the class BundlePublishFullAdd method execute.
@Override
public void execute(IProgressMonitor monitor, IAdaptable info) throws CoreException {
for (IModule module : modules) {
IStatus retval = Status.OK_STATUS;
IProject project = module.getProject();
if (project == null) {
continue;
}
final IBundleProject bundleProject = LiferayCore.create(IBundleProject.class, project);
if (bundleProject != null) {
// TODO catch error in getOutputJar and show a popup notification instead
monitor.subTask("Building " + module.getName() + " output bundle...");
try {
IPath outputJar = bundleProject.getOutputBundle(cleanBuildNeeded(), monitor);
if (FileUtil.exists(outputJar)) {
if (server.getServerState() == IServer.STATE_STARTED) {
monitor.subTask("Remotely deploying " + module.getName() + " to Liferay module framework...");
retval = remoteDeploy(bundleProject.getSymbolicName(), outputJar);
} else {
retval = autoDeploy(outputJar);
}
portalServerBehavior.setModuleState2(new IModule[] { module }, IServer.STATE_STARTED);
} else {
retval = LiferayServerCore.error("Could not create output jar");
}
} catch (Exception e) {
retval = LiferayServerCore.error("Deploy module project error", e);
}
} else {
retval = LiferayServerCore.error("Unable to get bundle project for " + module.getProject().getName());
}
if (retval.isOK()) {
this.portalServerBehavior.setModulePublishState2(new IModule[] { module }, IServer.PUBLISH_STATE_NONE);
project.deleteMarkers(LiferayServerCore.BUNDLE_OUTPUT_ERROR_MARKER_TYPE, false, 0);
} else {
this.portalServerBehavior.setModulePublishState2(new IModule[] { module }, IServer.PUBLISH_STATE_NONE);
project.createMarker(LiferayServerCore.BUNDLE_OUTPUT_ERROR_MARKER_TYPE);
LiferayServerCore.logError(retval);
}
}
}
use of com.liferay.ide.core.IBundleProject in project liferay-ide by liferay.
the class MavenModuleProjectTests method testThemeProjectComponentConfiguration.
@Test
public void testThemeProjectComponentConfiguration() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("maven-theme-component-test");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("theme");
op.execute(ProgressMonitorBridge.create(new NullProgressMonitor()));
IProject project = CoreUtil.getProject("maven-theme-component-test");
assertNotNull(project);
IBundleProject bundleProject = LiferayCore.create(IBundleProject.class, project);
assertNotNull(bundleProject);
}
use of com.liferay.ide.core.IBundleProject in project liferay-ide by liferay.
the class MavenModuleProjectTests method verifyProject.
private void verifyProject(IProject project) throws Exception {
assertNotNull(project);
assertTrue(project.exists());
assertFalse(project.getFile("build.gradle").exists());
project.build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
waitForJobsToComplete();
project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
waitForJobsToComplete();
assertNoErrors(project);
IBundleProject bundleProject = LiferayCore.create(IBundleProject.class, project);
assertNotNull(bundleProject);
IPath outputBundle = bundleProject.getOutputBundle(true, monitor);
assertNotNull(outputBundle);
assertTrue(outputBundle.toFile().exists());
}
Aggregations