May 2018
Intermediate to advanced
300 pages
7h 35m
English
TaskSetup and TaskTeardown are used to wrap code to execute actions that you want the build to perform before and after the execution of each task. These methods are especially useful when performing actions such as configuration initializations and custom logging:
TaskSetup(setupContext =>{ var taskName =setupContext.Task.Name; // perform action});TaskTeardown(teardownContext =>{ var taskName =teardownContext.Task.Name; // perform action});
Similar to TaskSetup and TaskTeardown for task, Cake has the Setup and Teardown methods that can be used to execute actions that are intended to run before the first task and after the last task, respectively. These methods are useful in a build automation, with a good use case ...