From 94727159e8c89e161845190bd0e7cfe92b52bb0c Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 20 Mar 2018 22:29:02 -0700 Subject: [PATCH] Visual Studio Projects: Cleanup Windows-Binaries procedure for new commit id - New Commit-Id with Commit-Time - Properly execute when the Win32-Development-Binaries needs to be cloned - Properly limit parallel builds if the local system has more than 8 Threads --- .../Win32-Development-Binaries/BuildAll.cmd | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd b/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd index a78ca894..2d9a64f2 100644 --- a/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd +++ b/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd @@ -97,30 +97,29 @@ rem This procedure must be located in the "Visual Studio Projects\Win32-Develop rem The git repository directory (.git) is located relative to that directory. cd %~p0 SET GIT_COMMIT_ID= -if not exist ..\..\.git\hooks\post-commit copy ..\git-hooks\post* ..\..\.git\hooks\ > NUL 2>&1 +if not exist ..\..\.git\hooks\post-commit copy /y ..\git-hooks\post* ..\..\.git\hooks\ > NUL 2>&1 pushd ..\.. git checkout -q master git fetch -q origin master git log -1 --pretty="SIM_GIT_COMMIT_ID %%H%%nSIM_GIT_COMMIT_TIME %%aI" >.git-commit-id popd pushd .. -for /F "usebackq tokens=3" %%i in (`findstr /C:SIM_GIT_COMMIT_ID ..\.git-commit-id`) do set GIT_COMMIT_ID=%%i -for /F "usebackq tokens=3" %%i in (`findstr /C:SIM_GIT_COMMIT_TIME ..\.git-commit-id`) do set GIT_COMMIT_TIME=%%i -for /F "tokens=3 delims=-T" %%i in ("%GIT_COMMIT_TIME%") do set D_YYYY=%%i -for /F "tokens=3 delims=-T" %%i in ("%GIT_COMMIT_TIME%") do set D_MM=%%j -for /F "tokens=3 delims=-T" %%i in ("%GIT_COMMIT_TIME%") do set D_DD=%%k +for /F "usebackq tokens=2" %%i in (`findstr /C:SIM_GIT_COMMIT_ID ..\.git-commit-id`) do set GIT_COMMIT_ID=%%i +for /F "usebackq tokens=2" %%i in (`findstr /C:SIM_GIT_COMMIT_TIME ..\.git-commit-id`) do set GIT_COMMIT_TIME=%%i +for /F "tokens=1 delims=-T" %%i in ("%GIT_COMMIT_TIME%") do set D_YYYY=%%i +for /F "tokens=2 delims=-T" %%i in ("%GIT_COMMIT_TIME%") do set D_MM=%%i +for /F "tokens=3 delims=-T" %%i in ("%GIT_COMMIT_TIME%") do set D_DD=%%i for /F "usebackq tokens=3" %%i in (`findstr/C:"#define SIM_MAJOR" ..\sim_rev.h`) do set _SIM_MAJOR=%%i for /F "usebackq tokens=3" %%i in (`findstr/C:"#define SIM_MINOR" ..\sim_rev.h`) do set _SIM_MINOR=%%i for /F "usebackq tokens=3" %%i in (`findstr/C:"#define SIM_PATCH" ..\sim_rev.h`) do set _SIM_PATCH=-%%i for /F "usebackq tokens=3" %%i in (`findstr/C:"#define SIM_VERSION_MODE" ..\sim_rev.h`) do set _SIM_VERSION_MODE=-%%~i if "%_SIM_PATCH%" equ "-0" set _SIM_PATCH= + set _ZipName=simh-%_SIM_MAJOR%.%_SIM_MINOR%%_SIM_PATCH%%_SIM_VERSION_MODE%--%D_YYYY%-%D_MM%-%D_DD%-%GIT_COMMIT_ID:~0,8%.zip set _ZipPath=..\..\%BIN_REPO% if not exist "%_ZipPath%" mkdir "%_ZipPath%" set _ZipPath=%_ZipPath%\ -if not exist "%_ZipPath%%_ZipName%" vcbuild /M%NUMBER_OF_PROCESSORS% /useenv /rebuild Simh.sln "Release|Win32" -7z a -tzip -x!BuildROMs.exe "%_ZipPath%%_ZipName%" "..\BIN\NT\Win32-Release\*.exe" popd pushd ..\%_ZipPath% if "%1" neq "reset" goto GitAddNew @@ -137,6 +136,14 @@ git push -u origin %BIN_REPO% :GitAddNew if not exist .git git clone "%REMOTE_REPO%" ./ git pull + +pushd %~p0\.. +set _SIM_PARALLEL=8 +if %_SIM_PARALLEL% GTR %NUMBER_OF_PROCESSORS% set _SIM_PARALLEL=%NUMBER_OF_PROCESSORS% +if not exist "%_ZipPath%%_ZipName%" vcbuild /M%_SIM_PARALLEL% /useenv /rebuild Simh.sln "Release|Win32" +7z a -tzip -x!BuildROMs.exe "%_ZipPath%%_ZipName%" "..\BIN\NT\Win32-Release\*.exe" +popd + git add %_ZipName% git commit -m "Build results on %D_YYYY%-%D_MM%-%D_DD% for simh Commit: https://github.com/simh/simh/commit/%GIT_COMMIT_ID%" git push -u origin %BIN_REPO%