- set before build script
nuget restore .\src\SomeProject.sln
- set artifacts path
.\src\SomeProject\bin\**\*.exe
-
Add cake
nvoke-WebRequest http://cakebuild.net/download/bootstrapper/windows -OutFile build.ps1
var target = Argument("target", "Default");
Task("Default")
.Does(() =>
{
Information("Hello World!");
});
RunTarget(target);
- run
./build.ps1
- Restore nuget packages
Task("Restore-NuGet-Packages")
.Does(() =>
{
NuGetRestore("./src/SomeProject.sln");
});
.IsDependentOn("Restore-NuGet-Packages")
var configuration = Argument("configuration", "Release");
Task("Build")
.Does(() =>
{
MSBuild("./src/SomeProject.sln", settings => settings.SetConfiguration(configuration));
});
.IsDependentOn("Build")
- Add xunit tests
#tool "nuget:?package=xunit.runner.console"
Task("Run-Tests")
.IsDependentOn("Build")
.Does(() =>
{
XUnit2("./src/**/bin/Release/*.Specs.dll");
});
.IsDependentOn("Run-Tests")
.\build.ps1