2012-03-11 21:17:56 +04:00
|
|
|
@echo off
|
|
|
|
pushd %~dp0
|
2013-11-09 04:05:08 +04:00
|
|
|
setlocal
|
2012-03-11 21:17:56 +04:00
|
|
|
|
|
|
|
if exist bin goto build
|
|
|
|
mkdir bin
|
|
|
|
|
|
|
|
:Build
|
2013-11-10 23:58:10 +04:00
|
|
|
|
2017-10-09 20:43:33 +03:00
|
|
|
REM Find the most recent 32bit MSBuild.exe on the system. Require v15.0 (installed with VS2017) or later since .NET
|
|
|
|
REM Core projects are coming soon.
|
|
|
|
REM Use `vswhere` for the search since %ProgramFiles(x86)%\msbuild\15.0\Bin\MSBuild.exe almost never exists.
|
|
|
|
set vswhere="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
|
|
|
if not exist %vswhere% (
|
|
|
|
set VsWhere="%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
|
|
|
|
)
|
|
|
|
if not exist %vswhere% (
|
|
|
|
REM vswhere.exe not in normal locations; check the Path.
|
|
|
|
for %%X in (vswhere.exe) do (
|
|
|
|
set vswhere="%%~$PATH:X"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if not exist %vswhere% (
|
|
|
|
echo Could not find vswhere.exe. Please run this from a Visual Studio developer prompt.
|
|
|
|
goto BuildFail
|
|
|
|
)
|
|
|
|
|
|
|
|
set InstallDir=
|
2022-11-20 02:32:34 +03:00
|
|
|
for /f "usebackq tokens=*" %%i in (`%vswhere% -version ^[15^,16^) -latest -prerelease -products * ^
|
|
|
|
-requires Microsoft.Component.MSBuild -requires Microsoft.Net.Core.Component.SDK.2.1 ^
|
|
|
|
-property installationPath`) do (
|
2017-10-09 20:43:33 +03:00
|
|
|
set InstallDir=%%i
|
|
|
|
)
|
|
|
|
if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
|
|
|
|
set MSBuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
|
|
|
|
) else (
|
|
|
|
echo Could not find MSBuild.exe. Please install the VS2017 BuildTools component or a workload that includes it.
|
|
|
|
goto BuildFail
|
|
|
|
)
|
2013-11-09 04:05:08 +04:00
|
|
|
|
2012-03-11 21:17:56 +04:00
|
|
|
if "%1" == "" goto BuildDefaults
|
|
|
|
|
2022-11-23 01:33:37 +03:00
|
|
|
%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal /t:%*
|
2012-10-12 01:59:26 +04:00
|
|
|
if %ERRORLEVEL% neq 0 goto BuildFail
|
2012-03-11 21:17:56 +04:00
|
|
|
goto BuildSuccess
|
|
|
|
|
|
|
|
:BuildDefaults
|
2017-10-09 20:43:33 +03:00
|
|
|
%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
|
2012-10-12 01:59:26 +04:00
|
|
|
if %ERRORLEVEL% neq 0 goto BuildFail
|
2012-03-11 21:17:56 +04:00
|
|
|
goto BuildSuccess
|
|
|
|
|
|
|
|
:BuildFail
|
|
|
|
echo.
|
|
|
|
echo *** BUILD FAILED ***
|
2017-10-09 20:43:33 +03:00
|
|
|
popd
|
|
|
|
endlocal
|
|
|
|
exit /B 999
|
2012-03-11 21:17:56 +04:00
|
|
|
|
|
|
|
:BuildSuccess
|
|
|
|
echo.
|
|
|
|
echo **** BUILD SUCCESSFUL ***
|
|
|
|
popd
|
2013-11-09 01:26:15 +04:00
|
|
|
endlocal
|
2017-10-09 20:43:33 +03:00
|
|
|
exit /B 0
|