Class CloverGrailsBuildTaskActions

    • Constructor Detail

      • CloverGrailsBuildTaskActions

        public CloverGrailsBuildTaskActions()
    • Method Detail

      • executeBefore

        public void executeBefore​(@NotNull
                                  @NotNull InternalTaskType task,
                                  @NotNull
                                  @NotNull CommonTaskContext context)
                           throws Exception
        Description copied from interface: PrePostTaskActions
        Executes a custom action before the task is executed.
        Specified by:
        executeBefore in interface PrePostTaskActions
        Parameters:
        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?
        Throws:
        Exception - in case when a pre-task action fails
      • executeAfter

        public TaskResult executeAfter​(@NotNull
                                       @NotNull InternalTaskType task,
                                       @Nullable
                                       @Nullable TaskResult taskResult)
        Description copied from interface: PrePostTaskActions
        Executes a custom action after the task is executed.
        Specified by:
        executeAfter in interface PrePostTaskActions
        Parameters:
        task - a current task which was executed
        taskResult - a result of a task execution; may be null in case task terminated abnormally
        Returns:
        TaskResult a result of a task execution (you may return the original result or modify it)
      • isRequiredGrailsSupported

        protected boolean isRequiredGrailsSupported​(@NotNull
                                                    @NotNull CommonTaskContext context)
        Returns if the project to be build requires Grails version which is supported by this action (MIN_GRAILS_VERSION_SUPPORTED and MAX_GRAILS_VERSION_SUPPORTED). It checks the application.config file in the working directory.
        Returns:
        boolean true is supported, false otherwise
      • getBuildConfigFile

        @Nullable
        protected @Nullable File getBuildConfigFile​(@NotNull
                                                    @NotNull CommonTaskContext context)
        Returns location of BuildConfig file in the workspace.
        Parameters:
        context - task context
        Returns:
        File - location of BuildConfig.groovy file or null if not found
      • getPomFile

        @Nullable
        protected @Nullable File getPomFile​(@NotNull
                                            @NotNull CommonTaskContext context)
        Returns location of pom.xml file in the workspace.
        Parameters:
        context - task context
        Returns:
        File - location of pom.xml or null if not found
      • addCloverToBuildConfigFile

        protected boolean addCloverToBuildConfigFile​(@NotNull
                                                     @NotNull CommonTaskContext context,
                                                     @NotNull
                                                     @NotNull File buildConfigFile)
        Add Clover dependencies the BuildConfig.groovy file.
        Parameters:
        buildConfigFile - file to be modified
        Returns:
        boolean - true if integration was performed, false otherwise
      • addCloverToPomFile

        protected boolean addCloverToPomFile​(@NotNull
                                             @NotNull CommonTaskContext context,
                                             @NotNull
                                             @NotNull File pomFile)
        Add Clover dependencies the pom.xml file.
        Parameters:
        pomFile - file to be modified
        Returns:
        boolean - true if integration was performed, false otherwise