2020-07-19 21:19:21 +02:00
|
|
|
$installationPath = & $PSScriptRoot\third-party\bin\vswhere.exe -products * -nologo -prerelease -latest -property installationPath
|
2020-05-20 18:28:49 +01:00
|
|
|
if (! $?) {
|
|
|
|
|
Write-Error "vswhere returned $LastExitCode"
|
|
|
|
|
exit $LastExitCode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (! $installationPath) {
|
|
|
|
|
Write-Error "Empty installation path"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$opts = ""
|
2020-07-19 21:19:21 +02:00
|
|
|
$opts += " $PSScriptRoot\vs\mob.sln"
|
2020-05-20 18:28:49 +01:00
|
|
|
$opts += " -m"
|
|
|
|
|
$opts += " -p:Configuration=Release"
|
|
|
|
|
$opts += " -noLogo"
|
|
|
|
|
$opts += " -p:UseMultiToolTask=true"
|
|
|
|
|
$opts += " -p:EnforceProcessCountAcrossBuilds=true"
|
|
|
|
|
$opts += " -clp:ErrorsOnly;Verbosity=minimal"
|
|
|
|
|
|
|
|
|
|
$vsDevCmd = "$installationPath\Common7\Tools\VsDevCmd.bat"
|
|
|
|
|
if (!(Test-Path "$vsDevCmd")) {
|
|
|
|
|
Write-Error "VdDevCmd.bat not found at $vsDevCmd"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
& "${env:COMSPEC}" /c "`"$vsDevCmd`" -no_logo -arch=amd64 -host_arch=amd64 && msbuild $opts"
|
|
|
|
|
|
|
|
|
|
if (! $?) {
|
|
|
|
|
Write-Error "Build failed"
|
|
|
|
|
exit $LastExitCode
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-19 21:19:21 +02:00
|
|
|
Copy-Item "$PSScriptRoot\build\Release\x64\mob.exe" "$PSScriptRoot\mob.exe"
|
2020-05-25 02:53:08 -04:00
|
|
|
echo "run ``.\mob -d prefix/path build`` to start building"
|