public class CloverGrailsBuildTaskActions extends Object implements PrePostTaskActions
MIN_GRAILS_VERSION_SUPPORTED
or newer.Modifier and Type | Field and Description |
---|---|
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.
|
protected boolean |
minimalGrailsVersionSupported |
Constructor and Description |
---|
CloverGrailsBuildTaskActions() |
Modifier and Type | Method and Description |
---|---|
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() |
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
protected boolean minimalGrailsVersionSupported
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 abnormallyException
- 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 contextnull
if not found@Nullable protected File getPomFile(@NotNull CommonTaskContext context)
context
- task contextnull
if not foundprotected boolean addCloverToBuildConfigFile(@NotNull CommonTaskContext context, @NotNull File buildConfigFile)
buildConfigFile
- file to be modifiedprotected boolean addCloverToPomFile(@NotNull CommonTaskContext context, @NotNull File pomFile)
pomFile
- file to be modifiedprotected void backupFile(@NotNull File original) throws IOException
original
- sourceIOException
protected void restoreFilesFromBackup()
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.