Merge pull request #819 from x1nixmzeng/packaging-to-ci

Build chain improvements
This commit is contained in:
Luke Usher 2017-12-07 14:15:50 +00:00 committed by GitHub
commit 9ef778ad43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 22 deletions

3
.gitignore vendored
View File

@ -107,3 +107,6 @@ src/Version.h
*.ipch
*.db-shm
*.db-wal
# Last known git hash
LAST_GIT_VERSION

35
PackageBuild.bat Normal file
View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -115,8 +115,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
</Bscmake>
<PostBuildEvent>
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)
$(SOLUTIONDIR)Export.bat</Command>
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)</Command>
</PostBuildEvent>
<CustomBuildStep>
<Command>
@ -177,8 +176,7 @@ $(SOLUTIONDIR)Export.bat</Command>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Bscmake>
<PostBuildEvent>
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)
$(SOLUTIONDIR)Export.bat</Command>
<Command>copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir)</Command>
</PostBuildEvent>
<CustomBuildStep>
<Command>

View File

@ -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 ..\
)

View File

@ -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
@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