public bool Execute(bool throwOnFailure = false) { foreach (var step in _steps) { try { step.Execute(_input, _runner); } catch (Exception ex) { cleanupPackages(); _solution.Reset(); RippleLog.Error("Error executing {0}".ToFormat(step.GetType().Name), ex); // Mostly for testing if (_forceThrow || throwOnFailure) { throw; } return(false); } } _solution.EachProject(project => project.RemoveDuplicateReferences()); _solution.Save(_forceSave); if (_resetSolution) { _solution.Reset(); } return(true); }
public static CommandExecutionExpression With(Solution solution, bool throwOnFailure = true) { _target = solution; _forceThrow = throwOnFailure; RippleLog.RemoveFileListener(); return(new CommandExecutionExpression(() => { _target = null; _forceThrow = false; RippleLog.AddFileListener(); })); }
public static void Fail(string message, params object[] substitutions) { // TODO -- Hate this var formattedMessage = message; try { formattedMessage = message.ToFormat(substitutions); } catch (FormatException) { // Just swallow it } RippleLog.Error(formattedMessage); throw new RippleFatalError(message); }
public static RippleOperation For <T>(SolutionInput input, Solution solution) { var target = _target ?? solution; var description = input.DescribePlan(solution); if (description.IsNotEmpty()) { RippleLog.Info(description); } input.Apply(target); var runner = new RippleStepRunner(new FileSystem()); return(new RippleOperation(target, input, runner)); }
public static CommandExecutionExpression With(Solution solution, bool throwOnFailure = true, bool resetSolution = false) { _target = solution; _forceThrow = throwOnFailure; _resetSolution = resetSolution; RippleLog.RemoveFileListener(); RippleFileSystem.StubCurrentDirectory(solution.Directory); return(new CommandExecutionExpression(() => { _target = null; _forceThrow = false; _resetSolution = false; RippleLog.AddFileListener(); RippleFileSystem.Live(); })); }
public static void Fail(string message, params object[] substitutions) { RippleLog.Error(message.ToFormat(substitutions)); throw new RippleFatalError(message); }
public static void Fail(string message) { RippleLog.Error(message); throw new RippleFatalError(message); }
public static void CleanWithTracing(this IFileSystem system, string directory) { RippleLog.Info("Cleaning contents of directory " + directory); system.ForceClean(directory); }