-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathgenerate.cmd
More file actions
112 lines (92 loc) · 2.52 KB
/
generate.cmd
File metadata and controls
112 lines (92 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
@echo off
setlocal EnableDelayedExpansion
REM ###########################################################################
REM Copyright (c) 2014-2026 libbitcoin developers (see COPYING).
REM
REM Generate libbitcoin-build artifacts from XML + GSL.
REM
REM This executes the iMatix GSL code generator.
REM See https://github.com/imatix/gsl for details.
REM
REM Direct GSL download https://www.nuget.org/api/v2/package/gsl/4.1.0.1
REM Extract gsl.exe from package using NuGet's File > Export
REM ###########################################################################
REM Do everything relative to this file location.
pushd %~dp0
set "GSL_EXE=gsl -q"
if "%~1"=="" (
call :msg "Usage: %~nx0 configuration [targets...]"
call :msg ""
call :msg " configuration required xml file"
call :msg " targets all targets to be copied"
exit /b 1
)
set "CONFIG=%~1"
shift
set "TARGETS="
call :populate_targets %*
set "NAMES[1]=generate_artifacts"
set "NAMES[2]=copy_statics"
set "NAMES[3]=copy_projects"
set "NAMES.length=3"
for /L %%i in (1,1,%NAMES.length%) do (
call :msg "!GSL_EXE! -q -script:'process\!NAMES[%%i]!.cmd.gsl' '!CONFIG!'"
!GSL_EXE! -q -script:"process\!NAMES[%%i]!.cmd.gsl" "!CONFIG!"
if %ERRORLEVEL% neq 0 (
echo FAILURE: evaluating "process\!NAMES[%%i]!.cmd.gsl".
exit /b %ERRORLEVEL%
)
)
REM Execute process scripts (explicit enumeration).
pushd process
for /L %%i in (1,1,%NAMES.length%) do (
call !NAMES[%%i]!.cmd !targets!
if %ERRORLEVEL% neq 0 (
exit /b %ERRORLEVEL%
)
)
popd
echo "Generation for configuration %CONFIG% complete."
REM Commented out until calling script is obsolete
REM if not defined CI (
REM pause
REM )
exit /b 0
:populate_targets
shift
:begin
if "%1"=="" goto done
set "TARGETS=!TARGETS! %~1"
shift
goto begin
:done
exit /b 0
:msg_heading
call :msg "***************************************************************************"
call :msg "%~1"
call :msg "***************************************************************************"
exit /b %ERRORLEVEL%
:msg
if "%~1" == "" (
echo.
) else (
echo %~1
)
exit /b %ERRORLEVEL%
:msg_empty
echo.
exit /b %ERRORLEVEL%
:msg_verbose
if "!DISPLAY_VERBOSE!" == "yes" (
echo [96m%~1[0m
)
exit /b %ERRORLEVEL%
:msg_success
echo [92m%~1[0m
exit /b %ERRORLEVEL%
:msg_warn
echo [93m%~1[0m
exit /b %ERRORLEVEL%
:msg_error
echo [91m%~1[0m
exit /b %ERRORLEVEL%