| 1 |
var target = Argument("target", "Test"); |
| 2 |
var configuration = Argument("configuration", "Release"); |
| 3 |
|
| 4 |
////////////////////////////////////////////////////////////////////// |
| 5 |
// TASKS |
| 6 |
////////////////////////////////////////////////////////////////////// |
| 7 |
|
| 8 |
Task("Clean") |
| 9 |
.WithCriteria(c => HasArgument("rebuild")) |
| 10 |
.Does(() => |
| 11 |
{ |
| 12 |
CleanDirectory($"./src/Example/bin/{configuration}"); |
| 13 |
}); |
| 14 |
|
| 15 |
Task("Build") |
| 16 |
.IsDependentOn("Clean") |
| 17 |
.Does(() => |
| 18 |
{ |
| 19 |
DotNetCoreBuild("./src/Example.sln", new DotNetCoreBuildSettings |
| 20 |
{ |
| 21 |
Configuration = configuration, |
| 22 |
}); |
| 23 |
}); |
| 24 |
|
| 25 |
Task("Test") |
| 26 |
.IsDependentOn("Build") |
| 27 |
.Does(() => |
| 28 |
{ |
| 29 |
DotNetCoreTest("./src/Example.sln", new DotNetCoreTestSettings |
| 30 |
{ |
| 31 |
Configuration = configuration, |
| 32 |
NoBuild = true, |
| 33 |
}); |
| 34 |
}); |
| 35 |
|
| 36 |
////////////////////////////////////////////////////////////////////// |
| 37 |
// EXECUTION |
| 38 |
////////////////////////////////////////////////////////////////////// |
| 39 |
|
| 40 |
RunTarget(target); |