forked from dwmkerr/sharpshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
18 lines (16 loc) · 882 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Define build parameters:
$msbuild = "MSBuild.exe"
$solutionFile = "SharpShellNativeBridge.sln"
# Get the 'MSBuild.exe' path. On CI platforms (e.g. GitHub actions) it will
# already be in the path. If it's not, use vswhere to find it.
$msbuildPath = If (Get-Command $msbuild -ErrorAction SilentlyContinue) {
# MSBuild.exe is avaialble from %PATH% - we are probably in CI...
$msbuild
} Else {
# Find MSBuild.exe using 'vswhere'...
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
}
$arguments = @("/t:Clean,Restore,Build", "/p:Configuration=Release,Platform=x64", "$PSScriptRoot\$solutionFile")
# Run the command.
Write-Host "Running: $msbuild $arguments"
Start-Process -Wait -NoNewWindow -FilePath "$msbuildPath" -ArgumentList "$arguments"