net.sourceforge.cruisecontrol.builders
Class PhingBuilder

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.util.PerDayScheduleItem
      extended bynet.sourceforge.cruisecontrol.Builder
          extended bynet.sourceforge.cruisecontrol.builders.PhingBuilder
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class PhingBuilder
extends Builder

See Also:
Serialized Form

Field Summary
protected static java.lang.String DEFAULT_LOGGER
           
 
Fields inherited from class net.sourceforge.cruisecontrol.util.PerDayScheduleItem
INVALID_NAME_OF_DAY, NOT_SET
 
Constructor Summary
PhingBuilder()
           
 
Method Summary
 org.jdom.Element build(java.util.Map buildProperties)
          build and return the results via xml.
 org.jdom.Element buildWithTarget(java.util.Map properties, java.lang.String buildTarget)
           
 Property createProperty()
           
protected  java.lang.String findPhingScript(boolean isWindows)
          If the phinghome attribute is set, then this method returns the correct shell script to use for a specific environment.
 java.lang.String getLoggerClassName()
           
protected static org.jdom.Element getPhingLogAsElement(java.io.File file)
           
 void setBuildFile(java.lang.String buildFile)
          Sets the name of the build file that Phing will use.
 void setLoggerClassName(java.lang.String string)
           
 void setPhingHome(java.lang.String antHome)
          If set CC will use the platform specific script provided by Phing
 void setPhingScript(java.lang.String phingScript)
          Sets the Phing script file to be invoked.
 void setPhingWorkingDir(java.lang.String dir)
          Set the working directory where Phing will be invoked.
 void setSaveLogDir(java.lang.String dir)
          Set the location to which the ant log will be saved before Cruise Control merges the file into its log.
 void setTarget(java.lang.String target)
          Set the Phing target(s) to invoke.
 void setTempFile(java.lang.String tempFileName)
          Set the name of the temporary file used to capture output.
 void setTimeout(long timeout)
           
 void setUseDebug(boolean debug)
           
 void setUseLogger(boolean useLogger)
          Sets whether Phing will use the custom loggers.
 void setUseQuiet(boolean quiet)
           
 void validate()
           
 
Methods inherited from class net.sourceforge.cruisecontrol.Builder
compareTo, getGroup, getMultiple, getTime, isValidDay, setGroup, setMultiple, setTime
 
Methods inherited from class net.sourceforge.cruisecontrol.util.PerDayScheduleItem
getDay, setDay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LOGGER

protected static final java.lang.String DEFAULT_LOGGER
See Also:
Constant Field Values
Constructor Detail

PhingBuilder

public PhingBuilder()
Method Detail

validate

public void validate()
              throws CruiseControlException
Overrides:
validate in class Builder
Throws:
CruiseControlException

build

public org.jdom.Element build(java.util.Map buildProperties)
                       throws CruiseControlException
build and return the results via xml. debug status can be determined from log4j category once we get all the logging in place.

Specified by:
build in class Builder
Throws:
CruiseControlException

buildWithTarget

public org.jdom.Element buildWithTarget(java.util.Map properties,
                                        java.lang.String buildTarget)
                                 throws CruiseControlException
Specified by:
buildWithTarget in class Builder
Throws:
CruiseControlException

setSaveLogDir

public void setSaveLogDir(java.lang.String dir)
Set the location to which the ant log will be saved before Cruise Control merges the file into its log.

Parameters:
dir - the absolute path to the directory where the ant log will be saved or relative path to where you started CruiseControl

setPhingWorkingDir

public void setPhingWorkingDir(java.lang.String dir)
Set the working directory where Phing will be invoked. This parameter gets set in the XML file via the phingWorkingDir attribute. The directory can be relative (to the cruisecontrol current working directory) or absolute.

Parameters:
dir - the directory to make the current working directory.

setPhingScript

public void setPhingScript(java.lang.String phingScript)
Sets the Phing script file to be invoked. This is a platform dependent script file.

Parameters:
phingScript - the name of the script file

setPhingHome

public void setPhingHome(java.lang.String antHome)
If set CC will use the platform specific script provided by Phing

Parameters:
antHome - the path to ANT_HOME

findPhingScript

protected java.lang.String findPhingScript(boolean isWindows)
                                    throws CruiseControlException
If the phinghome attribute is set, then this method returns the correct shell script to use for a specific environment.

Throws:
CruiseControlException

setTempFile

public void setTempFile(java.lang.String tempFileName)
Set the name of the temporary file used to capture output.


setTarget

public void setTarget(java.lang.String target)
Set the Phing target(s) to invoke.

Parameters:
target - the target(s) name.

setBuildFile

public void setBuildFile(java.lang.String buildFile)
Sets the name of the build file that Phing will use. The Phing default is build.xml, use this to override it.

Parameters:
buildFile - the name of the build file.

setUseLogger

public void setUseLogger(boolean useLogger)
Sets whether Phing will use the custom loggers.


createProperty

public Property createProperty()

getPhingLogAsElement

protected static org.jdom.Element getPhingLogAsElement(java.io.File file)
                                                throws CruiseControlException
Throws:
CruiseControlException

setUseDebug

public void setUseDebug(boolean debug)

setUseQuiet

public void setUseQuiet(boolean quiet)

getLoggerClassName

public java.lang.String getLoggerClassName()

setLoggerClassName

public void setLoggerClassName(java.lang.String string)

setTimeout

public void setTimeout(long timeout)
Parameters:
timeout - The timeout to set.