-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBuild.bat
More file actions
147 lines (127 loc) · 3.62 KB
/
Copy pathBuild.bat
File metadata and controls
147 lines (127 loc) · 3.62 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@echo off
setlocal enabledelayedexpansion
rem Where RAD Studio is installed. Only needed to locate rsvars.bat, which then exports
rem BDS, BDSCOMMONDIR and BDSUSERDIR for everything this script calls.
if not defined STUDIO_ROOT set "STUDIO_ROOT=C:\Program Files (x86)\Embarcadero\Studio"
rem Newest supported Delphi first: 37.0 is Delphi 13, 23.0 is Delphi 12 Athens.
rem Set CHART4D_STUDIO to a version number to force one of them, or BDS to point at
rem an installation directly: set BDS=D:\Embarcadero\Studio\23.0
if not defined BDS (
if defined CHART4D_STUDIO (
set "BDS=%STUDIO_ROOT%\%CHART4D_STUDIO%"
) else (
for %%V in (37.0 23.0) do (
if not defined BDS if exist "%STUDIO_ROOT%\%%V\bin\rsvars.bat" set "BDS=%STUDIO_ROOT%\%%V"
)
)
)
if not defined BDS (
echo No supported Delphi found under "%STUDIO_ROOT%".
echo Looked for 37.0 ^(Delphi 13^) and 23.0 ^(Delphi 12 Athens^).
echo Set CHART4D_STUDIO to a version number, or STUDIO_ROOT to another install root.
exit /b 1
)
rem The package sources live in a folder per product version.
set "PACKAGEDIR=packages\RAD Studio 13.0"
if "%BDS:~-4%"=="23.0" set "PACKAGEDIR=packages\RAD Studio 12.0"
set RSVARS="%BDS%\bin\rsvars.bat"
set CONFIG=Release
echo ===============================================
echo Chart4D build (%BDS%)
echo ===============================================
if not exist %RSVARS% (
echo rsvars.bat not found at %RSVARS%
exit /b 1
)
call %RSVARS%
if errorlevel 1 (
echo Failed to initialize RAD Studio environment.
exit /b 1
)
rem rsvars.bat clears the PLATFORM environment variable, so it must be
rem (re)set after calling it, not before.
set PLATFORM=Win32
echo.
echo --- Building runtime packages (%CONFIG%, %PLATFORM%) ---
call :BuildPackage Chart4D_R.dproj
if errorlevel 1 exit /b 1
call :BuildPackage Chart4D_VCL_R.dproj
if errorlevel 1 exit /b 1
call :BuildPackage Chart4D_FMX_R.dproj
if errorlevel 1 exit /b 1
echo.
echo --- Building and running tests ---
rem Both platforms, because Win64 maps Extended onto Double: the same source can be
rem correct on one and wrong on the other.
if exist "Tests\build.bat" (
for %%P in (Win32 Win64) do (
call :BuildAndRunTests %%P
if errorlevel 1 exit /b 1
)
) else (
echo Tests\build.bat not found yet, skipping tests.
)
echo.
echo --- Building demos ---
if exist "Examples\VCL\build.bat" (
pushd Examples\VCL
call .\build.bat
if errorlevel 1 (
popd
echo VCL demo build failed!
exit /b 1
)
popd
) else (
echo Examples\VCL\build.bat not found yet, skipping VCL demo.
)
if exist "Examples\FMX\build.bat" (
pushd Examples\FMX
call .\build.bat
if errorlevel 1 (
popd
echo FMX demo build failed!
exit /b 1
)
popd
) else (
echo Examples\FMX\build.bat not found yet, skipping FMX demo.
)
echo.
echo ===============================================
echo Chart4D build finished successfully
echo ===============================================
exit /b 0
:BuildPackage
set PACKAGENAME=%~1
echo.
echo Building %PACKAGENAME%...
msbuild "%PACKAGEDIR%\%PACKAGENAME%" /t:Build /p:Config=%CONFIG% /p:Platform=%PLATFORM%
if errorlevel 1 (
echo Build of %PACKAGENAME% failed!
exit /b 1
)
exit /b 0
:BuildAndRunTests
set TESTPLATFORM=%~1
echo.
echo --- %TESTPLATFORM% ---
pushd Tests
call .\build.bat %TESTPLATFORM%
if errorlevel 1 (
popd
echo Tests build failed for %TESTPLATFORM%!
exit /b 1
)
if exist "%TESTPLATFORM%\Debug\Chart4D.Tests.exe" (
%TESTPLATFORM%\Debug\Chart4D.Tests.exe
if errorlevel 1 (
popd
echo Tests failed for %TESTPLATFORM%!
exit /b 1
)
) else (
echo Test executable for %TESTPLATFORM% not found, skipping test run.
)
popd
exit /b 0