Skip to content

Commit 48685b3

Browse files
committed
Fixing build.cmd
1 parent cd9bcce commit 48685b3

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

ClickToBuild.cmd

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
for /f "usebackq tokens=*" %%i in (`lib\vswhere\vswhere -latest -version "[15.0,16.0)" -requires Microsoft.Component.MSBuild -property installationPath`) do (
2-
set InstallDir=%%i
1+
@echo off
2+
3+
for /f "usebackq tokens=1* delims=: " %%i in (`lib\vswhere\vswhere -latest -version "[15.0,16.0)" -requires Microsoft.Component.MSBuild`) do (
4+
if /i "%%i"=="installationPath" (
5+
set InstallDir=%%j
6+
if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
7+
echo "Using MSBuild from Visual Studio 2017"
8+
set msbuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
9+
goto build
10+
)
11+
)
312
)
413

5-
614
FOR %%b in (
7-
"%InstallDir%\Common7\Tools\VsMSBuildCmd.bat"
8-
"%VS140COMNTOOLS%\Common7\Tools\vsvars32.bat"
15+
"%VS140COMNTOOLS%\vsvars32.bat"
16+
"%VS120COMNTOOLS%\vsvars32.bat"
17+
"%VS110COMNTOOLS%\vsvars32.bat"
918
) do (
1019
if exist %%b (
11-
call %%b
12-
goto build
20+
echo "Using MSBuild from %%b"
21+
call %%b
22+
set msbuild="msbuild"
23+
goto build
1324
)
1425
)
1526

@@ -27,6 +38,8 @@ IF "%solution%" == "" SET solution=src\Orchard.sln
2738

2839
lib\nuget\nuget.exe restore %solution%
2940

30-
msbuild /t:%target% %project% /p:Solution=%solution% /m
41+
%msbuild% /t:%target% %project% /p:Solution=%solution% /m
42+
43+
:end
3144

3245
pause

0 commit comments

Comments
 (0)