1 37 package net.sourceforge.cruisecontrol.bootstrappers; 38 39 import net.sourceforge.cruisecontrol.Bootstrapper; 40 import net.sourceforge.cruisecontrol.CruiseControlException; 41 import net.sourceforge.cruisecontrol.builders.AntBuilder; 42 import net.sourceforge.cruisecontrol.builders.Property; 43 import org.apache.log4j.Logger; 44 import org.jdom.Attribute; 45 import org.jdom.Element; 46 47 import java.util.HashMap ; 48 49 57 public class AntBootstrapper implements Bootstrapper { 58 59 private static final Logger LOG = Logger.getLogger(AntBootstrapper.class); 60 61 private AntBuilder delegate = new AntBuilder(); 62 63 66 public void bootstrap() throws CruiseControlException { 67 Element result = delegate.build(new HashMap ()); 68 if (result == null) { 69 LOG.error("Bootstrap failed.\n\n"); 70 } else { 71 Attribute error = result.getAttribute("error"); 72 if (error == null) { 73 LOG.info("Bootstrap successful."); 74 } else { 75 LOG.error("Bootstrap failed.\n\n" 76 + error.getValue() 77 + "\n"); 78 } 79 } 80 } 81 82 public void validate() throws CruiseControlException { 83 delegate.validate(); 84 } 85 86 89 public void setSaveLogDir(String dir) { 90 delegate.setSaveLogDir(dir); 91 } 92 93 96 public void setAntWorkingDir(String dir) { 97 delegate.setAntWorkingDir(dir); 98 } 99 100 103 public void setAntScript(String antScript) { 104 delegate.setAntScript(antScript); 105 } 106 107 110 public void setAntHome(String antHome) { 111 delegate.setAntHome(antHome); 112 } 113 114 117 public void setTempFile(String tempFileName) { 118 delegate.setTempFile(tempFileName); 119 } 120 121 124 public void setTarget(String target) { 125 delegate.setTarget(target); 126 } 127 128 131 public void setBuildFile(String buildFile) { 132 delegate.setBuildFile(buildFile); 133 } 134 135 138 public void setUseLogger(boolean useLogger) { 139 delegate.setUseLogger(useLogger); 140 } 141 142 145 public Object createJVMArg() { 146 return delegate.createJVMArg(); 147 } 148 149 152 public Property createProperty() { 153 return delegate.createProperty(); 154 } 155 156 159 public void setUseDebug(boolean debug) { 160 delegate.setUseDebug(debug); 161 } 162 163 166 public void setUseQuiet(boolean quiet) { 167 delegate.setUseQuiet(quiet); 168 } 169 170 173 public String getLoggerClassName() { 174 return delegate.getLoggerClassName(); 175 } 176 177 180 public void setLoggerClassName(String string) { 181 delegate.setLoggerClassName(string); 182 } 183 184 187 public void setTimeout(long timeout) { 188 delegate.setTimeout(timeout); 189 } 190 } 191 | Popular Tags |