-
Notifications
You must be signed in to change notification settings - Fork 73
/
build.ps1
36 lines (25 loc) · 1.11 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
param (
[string]$Configuration = "Debug",
[string]$appInsightsInstrumentationKey = ""
)
$msbuildPath = "msbuild"
Write-Host $IsWindows
Write-Host "Visual Studio version: $SpecFlowVisualStudioVersion";
Write-Host ($appInsightsInstrumentationKey -eq "")
if ($IsWindows){
$vswherePath = [System.Environment]::ExpandEnvironmentVariables("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe")
$vswhereParameters = @("-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-property", "installationPath", "-prerelease")
Write-Host $vswherePath
Write-Host $vswhereParameters
$vsPath = & $vswherePath $vswhereParameters
Write-Host $vsPath
if ($vsPath) {
$msbuildPath = join-path $vsPath 'MSBuild\Current\Bin\MSBuild.exe'
}
}
Write-Host $msbuildPath
& nuget restore "./SpecFlow.VisualStudio.sln"
if ($appInsightsInstrumentationKey) {
$extraArgs = "-property:AppInsightsInstrumentationKey=$appInsightsInstrumentationKey"
}
& $msbuildPath ./SpecFlow.VisualStudio.sln -property:Configuration=$Configuration -binaryLogger:msbuild.$Configuration.binlog -nodeReuse:false $extraArgs