Merge pull request #819 from x1nixmzeng/packaging-to-ci
Build chain improvements
This commit is contained in:
commit
9ef778ad43
|
@ -107,3 +107,6 @@ src/Version.h
|
||||||
*.ipch
|
*.ipch
|
||||||
*.db-shm
|
*.db-shm
|
||||||
*.db-wal
|
*.db-wal
|
||||||
|
|
||||||
|
# Last known git hash
|
||||||
|
LAST_GIT_VERSION
|
||||||
|
|
|
@ -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 <build_configuration>"
|
||||||
|
goto eof
|
||||||
|
|
||||||
|
:eof
|
|
@ -12,9 +12,10 @@ build:
|
||||||
project: build/win32/Cxbx.sln
|
project: build/win32/Cxbx.sln
|
||||||
parallel: true
|
parallel: true
|
||||||
verbosity: minimal
|
verbosity: minimal
|
||||||
|
after_build:
|
||||||
|
- cmd: PackageBuild.bat %CONFIGURATION%
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: export\Release.zip
|
- path: export/*.zip
|
||||||
- path: export\Debug.zip
|
|
||||||
install:
|
install:
|
||||||
# Git clone happens between init and install
|
# Git clone happens between init and install
|
||||||
- cmd: git submodule update --init --recursive
|
- cmd: git submodule update --init --recursive
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ChildProcessDebuggingSettings IsEnabled="true" xmlns="http://schemas.microsoft.com/vstudio/ChildProcessDebuggingSettings/2014">
|
||||||
|
<DefaultRule Attach="false" />
|
||||||
|
<Rule IsEnabled="true" ProcessName="cxbx.exe" EngineFilter="[inherit]" />
|
||||||
|
</ChildProcessDebuggingSettings>
|
|
@ -115,8 +115,7 @@
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)
|
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)</Command>
|
||||||
$(SOLUTIONDIR)Export.bat</Command>
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<CustomBuildStep>
|
<CustomBuildStep>
|
||||||
<Command>
|
<Command>
|
||||||
|
@ -177,8 +176,7 @@ $(SOLUTIONDIR)Export.bat</Command>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)
|
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)</Command>
|
||||||
$(SOLUTIONDIR)Export.bat</Command>
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<CustomBuildStep>
|
<CustomBuildStep>
|
||||||
<Command>
|
<Command>
|
||||||
|
|
|
@ -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 ..\
|
|
||||||
)
|
|
|
@ -1,6 +1,21 @@
|
||||||
@ECHO OFF
|
@echo off
|
||||||
SET GIT_VERSION=
|
|
||||||
git describe --always > GIT_VERSION
|
git describe --always > GIT_VERSION
|
||||||
for /f "delims=" %%x in (GIT_VERSION) do set GIT_VERSION=%%x
|
@if not exist %~1 (
|
||||||
ECHO #define _GIT_VERSION "%GIT_VERSION%" > "%~1"
|
@goto update
|
||||||
del GIT_VERSION
|
)
|
||||||
|
|
||||||
|
@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
|
||||||
|
|
Loading…
Reference in New Issue