net.sourceforge.cruisecontrol.builders
Class RakeBuilder

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

public class RakeBuilder
extends Builder

Rake builder class based on the Ant and Exec builder classes.
Attempts to mimic the behavior of Ant builds using Ruby Rake.

Author:
Kirk Knoernschild - Provided without any warranty
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cruisecontrol.util.PerDayScheduleItem
INVALID_NAME_OF_DAY, NOT_SET
 
Constructor Summary
RakeBuilder()
           
 
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)
           
protected  RakeScript getRakeScript()
           
 void setBuildFile(java.lang.String buildFile)
          Sets the name of the build file that Rake will use.
 void setTarget(java.lang.String target)
          Set the Rake target(s) to invoke.
 void setTimeout(long timeout)
           
 void setWorkingDir(java.lang.String dir)
          Set the working directory where Rake will be invoked.
 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
 

Constructor Detail

RakeBuilder

public RakeBuilder()
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

setWorkingDir

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

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

setTarget

public void setTarget(java.lang.String target)
Set the Rake 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 Rake will use. The Rake default is rakefile or Rakefile. f the rakefile is not found in the current directory, rake will search parent directories for a match. The directory where the Rakefile is found will become the current directory for the actions executed in the Rakefile. Use this to set the rakefile for the build.

Parameters:
buildFile - the name of the build file.

setTimeout

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

getRakeScript

protected RakeScript getRakeScript()