KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > actions > ejb > BuildOneEjbActionDelegate


1 package com.bull.eclipse.jonas.actions.ejb;
2
3 import java.io.File JavaDoc;
4
5 import org.eclipse.jdt.core.IPackageFragment;
6
7 import com.bull.eclipse.jonas.JonasLauncherPlugin;
8 import com.bull.eclipse.jonas.JonasProject;
9 import com.bull.eclipse.jonas.actions.JonasPackageAbstractActionDelegate;
10 import com.bull.eclipse.jonas.utils.AntUtils;
11 import com.bull.eclipse.jonas.utils.EjbManagement;
12 import com.bull.eclipse.jonas.utils.UpdatePropsFile;
13
14
15
16 public class BuildOneEjbActionDelegate extends JonasPackageAbstractActionDelegate
17 {
18
19     public boolean doActionOn(IPackageFragment pack) throws Exception JavaDoc {
20         // Update build.properties with JONAS_ROOT
21
JonasProject jp = (JonasProject)pack.getJavaProject().getProject().getNature(JonasLauncherPlugin.NATURE_ID);
22         UpdatePropsFile.updatePropsProject(jp);
23
24         String JavaDoc projDir = jp.getProject().getFullPath().toOSString();
25         String JavaDoc packName = pack.getPath().removeFirstSegments(1).toOSString();
26         String JavaDoc buildFile = projDir + File.separator + packName + File.separator + "build.xml";
27         AntUtils.runAnt(buildFile);
28
29         // Deploy EJB
30
// String packEJB = pack.getPath().removeFirstSegments(2).toOSString();
31
// String ejbName = EjbManagement.getEjbName(packEJB,(JonasProject)pack.getJavaProject().getProject().getNature(JonasLauncherPlugin.NATURE_ID));
32
//TODO DeployEjbActionDelegate.deploy(ejbName + ".jar");
33

34         return false;
35     }
36
37 }
38
39
Popular Tags