1 22 package org.enhydra.kelp.jbuilder.build; 23 24 import org.enhydra.kelp.ant.node.AntProject; 25 import com.borland.jbuilder.node.*; 26 import com.borland.primetime.build.*; 27 import com.borland.primetime.node.*; 28 29 public class CleanBuilder 30 extends Builder { 31 public CleanBuilder() {} 32 33 37 public static void initOpenTool(byte majorVersion, byte minorVersion) { 38 try { 39 BuilderManager.registerBuilder(new CleanBuilder()); 40 } 41 catch (Exception e) { 42 System.err.println(e.getMessage()); 43 } 44 } 45 46 49 public void updateBuildProcess(BuildProcess buildProcess, 50 Node nativeNode) { 51 CleanBuildTask task = null; 52 53 task = (CleanBuildTask) buildProcess.getFirstBuildTask(CleanBuildTask. 54 SHARED_KEY, CleanBuildTask.class); 55 if (task == null) { 56 buildProcess.createTask(CleanBuildTask.class, CleanBuildTask.SHARED_KEY); 57 task = null; 58 } 59 if (isMakeable(nativeNode)) { 60 String prjPath = buildProcess.getProject().getProjectPath().getFullName(); 61 try { 62 AntProject antProject = new AntProject(prjPath); 63 if (antProject.getProperty( 64 AntProject.DEPLOY_INVOKE).equalsIgnoreCase("true")) { 65 buildProcess.addDependency(CleanBuildTask.SHARED_KEY, 66 Phase.CLEAN_PHASE); 67 } 68 } 69 catch (Exception ex) { 70 ex.printStackTrace(); 71 } 72 } 73 } 74 75 public void endUpdateBuildProcess(BuildProcess buildProcess) { 76 77 } 78 79 public boolean isMakeable(Node node) { 80 if ((node instanceof JBProject) && 81 node.getProperty("enhydra.project", "false").equalsIgnoreCase("true") ) 82 return true; 83 else 84 return false; 85 } 86 } 87 | Popular Tags |