Skip to content

Commit 48f1825

Browse files
Merge pull request #408 from treefrogframework/actions_yml3
update configure.bat
2 parents e5c5064 + 97cfb05 commit 48f1825

File tree

3 files changed

+77
-82
lines changed

3 files changed

+77
-82
lines changed

.github/workflows/actions.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ jobs:
143143
- uses: actions/checkout@main
144144
- name: Homebrew
145145
run: |
146+
which pkg-config || brew install pkg-config
146147
brew install qt6 jq
147-
brew link qt
148148
- name: configure
149149
run: ./configure --prefix=/usr/local
150150
- name: build
@@ -164,8 +164,8 @@ jobs:
164164
- uses: actions/checkout@main
165165
- name: Homebrew
166166
run: |
167-
brew install qt6 pkg-config jq mongo-c-driver gflags glog lz4
168-
brew link qt
167+
which pkg-config || brew install pkg-config
168+
brew install qt6 jq mongo-c-driver gflags glog lz4
169169
- name: configure
170170
run: ./configure --prefix=/usr/local --enable-shared-mongoc --enable-shared-glog --enable-shared-lz4
171171
- name: build
@@ -205,6 +205,7 @@ jobs:
205205
choco install visualstudio2022community -y
206206
choco install visualstudio2022-workload-nativedesktop -y
207207
choco install sqlite -y
208+
choco install cmake -y
208209
- name: Build for debug mode
209210
shell: cmd
210211
run: |
@@ -236,9 +237,8 @@ jobs:
236237
nmake
237238
nmake install
238239
- name: Test release
239-
shell: cmd
240+
working-directory: tools\test\releasetest
240241
run: |
241-
cd tools\test\releasetest
242242
.\releasetest.bat
243243
244244
build-windows-qt67-msvc2019:
@@ -256,6 +256,7 @@ jobs:
256256
choco install visualstudio2019community -y
257257
choco install visualstudio2019-workload-nativedesktop -y
258258
choco install sqlite -y
259+
choco install cmake -y
259260
- name: Build for debug mode
260261
shell: cmd
261262
run: |
@@ -287,9 +288,8 @@ jobs:
287288
nmake
288289
nmake install
289290
- name: Test release
290-
shell: cmd
291+
working-directory: tools\test\releasetest
291292
run: |
292-
cd tools\test\releasetest
293293
.\releasetest.bat
294294
295295
build-windows-qt65-msvc2019:
@@ -307,6 +307,7 @@ jobs:
307307
choco install visualstudio2019community -y
308308
choco install visualstudio2019-workload-nativedesktop -y
309309
choco install sqlite -y
310+
choco install cmake -y
310311
- name: Build for debug mode
311312
shell: cmd
312313
run: |
@@ -338,7 +339,6 @@ jobs:
338339
nmake
339340
nmake install
340341
- name: Test release
341-
shell: cmd
342+
working-directory: tools\test\releasetest
342343
run: |
343-
cd tools\test\releasetest
344344
.\releasetest.bat

configure.bat

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@echo OFF
1+
@echo off
22
@setlocal
33

44
set VERSION=2.10.0
@@ -58,9 +58,9 @@ if "%DEBUG%" == "yes" (
5858
::
5959
:: Generates tfenv.bat
6060
::
61-
for %%I in (nmake.exe) do if exist %%~$path:I set MAKE=%%~$path:I
61+
for %%I in (nmake.exe) do if exist %%~$path:I set NMAKE=%%~$path:I
6262
if "%MAKE%" == "" (
63-
for %%I in (jom.exe) do if exist %%~$path:I set MAKE=%%~$path:I
63+
for %%I in (jom.exe) do if exist %%~$path:I set NMAKE=%%~$path:I
6464
)
6565
for %%I in (qmake.exe) do if exist %%~$path:I set QMAKE=%%~$path:I
6666
for %%I in (cmake.exe) do if exist %%~$path:I set CMAKE=%%~$path:I
@@ -81,7 +81,7 @@ if "%CMAKE%" == "" (
8181
)
8282
cmake --version
8383

84-
if "%MAKE%" == "" (
84+
if "%NMAKE%" == "" (
8585
echo Make not found
8686
pause
8787
exit
@@ -100,14 +100,17 @@ if /i "%Platform%" == "x64" (
100100
:: Visual Studio 2017
101101
set VCVARSOPT=amd64
102102
set CMAKEOPT=-A x64 -T v141
103+
set MSVSVER=2017
103104
) else if "%VisualStudioVersion%" == "16.0" (
104105
:: Visual Studio 2019
105106
set VCVARSOPT=amd64
106107
set CMAKEOPT=-A x64 -T v142
108+
set MSVSVER=2019
107109
) else (
108110
:: Visual Studio 2022
109111
set VCVARSOPT=amd64
110112
set CMAKEOPT=-A x64
113+
set MSVSVER=2022
111114
)
112115
) else (
113116
set VCVARSOPT=x86
@@ -130,7 +133,7 @@ echo set TreeFrog_DIR=%TFDIR%>> %TFENV%
130133
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
131134
echo set QTENV="%QTENV%">> %TFENV%
132135
echo set VCVARSBAT="">> %TFENV%
133-
echo set VSVER=2022 2019 2017>> %TFENV%
136+
echo set VSVER=%MSVSVER%>> %TFENV%
134137
echo set VSWHERE="%%ProgramFiles(x86)%%\Microsoft Visual Studio\Installer\vswhere.exe">> %TFENV%
135138
echo;>> %TFENV%
136139
echo if exist %%QTENV%% call %%QTENV%%>> %TFENV%
@@ -157,7 +160,6 @@ echo set VSWHERE=>> %TFENV%
157160
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
158161
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
159162
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
160-
echo cd /D %%HOMEDRIVE%%%%HOMEPATH%%>> %TFENV%
161163

162164
set TFDIR=%TFDIR:\=/%
163165
del /f /q .qmake.stash src\.qmake.stash tools\.qmake.stash >nul 2>&1
@@ -236,17 +238,17 @@ if ERRORLEVEL 1 (
236238

237239
:: Builds TreeFrog
238240
cd %BASEDIR%src
239-
if exist Makefile ( "%MAKE%" -k distclean >nul 2>&1 )
241+
if exist Makefile ( nmake distclean >nul 2>&1 )
240242
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%
241243

242244
cd %BASEDIR%tools
243-
if exist Makefile ( "%MAKE%" -k distclean >nul 2>&1 )
245+
if exist Makefile ( nmake distclean >nul 2>&1 )
244246
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
245-
"%MAKE%" qmake
247+
nmake qmake
246248

247249
echo;
248-
echo First, run "%MAKE% install" in src directory.
249-
echo Next, run "%MAKE% install" in tools directory.
250+
echo First, run "nmake install" in src directory.
251+
echo Next, run "nmake install" in tools directory.
250252

251253
:exit
252254
exit /b

tools/test/releasetest/releasetest.bat

Lines changed: 55 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ if not "%TFENV%" == "" (
1616
call "..\..\..\tfenv.bat"
1717
)
1818

19-
for %%I in (nmake.exe) do if exist %%~$path:I set MAKE=%%~$path:I
20-
if "%MAKE%" == "" (
21-
for %%I in (jom.exe) do if exist %%~$path:I set MAKE=%%~$path:I
22-
if not "%MAKE%" == "" (
23-
set MAKE=jom
19+
for %%I in (nmake.exe) do if exist %%~$path:I set NMAKE=%%~$path:I
20+
if "%NMAKE%" == "" (
21+
for %%I in (jom.exe) do if exist %%~$path:I set NMAKE=%%~$path:I
22+
if not "%NMAKE%" == "" (
23+
set NMAKE=jom
2424
)
2525
) else (
26-
set MAKE=nmake VERBOSE=1
26+
set NMAKE=nmake VERBOSE=1
2727
)
2828
for %%I in (qmake.exe) do if exist %%~$path:I set QMAKE=%%~$path:I
2929
for %%I in (cmake.exe) do if exist %%~$path:I set CMAKE=%%~$path:I
3030
for %%I in (sqlite3.exe) do if exist %%~$path:I set SQLITE=%%~$path:I
3131
if "%SQLITE%" == "" for %%I in (sqlite3-bin.exe) do if exist %%~$path:I set SQLITE=%%~$path:I
3232

33-
if "%MAKE%" == "" (
33+
if "%NMAKE%" == "" (
3434
echo;
3535
echo nmake.exe not found.
3636
call :CleanUp
@@ -59,7 +59,7 @@ if /i "%Platform%" == "x64" (
5959
)
6060

6161
cd /D %BASEDIR%
62-
rd /Q /S %APPNAME%
62+
rd /Q /S %APPNAME% >nul 2>nul
6363
tspawn new %APPNAME%
6464
if "%SQLITE%" == "" (
6565
echo;
@@ -73,40 +73,29 @@ cd %APPDIR%
7373
echo n | tspawn s blog
7474
tspawn w foo
7575

76-
:: Set ExecutionPolicy
77-
@REM for %%I in (tadpoled.exe) do if exist %%~$path:I set TADPOLED=%%~$path:I
78-
@REM for %%I in (tadpole.exe) do if exist %%~$path:I set TADPOLE=%%~$path:I
79-
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser -Force"
80-
@REM powershell -command "New-NetFirewallRule -DisplayName MyAppAccess1 -Direction Inbound -Action Allow -Profile Public,Private -Program '%TADPOLED%' -Protocol TCP -LocalPort %PORT% -RemoteAddress 127.0.0.1" >nul 2>&1
81-
@REM powershell -command "New-NetFirewallRule -DisplayName MyAppAccess2 -Direction Inbound -Action Allow -Profile Public,Private -Program '%TADPOLE%' -Protocol TCP -LocalPort %PORT% -RemoteAddress 127.0.0.1" >nul 2>&1
82-
8376
:: Test in debug mode
84-
if not "%CMAKE%" == "" (
85-
call :CMakeBuild Debug
86-
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
87-
call :CheckWebApp treefrogd.exe
88-
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
89-
)
77+
call :CMakeBuild Debug
78+
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
79+
call :CheckWebApp treefrogd.exe
80+
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
9081

9182
call :QMakeBuild debug
9283
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
9384
call :CheckWebApp treefrogd.exe
9485
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
95-
%MAKE% distclean >nul 2>nul
86+
nmake distclean >nul 2>nul
9687

9788
:: Test in release mode
98-
if not "%CMAKE%" == "" (
99-
call :CMakeBuild Release
100-
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
101-
call :CheckWebApp treefrog.exe
102-
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
103-
)
89+
call :CMakeBuild Release
90+
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
91+
call :CheckWebApp treefrog.exe
92+
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
10493

10594
call :QMakeBuild release
10695
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
10796
call :CheckWebApp treefrog.exe
10897
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
109-
%MAKE% distclean >nul 2>nul
98+
nmake distclean >nul 2>nul
11099

111100
echo;
112101
echo Test OK
@@ -145,8 +134,8 @@ exit /B 0
145134
:QMakeBuild
146135
cd /D %APPDIR%
147136
del /Q /F lib\*.*
148-
qmake -r CONFIG+=%1
149-
%MAKE%
137+
"%QMAKE%" -r CONFIG+=%1
138+
%NMAKE%
150139
if ERRORLEVEL 1 (
151140
echo;
152141
echo Build Error!
@@ -167,49 +156,53 @@ if "%TREEFROG%" == "" (
167156
exit /B 1
168157
)
169158

170-
"%1" -v
171-
"%1" -l
172-
"%1" --show-routes
159+
echo "%TREEFROG%" -v
160+
"%TREEFROG%" -v 2>&1
161+
echo "%TREEFROG%" -l
162+
"%TREEFROG%" -l 2>&1
163+
echo "%TREEFROG%" --show-routes
164+
"%TREEFROG%" --show-routes 2>&1
173165
if ERRORLEVEL 1 (
174166
echo App Error!
175167
exit /B 1
176168
)
177169
echo;
178170

179-
"%1" --settings
171+
echo "%TREEFROG%" --settings
172+
"%TREEFROG%" --settings 2>&1
180173
if ERRORLEVEL 1 (
181174
echo App Error!
182175
type log\treefrog.log
183176
exit /B 1
184177
)
185178
echo;
186179

187-
@REM echo Starting webapp..
188-
@REM set RES=1
189-
@REM "%1" -e dev -d -p %PORT% %APPDIR%
190-
@REM if ERRORLEVEL 1 (
191-
@REM echo App Start Error!
192-
@REM exit /B 1
193-
@REM )
194-
195-
@REM timeout 1 /nobreak >nul
196-
@REM set URL=http://localhost:%PORT%/blog
197-
@REM set CMD=curl -s "%URL%" -w "%%{http_code}" -o nul
198-
@REM set RESCODE=0
199-
@REM for /f "usebackq delims=" %%a in (`%CMD%`) do set RESCODE=%%a
200-
@REM "%1" -k stop %APPDIR%
201-
@REM if ERRORLEVEL 1 (
202-
@REM "%1" -k abort %APPDIR%
203-
@REM )
204-
@REM timeout 1 /nobreak >nul
205-
@REM if not "%RESCODE%"=="200" (
206-
@REM echo HTTP request failed
207-
@REM echo;
208-
@REM echo App Test Error!
209-
@REM call :CleanUp
210-
@REM exit /B 1
211-
@REM )
212-
@REM echo HTTP request success "%URL%"
180+
echo Starting webapp..
181+
set RES=1
182+
"%1" -e dev -d -p %PORT% %APPDIR%
183+
if ERRORLEVEL 1 (
184+
echo App Start Error!
185+
exit /B 1
186+
)
187+
188+
timeout 1 /nobreak >nul
189+
set URL=http://localhost:%PORT%/blog
190+
set CMD=curl -s "%URL%" -w "%%{http_code}" -o nul
191+
set RESCODE=0
192+
for /f "usebackq delims=" %%a in (`%CMD%`) do set RESCODE=%%a
193+
"%1" -k stop %APPDIR%
194+
if ERRORLEVEL 1 (
195+
"%1" -k abort %APPDIR%
196+
)
197+
timeout 1 /nobreak >nul
198+
if not "%RESCODE%"=="200" (
199+
echo HTTP request failed
200+
echo;
201+
echo App Test Error!
202+
call :CleanUp
203+
exit /B 1
204+
)
205+
echo HTTP request success "%URL%"
213206

214207
exit /B 0
215208

@@ -218,7 +211,7 @@ exit /B 0
218211
::
219212
:CleanUp
220213
cd /D %BASEDIR%
221-
rd /Q /S %APPNAME%
214+
rd /Q /S %APPNAME% >nul 2>nul
222215
exit /B 0
223216

224217
:: which cmd

0 commit comments

Comments
 (0)