com.atlassian.bamboo.builder
Class AntBuilder

java.lang.Object
  extended by com.atlassian.bamboo.command.Command
      extended by com.atlassian.bamboo.builder.AbstractBuilder
          extended by com.atlassian.bamboo.builder.AntBuilder
All Implemented Interfaces:
Builder
Direct Known Subclasses:
VersionNineteenToVersionTwentyUpgrader.CustomAntBuilder

public class AntBuilder
extends AbstractBuilder

This class provides an Ant version of Builder.


Field Summary
static String KEY
           
static String KEY_PREFIX
           
protected  String myAntHome
           
static String NAME
           
static String PARAM_BUILD_FILE
           
static String PARAM_TARGET
           
static String PATHHELP
           
 
Fields inherited from class com.atlassian.bamboo.builder.AbstractBuilder
builderManager, DEFAULT_TEST_REPORTS_XML, PARAM_BUILD_LABEL, PARAM_BUILDJDK, PARAM_ENV_VAR, PARAM_HASTESTS, PARAM_HOME, PARAM_TEST_RESULTS_DIRECTORY, PARAM_WORKING_SUB_DIR, pluginManager, templateRenderer, velocityManager
 
Constructor Summary
AntBuilder()
           
 
Method Summary
 Map addDefaultLabelPathMaps(Map labelPathMaps)
           
 void addDefaultValues(BuildConfiguration configuration)
           
 String getBuildFile()
          Which build file are we using
 Commandline getCommandLine()
          Get the command line to execite the ant build

 Map getFullParams()
          Subclasses should extend this method rather than Builder.getFilteredParams() since it calls back on this method (getFillParams)
 String getKey()
           
 String getName()
           
 String getPath()
          The home path of the builder's command line
 String getPathHelp()
           
 String getTarget()
          Which task does the build execute?
 String getUrl()
          Deprecated. assume we are not using these anymore - andy?
protected  boolean hasPassed(int returnCode)
           
 boolean isPathValid(String homeDirectory)
          Does the home dir contain /bin/ant?
 void setBuildFile(String buildFile)
          Set the ant build file
 void setParams(FilteredMap filteredBuilderParams)
           
 void setTarget(String target)
          Define the the task that the build will execute.
 ErrorCollection validate(BuildConfiguration buildConfiguration)
           
 ErrorCollection validate(FilteredMap filteredParams)
          Check that the builder's mandatory properties have been configured correctly.
 
Methods inherited from class com.atlassian.bamboo.builder.AbstractBuilder
build, collateTestResults, customiseLabelPathMaps, filterParameters, getAdminConfig, getBuildJdk, getCompleteKey, getEditHtml, getEnvironmentVariables, getFilteredParams, getFreemarkerEditHtml, getLabel, getTemplateContext, getTestChecked, getTestResultsDirectory, getViewHtml, getWorkingDirectory, getWorkingSubDirectory, hasTests, init, isLabelPathMapConfigurable, outputEndsWith, setAdminConfig, setBuildDir, setBuilderManager, setBuildJdk, setEnvironmentVariables, setHasTests, setLabel, setPluginManager, setTemplateRenderer, setTestChecked, setTestResultsDirectory, setVelocityManager, setWorkingSubDirectory, toString, validate
 
Methods inherited from class com.atlassian.bamboo.command.Command
executeCommand, getEnvironmentSetting, getErrorOutput, getOutput, hasErrors, isExecutableExists, isWindowsPlatform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

PATHHELP

public static final String PATHHELP
See Also:
Constant Field Values

myAntHome

protected transient String myAntHome

PARAM_TARGET

public static final String PARAM_TARGET
See Also:
Constant Field Values

PARAM_BUILD_FILE

public static final String PARAM_BUILD_FILE
See Also:
Constant Field Values

KEY_PREFIX

public static final String KEY_PREFIX
See Also:
Constant Field Values
Constructor Detail

AntBuilder

public AntBuilder()
Method Detail

getName

public String getName()

getKey

public String getKey()
Returns:
The simple key of this builder.

getPathHelp

public String getPathHelp()
Specified by:
getPathHelp in interface Builder
Overrides:
getPathHelp in class AbstractBuilder

setParams

public void setParams(FilteredMap filteredBuilderParams)
Specified by:
setParams in interface Builder
Overrides:
setParams in class AbstractBuilder

getUrl

public String getUrl()
Deprecated. assume we are not using these anymore - andy?


hasPassed

protected boolean hasPassed(int returnCode)
Overrides:
hasPassed in class AbstractBuilder

getCommandLine

public Commandline getCommandLine()
Get the command line to execite the ant build

Specified by:
getCommandLine in class Command
Returns:
command line

setBuildFile

public void setBuildFile(String buildFile)
Set the ant build file

Parameters:
buildFile - name of the build's build file

getBuildFile

public String getBuildFile()
Which build file are we using

Returns:
The ant build file

setTarget

public void setTarget(String target)
Define the the task that the build will execute.

Parameters:
target - The build task/goal

getTarget

public String getTarget()
Which task does the build execute?

Returns:
The build's task/goal

getPath

public String getPath()
Description copied from interface: Builder
The home path of the builder's command line

Specified by:
getPath in interface Builder
Overrides:
getPath in class AbstractBuilder
Returns:
The path

getFullParams

public Map getFullParams()
Description copied from interface: Builder
Subclasses should extend this method rather than Builder.getFilteredParams() since it calls back on this method (getFillParams)

Specified by:
getFullParams in interface Builder
Overrides:
getFullParams in class AbstractBuilder
Returns:
Map key by the full param key (e.g. builder.ant.label). Never null

validate

public ErrorCollection validate(FilteredMap filteredParams)
Check that the builder's mandatory properties have been configured correctly.

Parameters:
filteredParams -
Returns:
The Errors to be placed on the web page

validate

public ErrorCollection validate(BuildConfiguration buildConfiguration)

addDefaultValues

public void addDefaultValues(BuildConfiguration configuration)

addDefaultLabelPathMaps

public Map addDefaultLabelPathMaps(Map labelPathMaps)

isPathValid

public boolean isPathValid(String homeDirectory)
Does the home dir contain /bin/ant?

Parameters:
homeDirectory -
Returns:
true if valid


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.