Example #1
0
        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);"));
        }
Example #2
0
 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);");
 }
Example #3
0
 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);");
 }
Example #4
0
        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;");
        }