|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.clover.build.CloverGrailsBuildTaskActions
public class CloverGrailsBuildTaskActions
The pre-task action adds a Grails Clover Plugin dependency in BuildConfig.groovy or in pom.xml, if required.
The post-task action will revert this change. Actions are active when an automatic Clover integration
is enabled for a Job. Actions are active for Grails MIN_GRAILS_VERSION_SUPPORTED
or newer.
Field Summary | |
---|---|
protected BuildLogger |
buildLogger
Logging to build log |
protected Map<File,File> |
filesToRevert
Map(original file, backup file) of files to be restored |
static String |
GRAILS_CLOVER_PLUGIN_DEFAULT_VERSION
Default Grails Clover Plugin version to be installed. |
static String |
GRAILS_CLOVER_PLUGIN_VERSION_VARIABLE
Name of a custom variable which can be configured for a plan in order to install a specific version of the Grails Clover Plugin. |
static String |
MIN_GRAILS_VERSION_SUPPORTED
Minimum version number of Grails supported by this action. |
Constructor Summary | |
---|---|
CloverGrailsBuildTaskActions()
|
Method Summary | |
---|---|
protected boolean |
addCloverToBuildConfigFile(CommonTaskContext context,
File buildConfigFile)
Add Clover dependencies the BuildConfig.groovy file. |
protected boolean |
addCloverToPomFile(CommonTaskContext context,
File pomFile)
Add Clover dependencies the pom.xml file. |
protected void |
backupFile(File original)
Create backup of the |
TaskResult |
executeAfter(InternalTaskType task,
TaskResult taskResult)
Executes a custom action after the task is executed. |
void |
executeBefore(InternalTaskType task,
CommonTaskContext context)
Executes a custom action before the task is executed. |
protected File |
getBuildConfigFile(CommonTaskContext context)
Returns location of BuildConfig file in the workspace. |
protected String |
getGrailsCloverPluginVersion(CommonTaskContext context)
Return version number of the Grails Clover Plugin to be installed. |
protected File |
getPomFile(CommonTaskContext context)
Returns location of pom.xml file in the workspace. |
protected boolean |
isRequiredGrailsSupported(CommonTaskContext context)
Returns if the project to be build requires Grails version which is supported by this action ( MIN_GRAILS_VERSION_SUPPORTED or later) - it checks the application.config file in the working
directory. |
protected void |
restoreFilesFromBackup()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BuildLogger buildLogger
public static final String MIN_GRAILS_VERSION_SUPPORTED
public static final String GRAILS_CLOVER_PLUGIN_VERSION_VARIABLE
public static final String GRAILS_CLOVER_PLUGIN_DEFAULT_VERSION
com_atlassian_clover.CloverVersionInfo#RELEASE_NUM
, the Grails plugin is not always
released together with the Clover Core.
protected Map<File,File> filesToRevert
Constructor Detail |
---|
public CloverGrailsBuildTaskActions()
Method Detail |
---|
public void executeBefore(@NotNull InternalTaskType task, @NotNull CommonTaskContext context) throws Exception
PrePostTaskActions
executeBefore
in interface PrePostTaskActions
task
- a current task, it can be actually a subclass of TaskType (build plans), DeploymentTaskType
(deployment plans) or CommonTaskType (build or deployment plans)context
- a current task context, can be actually a TaskContext (build plans) or
DeploymentTaskContext (deployment plans),
TODO can it be a CommonTaskContext? flow in TaskExecutorImpl suggests that it may happen - but under which conditions actually?
Exception
- in case when a pre-task action failspublic TaskResult executeAfter(@NotNull InternalTaskType task, @Nullable TaskResult taskResult) throws Exception
PrePostTaskActions
executeAfter
in interface PrePostTaskActions
task
- a current task which was executedtaskResult
- a result of a task execution; may be null
in case task terminated abnormally
Exception
- in case when a post-task action failsprotected boolean isRequiredGrailsSupported(@NotNull CommonTaskContext context)
MIN_GRAILS_VERSION_SUPPORTED
or later) - it checks the application.config file in the working
directory.
true
is supported, false
otherwise@NotNull protected String getGrailsCloverPluginVersion(@NotNull CommonTaskContext context)
GRAILS_CLOVER_PLUGIN_VERSION_VARIABLE
variable.
context
- task context
@Nullable protected File getBuildConfigFile(@NotNull CommonTaskContext context)
context
- task context
null
if not found@Nullable protected File getPomFile(@NotNull CommonTaskContext context)
context
- task context
null
if not foundprotected boolean addCloverToBuildConfigFile(@NotNull CommonTaskContext context, @NotNull File buildConfigFile)
buildConfigFile
- file to be modified
protected boolean addCloverToPomFile(@NotNull CommonTaskContext context, @NotNull File pomFile)
pomFile
- file to be modified
protected void backupFile(@NotNull File original) throws IOException
original
- source
IOException
protected void restoreFilesFromBackup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |