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.AbstractJdkBuilder
              extended by com.atlassian.bamboo.builder.AntBuilder
All Implemented Interfaces:
Builder, EnvironmentVariablesAwareBuilder, MutableEnvironmentVariablesAwareBuilder, InitablePluginModule, BambooPluginModule, BuilderV2, ConfigurablePlugin, java.io.Serializable

public class AntBuilder
extends AbstractJdkBuilder

This class provides an Ant version of Builder.

See Also:
Serialized Form

Field Summary
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_FAILED_MARKER, BUILD_SUCCESSFUL_MARKER, buildDirectoryManager, DEFAULT_TEST_REPORTS_XML, errorUpdateHandler, FIND_FAILURE_MESSAGE_IN_LAST, FIND_SUCCESS_MESSAGE_IN_LAST, PARAM_BUILD_LABEL, PARAM_BUILDJDK, PARAM_ENV_VAR, PARAM_HASTESTS, PARAM_HOME, PARAM_PROJECT_FILE, PARAM_TEST_RESULTS_DIRECTORY, PARAM_WORKING_SUB_DIR, SEARCH_BUILD_SUCCESS_FAIL_MESSAGE_EVERYWHERE, templateRenderer
 
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 ConfigurablePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
 java.lang.String getBuildFile()
          Which build file are we using
 java.lang.String[] getCommandArguments(ReadOnlyCapabilitySet capabilitySet)
          What are the arguments for the command line to execute
 java.lang.String getCommandExecutable(ReadOnlyCapabilitySet capabilitySet)
          What is the executable for the command line to execute
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.AbstractJdkBuilder
customizeBuildRequirements, removeBuildRequirements
 
Methods inherited from class com.atlassian.bamboo.builder.AbstractBuilder
collateTestResults, customiseLabelTypeMap, executeBuild, getBuildDir, getBuildDirectoryManager, getBuildJdk, getCompleteKey, getEditHtml, getEnvironmentVariables, getFilteredParams, getKey, getKeyPrefix, getLabel, getProjectFile, getTemplateContext, getTestChecked, getTestResultsDirectory, getViewHtml, getWorkingDirectory, getWorkingSubDirectory, hasTests, init, isJdkValid, isLabelPathMapConfigurable, outputEndsWith, populateBuildErrors, prepareConfigObject, runBuild, setAdministrationConfiguration, setBuildDir, setBuildDirectoryManager, setBuildJdk, setBuildLogFileAccessorFactory, setEnvironmentVariables, setErrorUpdateHandler, setHasTests, setJdkManager, setKey, setLabel, setProjectFile, setTemplateRenderer, setTestChecked, setTestResultsDirectory, setWorkingSubDirectory, toString, validate
 
Methods inherited from class com.atlassian.bamboo.command.Command
decorateCommandLine, executeCommand, getBuildLoggerManager, getCommandLine, getEnvironmentSetting, getSubstitutedCommandLine, getVariableSubstitutionBean, isWindowsPlatform, setBuildLoggerManager, setPluginAccessor, setVariableSubstitutionBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
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

getCommandExecutable

@NotNull
public java.lang.String getCommandExecutable(ReadOnlyCapabilitySet capabilitySet)
What is the executable for the command line to execute

Overrides:
getCommandExecutable in class Command
Parameters:
capabilitySet - - for the local context
Returns:
the executable as a string

getCommandArguments

@NotNull
public java.lang.String[] getCommandArguments(ReadOnlyCapabilitySet capabilitySet)
What are the arguments for the command line to execute

Overrides:
getCommandArguments in class Command
Parameters:
capabilitySet - - for the local context
Returns:
the executable as a string[]. Spaces/division of strings in the array should not matter etc should not matter.

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 ConfigurablePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) 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 ConfigurablePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)

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 © 2010 Atlassian. All Rights Reserved.