ci-windows-build.bat 1.31 KB
Newer Older
1
@echo off
2

3 4 5 6 7 8 9 10 11 12 13
::########################################
::# Fetch test data
::########################################
rmdir /Q /S TestData
:: clone libraries git (set env variable to GIT_SSH_COMMAND maybe use setx once as this key won't change) 
set GIT_SSH_COMMAND=ssh -i E:\\\gitlab\\\id_rsa 
git clone git@roosevelt.informatik.rwth-aachen.de:moebius/OpenFlipper-Test-Data.git TestData

::load configuration and settings
call %~dp0\ci-windows-config.bat

Jan Möbius's avatar
Jan Möbius committed
14 15 16 17

echo "CMAKE_CONFIGURATION: %CMAKE_CONFIGURATION%"


18 19 20 21 22 23 24
mkdir rel
cd rel

::clear any old binary files
del *.exe

::invoke cmake
Jan Möbius's avatar
Jan Möbius committed
25
"C:\Program Files\CMake\bin\cmake.exe"  -DGTEST_PREFIX="%LIBPATH_BASE%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%"  -DCMAKE_BUILD_TYPE=Release -DOPENFLIPPER_BUILD_UNIT_TESTS=TRUE %CMAKE_CONFIGURATION% ..
26 27 28 29

IF %errorlevel% NEQ 0 exit /b %errorlevel%

:: build Open-Flipper
30
echo calling: %VS_PATH%
31 32
%VS_PATH% /Build "Release" OpenFlipper.sln /Project "ALL_BUILD"

33 34 35 36 37 38 39 40 41 42
IF %errorlevel% NEQ 0 exit /b %errorlevel%

:: back to the root folder
cd ..

:: copy all files to a new artifacts folder except the .git folder
:: use the following options to make robocopy silent /NFL /NDL /NJH /NJS /nc /ns /np
robocopy . artifacts /e /NFL /NDL /NJH /NJS /nc /ns /np /xd artifacts /xd .git

::robocopy uses some error codes different from 0 
43
IF %errorlevel% LSS 8 exit /b 0