-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathgenerate4.cmd
More file actions
95 lines (79 loc) · 2.3 KB
/
Copy pathgenerate4.cmd
File metadata and controls
95 lines (79 loc) · 2.3 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
@echo off
setlocal EnableDelayedExpansion
setlocal EnableExtensions
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.
set "PATH_INITIAL=!CD!"
pushd %~dp0
set "PATH_FILE=!CD!"
set "GSL_EXE=gsl -q"
REM Clean directories for generated build artifacts.
rmdir /s /q "output" 2>NUL
call :msg "Current directory: !CD!"
call :msg_heading "Begin Execution context"
call :msg "PATH_INITIAL : !PATH_INITIAL!"
call :msg "PATH_FILE : !PATH_FILE!"
call :msg "GSL_EXE : !GSL_EXE!"
call :msg "GITHUB_PATH : !GITHUB_PATH!"
call :msg_heading "End Execution context"
if not exist "!CD!\generate.cmd" (
call :msg_error "Error: 'generate.cmd' not found in '!CD!'."
exit /b 1
)
if not exist "!CD!\version4.xml" (
call :msg_error "Error: 'version4.xml' not found in '!CD!'."
exit /b 1
)
call :msg "Execute generate.cmd..."
call "!CD!\generate.cmd" "!CD!\version4.xml" %*
if %ERRORLEVEL% neq 0 (
call :msg_error "Failure calling 'generate.cmd'."
exit /b 1
)
REM Restore directory.
popd
call :msg_success "Script execution completed successfully."
REM Delay for manual confirmation.
if not defined CI (
pause
)
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%