diff --git a/.gitignore b/.gitignore index bed11a208..415087c47 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,6 @@ src/Version.h *.ipch *.db-shm *.db-wal + +# Last known git hash +LAST_GIT_VERSION diff --git a/PackageBuild.bat b/PackageBuild.bat new file mode 100644 index 000000000..7bd370d0d --- /dev/null +++ b/PackageBuild.bat @@ -0,0 +1,35 @@ +@echo off + +@if "%1"=="" goto no_arg + +set BUILD_PATH=build\win32\%1\ + +if not exist COPYING goto no_preq +if not exist README.md goto no_preq +if not exist %BUILD_PATH%Cxbx.exe goto no_build +if not exist %BUILD_PATH%glew32.dll goto no_build +if not exist %BUILD_PATH%subhook.dll goto no_build + +set ZIP_APP="import\7za\7za.exe" +set EXPORT_ZIP=export\%1.zip + +@call %ZIP_APP% a %EXPORT_ZIP% COPYING README.md +cd %BUILD_PATH% +@call ..\..\..\%ZIP_APP% u ..\..\..\%EXPORT_ZIP% Cxbx.exe glew32.dll subhook.dll +cd /d %~dp0 +echo Finished packaging %EXPORT_ZIP%! +goto eof + +:no_preq +echo Missing files from repo +goto eof + +:no_build +echo Missing build at path %BUILD_PATH% +goto eof + +:no_arg +echo "Usage: %0 " +goto eof + +:eof \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index c7e6bc723..eb47c60c3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,9 +12,10 @@ build: project: build/win32/Cxbx.sln parallel: true verbosity: minimal +after_build: + - cmd: PackageBuild.bat %CONFIGURATION% artifacts: -- path: export\Release.zip -- path: export\Debug.zip +- path: export/*.zip install: # Git clone happens between init and install - - cmd: git submodule update --init --recursive \ No newline at end of file + - cmd: git submodule update --init --recursive diff --git a/build/win32/Cxbx.ChildProcessDbgSettings b/build/win32/Cxbx.ChildProcessDbgSettings new file mode 100644 index 000000000..6cf4800cc --- /dev/null +++ b/build/win32/Cxbx.ChildProcessDbgSettings @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/build/win32/Cxbx.vcxproj b/build/win32/Cxbx.vcxproj index c8b1c1814..784e2cba2 100644 --- a/build/win32/Cxbx.vcxproj +++ b/build/win32/Cxbx.vcxproj @@ -115,8 +115,7 @@ true - copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir) -$(SOLUTIONDIR)Export.bat + copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir) @@ -177,8 +176,7 @@ $(SOLUTIONDIR)Export.bat true - copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir) -$(SOLUTIONDIR)Export.bat + copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir) diff --git a/build/win32/Export.bat b/build/win32/Export.bat deleted file mode 100644 index 0973ad293..000000000 --- a/build/win32/Export.bat +++ /dev/null @@ -1,10 +0,0 @@ -if exist Release\Cxbx.exe ( -cd Release -..\..\..\import\7za\7za.exe a ..\..\..\export\Release.zip Cxbx.exe glew32.dll subhook.dll ..\..\..\COPYING ..\..\..\README.md -cd ..\ -) -if exist Debug\Cxbx.exe ( -cd Debug -..\..\..\import\7za\7za.exe a ..\..\..\export\Debug.zip Cxbx.exe glew32.dll subhook.dll ..\..\..\COPYING ..\..\..\README.md -cd ..\ -) diff --git a/build/win32/Version.bat b/build/win32/Version.bat index ba7c5c57b..f62cee913 100644 --- a/build/win32/Version.bat +++ b/build/win32/Version.bat @@ -1,6 +1,21 @@ -@ECHO OFF -SET GIT_VERSION= +@echo off + git describe --always > GIT_VERSION -for /f "delims=" %%x in (GIT_VERSION) do set GIT_VERSION=%%x -ECHO #define _GIT_VERSION "%GIT_VERSION%" > "%~1" -del GIT_VERSION \ No newline at end of file +@if not exist %~1 ( +@goto update +) + +@if exist LAST_GIT_VERSION ( +fc GIT_VERSION LAST_GIT_VERSION > nul +@if errorlevel 1 goto update +@del GIT_VERSION +@goto eof +) + +:update +@for /f "delims=" %%x in (GIT_VERSION) do set GIT_VERSION=%%x +@echo #define _GIT_VERSION "%GIT_VERSION%" > "%~1" +echo Updated %~1 with latest git revision number +@move /Y GIT_VERSION LAST_GIT_VERSION > nul + +:eof