OSDN Git Service

Build*.cmd: Allow specifying platform in command line parameter
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 20 Dec 2018 23:07:53 +0000 (08:07 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 20 Dec 2018 23:07:53 +0000 (08:07 +0900)
BuildAll.vs2015.cmd
BuildAll.vs2017.cmd
BuildBin.vs2015.cmd
BuildBin.vs2017.cmd
BuildInstaller.cmd

index 259c428..23b95eb 100644 (file)
@@ -1,9 +1,9 @@
 pushd "%~dp0"
 call BuildManual.cmd
-call BuildBin.vs2015.cmd
+call BuildBin.vs2017.cmd %1
 pushd Testing\GoogleTest\UnitTests
 UnitTests.exe || exit
 popd
-call BuildInstaller.cmd
-call BuildArc.cmd
+call BuildInstaller.cmd %1
+call BuildArc.cmd %1
 popd
index 29b6ff7..23b95eb 100644 (file)
@@ -1,9 +1,9 @@
 pushd "%~dp0"
 call BuildManual.cmd
-call BuildBin.vs2017.cmd
+call BuildBin.vs2017.cmd %1
 pushd Testing\GoogleTest\UnitTests
 UnitTests.exe || exit
 popd
-call BuildInstaller.cmd
-call BuildArc.cmd
+call BuildInstaller.cmd %1
+call BuildArc.cmd %1
 popd
index fad7e2c..7ae44e8 100644 (file)
@@ -6,18 +6,31 @@ cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h
 setlocal
 set VisualStudioVersion=14.0
 call "%VS140COMNTOOLS%vsvars32.bat"
-MSBuild WinMerge.vs2015.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="Win32" || pause
-MSBuild WinMerge.vs2015.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="x64" || pause
+
+if "%1" == "" (
+  call :BuildBin
+  call :BuildBin x64
+) else (
+  call :BuildBin %1 
+)
+
+goto :eof
+
+:BuildBin
+set PLATFORM=%1
+if "%1" == "" (
+  set PLATFORM_VS=Win32
+) else (
+  set PLATFORM_VS=%1
+)
+MSBuild WinMerge.vs2015.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="%PLATFOMR_VS" || pause
 endlocal
 
 if exist "%SIGNBAT_PATH%" (
-  call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\WinMergeU.exe
-  call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\MergeLang.dll
-  call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\WinMergeU.exe
-  call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\MergeLang.dll
+  call "%SIGNBAT_PATH%" Build\%PLATFORM%\MergeUnicodeRelease\WinMergeU.exe
+  call "%SIGNBAT_PATH%" Build\%PLATFORM%\MergeUnicodeRelease\MergeLang.dll
 )
 
-mkdir Build\MergeUnicodeRelease\%APPVER% 2> NUL
-mkdir Build\x64\MergeUnicodeRelease\%APPVER% 2> NUL
-copy Build\MergeUnicodeRelease\*.pdb "Build\MergeUnicodeRelease\%APPVER%\"
-copy Build\x64\MergeUnicodeRelease\*.pdb "Build\x64\MergeUnicodeRelease\%APPVER%\"
+mkdir Build\%PLATFORM%\MergeUnicodeRelease\%APPVER% 2> NUL
+copy Build\%PlATFORM%\MergeUnicodeRelease\*.pdb "Build\%PLATFORM%\MergeUnicodeRelease\%APPVER%\"
+goto :eof
index 5ed3c68..d65c596 100644 (file)
@@ -8,20 +8,33 @@ for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio
   set InstallDir=%%i
 )
 if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
-  call "%InstallDir%\Common7\Tools\vsdevcmd.bat %*
+  call "%InstallDir%\Common7\Tools\vsdevcmd.bat
 )
-MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="Win32" || pause
-MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="x64" || pause
+
+if "%1" == "" (
+  call :BuildBin
+  call :BuildBin x64
+) else (
+  call :BuildBin %1 
+)
+
+goto :eof
+
+:BuildBin
+set PLATFORM=%1
+if "%1" == "" (
+  set PLATFORM_VS=Win32
+) else (
+  set PLATFORM_VS=%1
+)
+MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="%PLATFORM_VS%" || pause
 endlocal
 
 if exist "%SIGNBAT_PATH%" (
-  call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\WinMergeU.exe
-  call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\MergeLang.dll
-  call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\WinMergeU.exe
-  call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\MergeLang.dll
+  call "%SIGNBAT_PATH%" Build\%PLATFORM%\MergeUnicodeRelease\WinMergeU.exe
+  call "%SIGNBAT_PATH%" Build\%PLATFORM%\MergeUnicodeRelease\MergeLang.dll
 )
 
-mkdir Build\MergeUnicodeRelease\%APPVER% 2> NUL
-mkdir Build\x64\MergeUnicodeRelease\%APPVER% 2> NUL
-copy Build\MergeUnicodeRelease\*.pdb "Build\MergeUnicodeRelease\%APPVER%\"
-copy Build\x64\MergeUnicodeRelease\*.pdb "Build\x64\MergeUnicodeRelease\%APPVER%\"
+mkdir Build\%PLATFORM%\MergeUnicodeRelease\%APPVER% 2> NUL
+copy Build\%PlATFORM%\MergeUnicodeRelease\*.pdb "Build\%PLATFORM%\MergeUnicodeRelease\%APPVER%\"
+goto :eof
index ecd6141..e0ac4bf 100644 (file)
@@ -1,7 +1,17 @@
+if "%1" == "" (
+  call :BuildInstaller
+  call :BuildInstaller x64
+) else (
+  call :BuildInstaller %1 
+)
+goto :eof
+
+:BuildInstaller
+set PLATFORM=%1
 
 for %%i in ("%ProgramFiles(x86)%" "%ProgramFiles%") do (
   if exist "%%~i\Inno Setup 5\iscc.exe" (
-    "%%~i\Inno Setup 5\iscc.exe" "Installer\innosetup\WinMerge.iss" || pause
-    "%%~i\Inno Setup 5\iscc.exe" "Installer\innosetup\WinMergeX64.iss" || pause
+    "%%~i\Inno Setup 5\iscc.exe" "Installer\innosetup\WinMerge%PLATFORM%.iss" || pause
   )
 )
+goto :eof