FlubuCore v2.7.0 Release Notes
-
- โ Added Xunit task - For running xunit tasks with xunit console runner.
- ๐ WebApi: Option to include flubu web api server logs into ExecuteScript response.
- WebApi: Option to include StackTrace to error response.
โ Added Build system providers - You can acces various build, commit... information for various build systems (such as Jenkins, TeamCity, AppVeyor, Travis...)
protected override void ConfigureTargets(ITaskContext context) { bool isLocalBuild = context.BuildSystems().IsLocalBuild; var gitCommitId = context.BuildSystems().Jenkins().GitCommitId; }
๐ Added conditonal task execution with when cluase on single task (see bellow for group of tasks)
context.CreateTarget("Example") .AddTask(x => x.CompileSolutionTask()) .AddTask(x => x.PublishNuGetPackageTask("packageId", "pathToNuspec")) .When(c => c.BuildSystems().Jenkins().IsRunningOnJenkins);
โ Added finally block on single task. Finally block acts just like finally in try catch (see bellow for group of tasks)
context.CreateTarget("Example") .AddTask(x => x.CompileSolutionTask()) .AddTask(x => x.PublishNuGetPackageTask("packageId", "pathToNuspec") .Finally(c => c.Tasks().DeleteFilesTask("pathtoNuspec", ".", true).Execute(c)));
โ Added onError block on single task. You can perform some custom action when error occures on single task(see bellow for group of tasks)
context.CreateTarget("Example") .AddTask(x => x.CompileSolutionTask()) .AddTask(x => x.PublishNuGetPackageTask("packageId", "pathToNuspec") .OnError((c, ex) => c.Tasks().DeleteFilesTask("pathtoNuspec", ".", true).Execute(context)));
Added conditonal task execution with When clause on group of tasks.
protected override void ConfigureTargets(ITaskContext context) { context.CreateTarget("Example") .AddCoreTask(x => x.Build()) .Group( target => { target.AddCoreTask(x => x.Pack()); target.AddCoreTask(x => x.NugetPush("pathToPackage")); }, when: c => !c.BuildSystems().Jenkins().IsRunningOnJenkins); }
Finally on group of tasks: Added onFinally block on group of tasks. onFinally acts just like finally in try/catch.
context.CreateTarget("Example") .AddCoreTask(x => x.Build()) .Group( target => { target.AddCoreTask(x => x.Pack()); target.AddCoreTask(x => x.NugetPush("pathToPackage")); }, onFinally: c => { c.Tasks().DeleteFilesTask("pathToNupkg", "*.*", true).Execute(c); });
OnError on group of tasks: You can perform some custom action when error occures in any of tasks that are in group.
context.CreateTarget("Example") .AddCoreTask(x => x.Build()) .Group( target => { target.AddCoreTask(x => x.Pack()); target.AddCoreTask(x => x.NugetPush("pathToPackage")); }, onError: (c, error) => { //// some custom action when error occures in any of the task in group. });