-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.ps1
58 lines (47 loc) · 1.25 KB
/
default.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
properties {
$Version = "0.1"
$Configuration = "Release"
}
task default -depends Clean,Compile,Test
task Clean {
Invoke-MSBuild "Clean"
}
task Compile {
Invoke-MSBuild "Build"
}
task Test -depends Install-NUnitRunners {
Invoke-NUnit ".\src\PolymeliaDeploy.Tests\bin\$Configuration\PolymeliaDeploy.Tests.dll"
}
task Install-NUnitRunners {
Exec { .\src\.nuget\NuGet.exe install "NUnit.Runners" -version "2.6.2" -o ".\src\packages" }
}
function Invoke-MSBuild($Target) {
Exec { msbuild /p:Configuration=$Configuration /t:$Target ".\src\PolymeliaDeploy.sln" }
}
function Invoke-NUnit
{
param(
[string]$InputFile,
[string[]]$Include,
[string[]]$Exclude,
[switch]$NoResult
)
$options = @()
$options += $InputFile
if ($NoResult) {
$options += "/noresult"
} else {
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($InputFile)
$options += "/result=.\TestResults\${fileName}.xml"
if (-not [System.IO.Directory]::Exists(".\TestResults")) {
[System.IO.Directory]::CreateDirectory(".\TestResults")
}
}
if ($Include) {
$options += ("/include=" + [string]::Join(",", $Include))
}
if ($Exclude) {
$options += ("/exclude=" + [string]::Join(",", $Exclude))
}
Exec { & ".\src\packages\NUnit.Runners.2.6.2\tools\nunit-console.exe" $options }
}