Skip to content

Commit

Permalink
Fixing build.cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Apr 27, 2017
1 parent cd9bcce commit 48685b3
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions ClickToBuild.cmd
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
for /f "usebackq tokens=*" %%i in (`lib\vswhere\vswhere -latest -version "[15.0,16.0)" -requires Microsoft.Component.MSBuild -property installationPath`) do (
set InstallDir=%%i
@echo off

for /f "usebackq tokens=1* delims=: " %%i in (`lib\vswhere\vswhere -latest -version "[15.0,16.0)" -requires Microsoft.Component.MSBuild`) do (
if /i "%%i"=="installationPath" (
set InstallDir=%%j
if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
echo "Using MSBuild from Visual Studio 2017"
set msbuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
goto build
)
)
)


FOR %%b in (
"%InstallDir%\Common7\Tools\VsMSBuildCmd.bat"
"%VS140COMNTOOLS%\Common7\Tools\vsvars32.bat"
"%VS140COMNTOOLS%\vsvars32.bat"
"%VS120COMNTOOLS%\vsvars32.bat"
"%VS110COMNTOOLS%\vsvars32.bat"
) do (
if exist %%b (
call %%b
goto build
echo "Using MSBuild from %%b"
call %%b
set msbuild="msbuild"
goto build
)
)

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

lib\nuget\nuget.exe restore %solution%

msbuild /t:%target% %project% /p:Solution=%solution% /m
%msbuild% /t:%target% %project% /p:Solution=%solution% /m

:end

pause

0 comments on commit 48685b3

Please sign in to comment.