|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.bamboo.command.Command
com.atlassian.bamboo.builder.AbstractBuilder
public abstract class AbstractBuilder
Common builder functionality.
Field Summary | |
---|---|
protected BuilderManager |
builderManager
|
protected static String |
DEFAULT_TEST_REPORTS_XML
|
static String |
PARAM_BUILD_LABEL
|
static String |
PARAM_BUILDJDK
|
static String |
PARAM_ENV_VAR
|
static String |
PARAM_HASTESTS
|
static String |
PARAM_HOME
|
static String |
PARAM_TEST_RESULTS_DIRECTORY
|
static String |
PARAM_WORKING_SUB_DIR
|
protected PluginManager |
pluginManager
|
protected TemplateRenderer |
templateRenderer
|
protected VelocityManager |
velocityManager
|
Constructor Summary | |
---|---|
protected |
AbstractBuilder()
|
Method Summary | |
---|---|
BuildResults |
build(Build build,
BuildResults buildInfo)
Build the given build |
void |
collateTestResults(BuildResults buildInfo)
temp will morph into a TestResultsHanlder on route to a plugin! |
Map |
customiseLabelPathMaps(Map labelPathMaps)
Allows the builder to add extra LabelPathMap objects as required |
Map |
filterParameters(Map incomingWebParams)
Filter the parameters the builder needs from the incoming web parameters. |
AdministrationConfiguration |
getAdminConfig()
|
String |
getBuildJdk()
Provide the UI form with the JDK the build needs to be built on |
String |
getCompleteKey()
Returns the full plugin descriptor key |
String |
getEditHtml(Map errors)
|
String |
getEnvironmentVariables()
Provides the ui form with the build's system environment variables |
FilteredMap |
getFilteredParams()
|
String |
getFreemarkerEditHtml(Map errors)
|
Map |
getFullParams()
Subclasses should extend this method rather than Builder.getFilteredParams() since it calls back on this method
(getFillParams) |
String |
getLabel()
What is the label used to getPrettyPrint this item in the GUI? |
String |
getPath()
The home path of the builder's command line |
String |
getPathHelp()
|
protected Map |
getTemplateContext()
|
String |
getTestChecked()
Informs the UI if the build is testless. |
String |
getTestResultsDirectory()
What are the build's junit test results stored? Can be a comma separated list |
String |
getViewHtml()
Returns the HTML representing the builder configuration for the build |
File |
getWorkingDirectory()
Get the location of the build file |
String |
getWorkingSubDirectory()
Return the optional working subdirectory |
protected boolean |
hasPassed(int returnCode)
|
boolean |
hasTests()
Does the build have any tests to be included in the build results web pages? |
void |
init(ModuleDescriptor moduleDescriptor)
Initialises the Builder with the plugin module descriptor |
boolean |
isLabelPathMapConfigurable()
Returns true if the Builder can have its LabelPathMap configurable. |
protected boolean |
outputEndsWith(int positionFromEnd,
String expectedText)
Utility method to check the output contained the expected success text |
void |
setAdminConfig(AdministrationConfiguration adminConfig)
|
void |
setBuildDir(File buildDirectory)
Where is the build file file? |
void |
setBuilderManager(BuilderManager builderManager)
|
void |
setBuildJdk(String buildJdk)
Define the JDK the build beeds to be built on. |
void |
setEnvironmentVariables(String envVars)
Define the system environment variabled required to build the build. |
void |
setHasTests(boolean hasTests)
Does the build have any tests to be included in the build results web pages? |
void |
setLabel(String label)
|
void |
setParams(FilteredMap filteredParams)
|
void |
setPluginManager(PluginManager pluginManager)
|
void |
setTemplateRenderer(TemplateRenderer templateRenderer)
|
void |
setTestChecked(String enabled)
The user has selected that the build has tests (via a checkbox) |
void |
setTestResultsDirectory(String testResultDirectory)
Let the builder specify the location of the build's test result files. |
void |
setVelocityManager(VelocityManager velocityManager)
|
void |
setWorkingSubDirectory(String workingSubDirectory)
Specify the working sub directory |
String |
toString()
Default toString simply displays the name so they can be slotted into drop down lists and such like. |
ErrorCollection |
validate()
Validate the Builder's current internal settings are still valid |
Methods inherited from class com.atlassian.bamboo.command.Command |
---|
executeCommand, getCommandLine, getEnvironmentSetting, getErrorOutput, getOutput, hasErrors, isExecutableExists, isWindowsPlatform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.atlassian.bamboo.builder.Builder |
---|
addDefaultLabelPathMaps, addDefaultValues, getKey, getName, isPathValid, validate, validate |
Field Detail |
---|
protected static final String DEFAULT_TEST_REPORTS_XML
public static final String PARAM_BUILD_LABEL
public static final String PARAM_HASTESTS
public static final String PARAM_TEST_RESULTS_DIRECTORY
public static final String PARAM_BUILDJDK
public static final String PARAM_HOME
public static final String PARAM_WORKING_SUB_DIR
public static final String PARAM_ENV_VAR
protected transient BuilderManager builderManager
protected transient VelocityManager velocityManager
protected transient TemplateRenderer templateRenderer
protected transient PluginManager pluginManager
Constructor Detail |
---|
protected AbstractBuilder()
Method Detail |
---|
public void setAdminConfig(AdministrationConfiguration adminConfig)
setAdminConfig
in interface Builder
public AdministrationConfiguration getAdminConfig()
public void setBuilderManager(BuilderManager builderManager)
setBuilderManager
in interface Builder
public void setVelocityManager(VelocityManager velocityManager)
public void setTemplateRenderer(TemplateRenderer templateRenderer)
public void setPluginManager(PluginManager pluginManager)
public void init(ModuleDescriptor moduleDescriptor)
Builder
init
in interface Builder
public String getCompleteKey()
Builder
getCompleteKey
in interface Builder
public String getPath()
Builder
getPath
in interface Builder
public String getEditHtml(Map errors)
getEditHtml
in interface Builder
public String getFreemarkerEditHtml(Map errors)
getFreemarkerEditHtml
in interface Builder
public boolean isLabelPathMapConfigurable()
Builder
LabelPathMap
configurable. If it can't be, it won't be displayed
on the ConfigureBuilder page.
isLabelPathMapConfigurable
in interface Builder
LabelPathMap
is configurablepublic Map customiseLabelPathMaps(Map labelPathMaps)
Builder
LabelPathMap
objects as required
customiseLabelPathMaps
in interface Builder
labelPathMaps
- may be nullprotected Map getTemplateContext()
public BuildResults build(Build build, BuildResults buildInfo)
Builder
build
in interface Builder
build
- The build to buildbuildInfo
- The change list that triggered the build
public void collateTestResults(BuildResults buildInfo)
Builder
collateTestResults
in interface Builder
protected boolean hasPassed(int returnCode)
public void setBuildDir(File buildDirectory)
setBuildDir
in interface Builder
buildDirectory
- The directory containing the build filepublic File getWorkingDirectory()
getWorkingDirectory
in class Command
public String getLabel()
getLabel
in interface Builder
public void setLabel(String label)
setLabel
in interface Builder
public String getTestResultsDirectory()
getTestResultsDirectory
in interface Builder
public void setTestResultsDirectory(String testResultDirectory)
testResultDirectory
- The location of the junit test result xml filespublic String getWorkingSubDirectory()
public void setWorkingSubDirectory(String workingSubDirectory)
public String toString()
toString
in class Object
public boolean hasTests()
hasTests
in interface Builder
public void setHasTests(boolean hasTests)
Builder
setHasTests
in interface Builder
hasTests
- True if the build should have tests.public void setTestChecked(String enabled)
enabled
- set to "on" by the webwork frameworkpublic String getTestChecked()
public void setEnvironmentVariables(String envVars)
setEnvironmentVariables
in interface Builder
envVars
- The paramspublic String getEnvironmentVariables()
getEnvironmentVariables
in interface Builder
public String getBuildJdk()
getBuildJdk
in interface Builder
public void setBuildJdk(String buildJdk)
setBuildJdk
in interface Builder
buildJdk
- The JAVA_HOME JDKprotected boolean outputEndsWith(int positionFromEnd, String expectedText)
positionFromEnd
- The expectedText should be wihtin positionFromEnd lines of the end of the outputexpectedText
- The text
public Map filterParameters(Map incomingWebParams)
Builder
filterParameters
in interface Builder
incomingWebParams
- Raw build parameters coming from BuildPage action
public void setParams(FilteredMap filteredParams)
setParams
in interface Builder
public ErrorCollection validate()
Builder
validate
in interface Builder
public Map getFullParams()
Builder
Builder.getFilteredParams()
since it calls back on this method
(getFillParams)
getFullParams
in interface Builder
public FilteredMap getFilteredParams()
getFilteredParams
in interface Builder
public String getViewHtml()
Builder
getViewHtml
in interface Builder
public String getPathHelp()
getPathHelp
in interface Builder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |