private static TaskWriter WritePreAndPostProcess(this TaskWriter writer) { var settingsClass = writer.Task.SettingsClass.Name; return(writer .WriteLine($"static partial void PreProcess ({settingsClass} toolSettings);") .WriteLine($"static partial void PostProcess ({settingsClass} toolSettings);")); }
private static void WriteMainTaskBlock(TaskWriter writer) { writer .WriteLine($"var toolSettings = configurator.InvokeSafe(new {writer.Task.SettingsClass.Name}());") .WriteLine($"PreProcess(toolSettings);") .WriteLine($"var process = {GetProcessStart(writer.Task)};") .WriteLine(GetProcessAssertion(writer.Task)) .WriteLine($"PostProcess(toolSettings);"); }
private static void WriteMainTaskBlock(TaskWriter writer) { writer .WriteLine($"var toolSettings = configurator.InvokeSafe(new {writer.Task.SettingsClass.Name}());") .WriteLine($"PreProcess(toolSettings);") .WriteLine($"var process = {GetProcessStart(writer.Task)};") .WriteLine(GetProcessAssertion(writer.Task)) .WriteLine($"PostProcess(toolSettings);") .WriteLineIfTrue(writer.Task.HasReturnValue(), "return GetResult(process, toolSettings, processSettings);"); }
private static void WriteMainTaskBlock(TaskWriter writer) { var task = writer.Task; writer .WriteLine($"var toolSettings = configurator.InvokeSafe(new {task.SettingsClass.Name}());") .WriteLineIfTrue(task.PreProcess, $"PreProcess(ref toolSettings);") .WriteLine($"var process = {GetProcessStart(task)};") .WriteLine(GetProcessAssertion(task)) .WriteLineIfTrue(task.PostProcess, $"PostProcess(toolSettings);") .WriteLine(task.HasReturnValue() ? "return (GetResult(process, toolSettings), process.Output);" : "return process.Output;"); }