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, EnvironmentVariablesAwareBuilder, MutableEnvironmentVariablesAwareBuilder, BambooPluginModule, BuilderV2, ConfigurablePlugin, java.io.Serializable

public class AntBuilder
extends AbstractBuilder

This class provides an Ant version of Builder.

See Also:
Serialized Form

Field Summary
static java.lang.String KEY
           
static java.lang.String KEY_PREFIX
           
protected  java.lang.String myAntHome
           
static java.lang.String NAME
           
static java.lang.String PARAM_BUILD_FILE
           
static java.lang.String PARAM_TARGET
           
static java.lang.String PATHHELP
           
 
Fields inherited from class com.atlassian.bamboo.builder.AbstractBuilder
BUILD_SUCCESSFUL_MARKER, buildDirectoryManager, DEFAULT_TEST_REPORTS_XML, errorUpdateHandler, FIND_SUCCESS_MESSAGE_IN_LAST, PARAM_BUILD_LABEL, PARAM_BUILDJDK, PARAM_ENV_VAR, PARAM_HASTESTS, PARAM_HOME, PARAM_TEST_RESULTS_DIRECTORY, PARAM_WORKING_SUB_DIR, templateRenderer, velocityManager
 
Fields inherited from class com.atlassian.bamboo.command.Command
buildLoggerManager, substitutionBean
 
Fields inherited from interface com.atlassian.bamboo.builder.Builder
CAPABILITY_BUILDER_PREFIX, CAPABILITY_BUILDER_TYPE
 
Constructor Summary
AntBuilder()
           
 
Method Summary
 java.util.Map<java.lang.String,LabelPathMap> addDefaultLabelPathMaps(java.util.Map<java.lang.String,LabelPathMap> labelPathMaps)
           
 void addDefaultValues(BuildConfiguration configuration)
          Extension point for adding default values to the form for #getEditHtml()
 java.lang.String getBuildFile()
          Which build file are we using
 org.apache.tools.ant.types.Commandline getCommandLine(ReadOnlyCapabilitySet capabilitySet)
          Get the command line to execite the ant build

protected  java.lang.String[] getCustomEnvironmentVars(ReadOnlyCapabilitySet capabilitySet)
           
 java.util.Map<java.lang.String,java.lang.String> getFullParams()
          Gets the full params that's used to persist.
 java.lang.String getName()
          Returns a human readable version of the current Builder type
 java.lang.String getPath(ReadOnlyCapabilitySet capabilitySet)
          The home path of the builder's command line
 java.lang.String getPathHelp()
          Help text for the builder type
 java.lang.String getTarget()
          Which task does the build execute?
 java.lang.String getUrl()
          Deprecated. assume we are not using these anymore - andy?
 boolean hasPassed(int returnCode, int buildNumber, java.lang.String planKey)
          Determines based on the return code and/or logs whether the build has passed.
 boolean isPathValid(java.lang.String homeDirectory)
          Does the home dir contain /bin/ant?
 void setBuildFile(java.lang.String buildFile)
          Set the ant build file
 void setParams(FilteredMap filteredBuilderParams)
          Updates the current builder object with
 void setTarget(java.lang.String target)
          Define the the task that the build will execute.
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Validates the properties in the BuildConfiguration object.
 ErrorCollection validate(FilteredMap filteredParams)
          Check that the builder's mandatory properties have been configured correctly.
 
Methods inherited from class com.atlassian.bamboo.builder.AbstractBuilder
collateTestResults, customiseLabelTypeMap, customizeBuildRequirements, executeBuild, getBuildDir, getBuildJdk, getCompleteKey, getEditHtml, getEnvironmentVariables, getFilteredParams, getKey, getLabel, getTemplateContext, getTestChecked, getTestResultsDirectory, getViewHtml, getWorkingDirectory, getWorkingSubDirectory, hasTests, init, isJdkValid, isLabelPathMapConfigurable, outputEndsWith, populateBuildErrors, prepareConfigObject, runBuild, setAdministrationConfiguration, setBuildDir, setBuildDirectoryManager, setBuildJdk, setEnvironmentVariables, setErrorUpdateHandler, setHasTests, setJdkManager, setKey, setLabel, setTemplateRenderer, setTestChecked, setTestResultsDirectory, setVelocityManager, setWorkingSubDirectory, toString, validate
 
Methods inherited from class com.atlassian.bamboo.command.Command
executeCommand, getBuildLoggerManager, getEnvironmentSetting, getVariableSubstitutionBean, isExecutableExists, isWindowsPlatform, setBuildLoggerManager, setVariableSubstitutionBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final java.lang.String KEY
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

PATHHELP

public static final java.lang.String PATHHELP
See Also:
Constant Field Values

myAntHome

protected transient java.lang.String myAntHome

PARAM_TARGET

public static final java.lang.String PARAM_TARGET
See Also:
Constant Field Values

PARAM_BUILD_FILE

public static final java.lang.String PARAM_BUILD_FILE
See Also:
Constant Field Values

KEY_PREFIX

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

AntBuilder

public AntBuilder()
Method Detail

getName

@NotNull
public java.lang.String getName()
Description copied from interface: Builder
Returns a human readable version of the current Builder type

Returns:

getPathHelp

@NotNull
public java.lang.String getPathHelp()
Description copied from interface: Builder
Help text for the builder type

Specified by:
getPathHelp in interface Builder
Overrides:
getPathHelp in class AbstractBuilder
Returns:

setParams

public void setParams(@NotNull
                      FilteredMap filteredBuilderParams)
Description copied from interface: Builder
Updates the current builder object with

Specified by:
setParams in interface Builder
Overrides:
setParams in class AbstractBuilder
Parameters:
filteredBuilderParams - - Filtered Map with the prefix builder key stripped out

getUrl

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


hasPassed

public boolean hasPassed(int returnCode,
                         int buildNumber,
                         java.lang.String planKey)
Description copied from interface: BuilderV2
Determines based on the return code and/or logs whether the build has passed. Implementors should log how they came up with their conclusions -

Specified by:
hasPassed in interface BuilderV2
Overrides:
hasPassed in class AbstractBuilder
Parameters:
returnCode - return code from build execution command
planKey - @return true if build has passed

getCommandLine

public org.apache.tools.ant.types.Commandline getCommandLine(ReadOnlyCapabilitySet capabilitySet)
Get the command line to execite the ant build

Specified by:
getCommandLine in class Command
Parameters:
capabilitySet -
Returns:
command line

getCustomEnvironmentVars

protected java.lang.String[] getCustomEnvironmentVars(ReadOnlyCapabilitySet capabilitySet)
Overrides:
getCustomEnvironmentVars in class Command

setBuildFile

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

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

getBuildFile

public java.lang.String getBuildFile()
Which build file are we using

Returns:
The ant build file

setTarget

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

Parameters:
target - The build task/goal

getTarget

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

Returns:
The build's task/goal

getPath

@NotNull
public java.lang.String getPath(ReadOnlyCapabilitySet capabilitySet)
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

@NotNull
public java.util.Map<java.lang.String,java.lang.String> getFullParams()
Description copied from interface: Builder
Gets the full params that's used to persist.

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.

Specified by:
validate in class AbstractBuilder
Parameters:
filteredParams -
Returns:
The Errors to be placed on the web page

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        BuildConfiguration buildConfiguration)
Description copied from interface: ConfigurablePlugin
Validates the properties in the BuildConfiguration object. The name of the properties match those passed in through the form fragments in #getEditHtml() template.

Parameters:
buildConfiguration - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

addDefaultValues

public void addDefaultValues(@NotNull
                             BuildConfiguration configuration)
Description copied from interface: ConfigurablePlugin
Extension point for adding default values to the form for #getEditHtml()

Parameters:
configuration - - @NotNull

addDefaultLabelPathMaps

public java.util.Map<java.lang.String,LabelPathMap> addDefaultLabelPathMaps(java.util.Map<java.lang.String,LabelPathMap> labelPathMaps)
Returns:

isPathValid

public boolean isPathValid(@Nullable
                           java.lang.String homeDirectory)
Does the home dir contain /bin/ant?

Parameters:
homeDirectory -
Returns:
true if valid


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.