Created
April 16, 2020 11:49
-
-
Save huanlin/c8629bfa38aa570364da8b2e03d88afb to your computer and use it in GitHub Desktop.
More build scripts for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class DefaultTestScript : DefaultBuildScript | |
| { | |
| protected override void ConfigureTargets(ITaskContext context) | |
| { | |
| var doExample = context.CreateTarget("DoExample") | |
| .Do(t => { throw new Exception("error on purpose."); }); | |
| var doExample2 = context.CreateTarget("DoExample2") | |
| .Do(t => { Console.WriteLine("from doExample2"); }); | |
| var test = context.CreateTarget("test") | |
| .Do(t => { Console.WriteLine("from test"); }); | |
| context.CreateTarget("Rebuild") | |
| .SetAsDefault() | |
| .AddTask(t => t.Do(x => { Console.WriteLine("from rebuild"); })) | |
| .DependsOnAsync(doExample, doExample2) | |
| .DependsOn(test); | |
| } | |
| } | |
| /* | |
| Expected result: | |
| Target Duration Status | |
| ---------------------------------- | |
| DoExample 00:00:00 Failed | |
| DoExample2 00:00:00 Finished | |
| Test 00:00:00 NotRan | |
| Rebuild 00:00:00 Failed | |
| BUILD FAILED | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment