From 53b2a70af2193522e183ec65c55e4eb65df723b3 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 26 Nov 2016 09:43:21 +0100 Subject: [PATCH] Update .bat files to use VS2017. --- clean.bat | 17 +++++++++++++---- debugbuild.bat | 23 +++++++++++++++++------ releasebuild.bat | 23 +++++++++++++++++------ 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/clean.bat b/clean.bat index e41d4039b..d40afdbe8 100644 --- a/clean.bat +++ b/clean.bat @@ -1,7 +1,16 @@ @if not exist "NRefactory\NRefactory.sln" ( git submodule update --init || exit /b 1 ) -%windir%\microsoft.net\framework\v4.0.30319\msbuild /m ILSpy.sln /t:clean "/p:Platform=Any CPU" /p:Configuration=Debug -@IF %ERRORLEVEL% NEQ 0 PAUSE -%windir%\microsoft.net\framework\v4.0.30319\msbuild /m ILSpy.sln /t:clean "/p:Platform=Any CPU" /p:Configuration=Release -@IF %ERRORLEVEL% NEQ 0 PAUSE \ No newline at end of file +@setlocal enabledelayedexpansion +set MSBUILD= +@for /D %%M in ("%ProgramFiles(x86)%\Microsoft Visual Studio\2017"\*) do ( + @if exist "%%M\MSBuild\15.0\Bin\MSBuild.exe" ( + @set "MSBUILD=%%M\MSBuild\15.0\Bin\MSBuild.exe" + ) +) +@if "%MSBUILD%" == "" ( + @echo Could not find VS2017 MSBuild + @exit /b 1 +) +"%MSBUILD%" /m ILSpy.sln /t:Clean /p:Configuration=Debug "/p:Platform=Any CPU" || pause +"%MSBUILD%" /m ILSpy.sln /t:Clean /p:Configuration=Release "/p:Platform=Any CPU" || pause diff --git a/debugbuild.bat b/debugbuild.bat index 79a991236..cd7b99a76 100644 --- a/debugbuild.bat +++ b/debugbuild.bat @@ -1,9 +1,20 @@ @if not exist "NRefactory\NRefactory.sln" ( git submodule update --init || exit /b 1 ) -"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild.exe" /m ILSpy.sln /p:Configuration=Debug "/p:Platform=Any CPU" -@IF %ERRORLEVEL% NEQ 0 GOTO err -@exit /B 0 -:err -@PAUSE -@exit /B 1 \ No newline at end of file +@setlocal enabledelayedexpansion +set MSBUILD= +@for /D %%M in ("%ProgramFiles(x86)%\Microsoft Visual Studio\2017"\*) do ( + @if exist "%%M\MSBuild\15.0\Bin\MSBuild.exe" ( + @set "MSBUILD=%%M\MSBuild\15.0\Bin\MSBuild.exe" + ) +) +@if "%MSBUILD%" == "" ( + @echo Could not find VS2017 MSBuild + @exit /b 1 +) +"%MSBUILD%" /m ILSpy.sln /p:Configuration=Debug "/p:Platform=Any CPU" +@IF %ERRORLEVEL% NEQ 0 ( + @pause + @exit /b 1 +) +@exit /b 0 diff --git a/releasebuild.bat b/releasebuild.bat index a4aa756bb..ef2f48175 100644 --- a/releasebuild.bat +++ b/releasebuild.bat @@ -1,9 +1,20 @@ @if not exist "NRefactory\NRefactory.sln" ( git submodule update --init || exit /b 1 ) -"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild.exe" /m ILSpy.sln /p:Configuration=Release "/p:Platform=Any CPU" -@IF %ERRORLEVEL% NEQ 0 GOTO err -@exit /B 0 -:err -@PAUSE -@exit /B 1 \ No newline at end of file +@setlocal enabledelayedexpansion +set MSBUILD= +@for /D %%M in ("%ProgramFiles(x86)%\Microsoft Visual Studio\2017"\*) do ( + @if exist "%%M\MSBuild\15.0\Bin\MSBuild.exe" ( + @set "MSBUILD=%%M\MSBuild\15.0\Bin\MSBuild.exe" + ) +) +@if "%MSBUILD%" == "" ( + @echo Could not find VS2017 MSBuild + @exit /b 1 +) +"%MSBUILD%" /m ILSpy.sln /p:Configuration=Release "/p:Platform=Any CPU" +@IF %ERRORLEVEL% NEQ 0 ( + @pause + @exit /b 1 +) +@exit /b 0