forked from emertechie/SyslogNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
37 lines (29 loc) · 1.13 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Properties {
$buildDir = Split-Path $psake.build_script_file
$buildArtifactsDir = "$buildDir\_build"
$projectOutputDir = "$buildArtifactsDir\bin\"
$solutionDir = "$buildDir"
$version = "0.2.6"
}
Task default -Depends Compile, RunTests, CreatePackage
Task Compile -Depends Clean {
Write-Host "Building solution" -ForegroundColor Green
Exec { msbuild "$solutionDir\SyslogNet.Client\SyslogNet.Client.csproj" /t:Build /p:Configuration=Release /v:quiet /p:OutDir=$projectOutputDir }
}
Task Clean {
Write-Host "Creating BuildArtifacts directory" -ForegroundColor Green
if (Test-Path $buildArtifactsDir)
{
rd $buildArtifactsDir -rec -force | out-null
}
mkdir $buildArtifactsDir | out-null
Write-Host "Cleaning solution" -ForegroundColor Green
Exec { msbuild "$solutionDir\SyslogNet.sln" /t:Clean /p:Configuration=Release /v:quiet }
}
Task RunTests {
"TODO: Run tests"
}
Task CreatePackage {
Write-Host "Building NuGet package" -ForegroundColor Green
&"$solutionDir\.nuget\nuget.exe" pack "$solutionDir\SyslogNet.Client.nuspec" -OutputDirectory "$buildArtifactsDir" -Version $version
}