1 17 package org.apache.forrest.eclipse.job; 18 19 import java.io.File ; 20 21 import org.apache.forrest.eclipse.ForrestPlugin; 22 import org.apache.forrest.eclipse.preference.ForrestPreferences; 23 import org.apache.log4j.Logger; 24 import org.eclipse.core.runtime.IProgressMonitor; 25 import org.eclipse.core.runtime.IStatus; 26 27 28 31 public class ForrestBuilder extends ForrestJob { 32 35 protected static final Logger logger = Logger.getLogger(ForrestBuilder.class); 36 37 private String skinName; 38 39 44 protected ForrestBuilder(String workingDir) { 45 super("Forrest Runner"); 46 this.workingDir = workingDir; 47 } 48 49 54 protected ForrestBuilder(String workingDir, String skinName) { 55 super("Forrest Runner"); 56 this.workingDir = workingDir; 57 this.skinName = skinName; 58 } 59 62 public IStatus run(IProgressMonitor monitor) { 63 if (logger.isDebugEnabled()) { 64 logger.debug("run(IProgressMonitor) - start"); 65 } 66 67 IStatus status = null; 68 String fhome = ForrestPlugin.getDefault().getPluginPreferences() 69 .getString(ForrestPreferences.FORREST_HOME); 70 StringBuffer sb = new StringBuffer ("-Dproject.home="); 71 sb.append(workingDir); 72 sb.append(" -Dbasedir="); 73 sb.append(fhome + File.separatorChar + "main"); 74 if (this.skinName != null) { 75 sb.append(" -Dproject.skin="); 76 sb.append("plain-dev"); 77 } 78 sb.append(" site"); 79 status = runAnt(monitor, sb.toString()); 80 return status; 81 } 82 83 } 84 | Popular Tags |