forked from xunit/xunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
30 lines (26 loc) · 1.07 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
param(
[string]$target = "Test",
[string]$verbosity = "minimal",
[int]$maxCpuCount = 0
)
# Kill all MSBUILD.EXE processes because they could very likely have a lock against our
# MSBuild runner from when we last ran unit tests.
get-process -name "msbuild" -ea SilentlyContinue | %{ stop-process $_.ID -force }
if (test-path "env:\ProgramFiles(x86)") {
$path = join-path ${env:ProgramFiles(x86)} "MSBuild\14.0\bin\MSBuild.exe"
if (test-path $path) { $msbuild = $path }
}
if ($msbuild -eq $null) {
$path = join-path $env:ProgramFiles "MSBuild\14.0\bin\MSBuild.exe"
if (test-path $path) { $msbuild = $path }
}
if ($msbuild -eq $null) {
throw "Could not find MSBuild v14. Please install it (or Visual Studio 2015)."
}
if ($maxCpuCount -lt 1) {
$maxCpuCountText = $Env:MSBuildProcessorCount
} else {
$maxCpuCountText = ":$maxCpuCount"
}
$allArgs = @("xunit.msbuild", "/m$maxCpuCountText", "/nologo", "/verbosity:$verbosity", "/t:$target", "/property:RequestedVerbosity=$verbosity", "/property:SolutionName=xunit.vs2015.sln", $args)
& $msbuild $allArgs