-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.bat
28 lines (24 loc) · 953 Bytes
/
compile.bat
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
@ECHO OFF
SETLOCAL EnableDelayedExpansion
:: msbuild path
SET vsInstallerRoot=%programfiles(x86)%\Microsoft Visual Studio\Installer
FOR /f "usebackq tokens=1* delims=: " %%i IN (`"%vsInstallerRoot%\vswhere.exe" -latest -prerelease -requires Microsoft.Component.MSBuild`) DO (
IF /i "%%i"=="installationPath" SET vsRoot=%%j
)
SET MSBuild="%vsRoot%\MSBuild\Current\Bin\MSBuild.exe"
:: msbuild params
SET MSBuildParam=
SET MSBuildParam=%MSBuildParam% /maxcpucount
SET MSBuildParam=%MSBuildParam% /nologo
SET MSBuildParam=%MSBuildParam% /nodeReuse:false
SET MSBuildParam=%MSBuildParam% /property:AllowedReferenceRelatedFileExtensions=none
SET MSBuildParam=%MSBuildParam% /property:Configuration=Release
SET MSBuildParam=%MSBuildParam% /target:clean,restore,build
SET MSBuildParam=%MSBuildParam% /verbosity:minimal
:: execute msbuild
FOR %%a IN ("%~dp0\*.sln") DO (
%MSBuild% %MSBuildParam% %%~fa
IF NOT %errorlevel%==0 PAUSE
)
ENDLOCAL
EXIT /b