Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created February 21, 2019 23:46
Show Gist options
  • Save johnmmoss/f2ae4259fa078cccda22597d5cbc4207 to your computer and use it in GitHub Desktop.
Save johnmmoss/f2ae4259fa078cccda22597d5cbc4207 to your computer and use it in GitHub Desktop.
#addin "nuget:?package=Cake.Incubator&version=3.1.0"
var target = Argument("Target", "Build");
var configuration = Argument("Configuration", "Release");
Task("Restore")
.Does(() =>
{
Information("Restoring packages...");
DotNetCoreRestore();
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
Information("Building Toaster.sln");
DotNetCoreBuild("ToastMaker.sln");
});
Task("Run-Tests")
.IsDependentOn("Build")
.Does((context) =>
{
var args = new ProcessSettings
{
Arguments = "run -p ToastMaker.Api/ToastMaker.Api.csproj --no-build"
};
Information(args.Dump());
using(var process = StartAndReturnProcess("dotnet", args))
{
Information("Running tests...");
DotNetCoreTest(@"ToastMaker.IntegrationTest\ToastMaker.IntegrationTest.csproj");
process.Kill();
}
});
RunTarget(target);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment