Пример #1
0
        private PostActionExecutionStatus ProcessAction(
            ICreationEffects creationEffects,
            ICreationResult creationResult,
            string outputBaseDirectory,
            IPostAction action,
            IPostActionProcessor actionProcessor)
        {
            if (actionProcessor is PostActionProcessor2Base actionProcessor2Base)
            {
                actionProcessor2Base.Callbacks = _callbacks;
            }

            //catch all exceptions on post action execution
            //post actions can be added using components and it's not sure if they handle exceptions properly
            try
            {
                if (actionProcessor.Process(_environment, action, creationEffects, creationResult, outputBaseDirectory))
                {
                    return(PostActionExecutionStatus.Success);
                }

                Reporter.Error.WriteLine(LocalizableStrings.PostActionFailedInstructionHeader);
                DisplayInstructionsForAction(action, useErrorOutput: true);
                return(PostActionExecutionStatus.Failure);
            }
            catch (Exception e)
            {
                Reporter.Error.WriteLine(LocalizableStrings.PostActionFailedInstructionHeader);
                Reporter.Verbose.WriteLine(string.Format(LocalizableStrings.Generic_Details, e.ToString()));
                DisplayInstructionsForAction(action, useErrorOutput: true);
                return(PostActionExecutionStatus.Failure);
            }
        }
        private bool ProcessAction(IPostAction action, IPostActionProcessor actionProcessor)
        {
            if (actionProcessor is IPostActionProcessor2 actionProcessor2 && _creationResult.CreationEffects is ICreationEffects2 creationEffects)
            {
                return(actionProcessor2.Process(_environment, action, creationEffects, _creationResult.ResultInfo, _creationResult.OutputBaseDirectory));
            }

            return(actionProcessor.Process(_environment, action, _creationResult.ResultInfo, _creationResult.OutputBaseDirectory));
        }
Пример #3
0
 private bool ProcessAction(IPostAction action, IPostActionProcessor actionProcessor)
 {
     return(actionProcessor.Process(_environment, action, _creationResult.ResultInfo, _creationResult.OutputBaseDirectory));
 }