Skip to content

Commit

Permalink
Fix make.bat & Added parallel version of server (unused)
Browse files Browse the repository at this point in the history
Signed-off-by: yjf2002ghty <[email protected]>
  • Loading branch information
yjf2002ghty committed Dec 12, 2024
1 parent 8a3ca4c commit b30d334
Show file tree
Hide file tree
Showing 3 changed files with 856 additions and 9 deletions.
25 changes: 16 additions & 9 deletions release_make/make.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
set nodeversion=node18
cd /d "%~dp0"
rd /s /q .\release-builds
Expand Down Expand Up @@ -45,17 +46,17 @@ if not "%result%"=="" (goto Error)
node make_index.js>.\index.js

call :Make %nodeversion%-win-x64 .\release-builds\win\x64\FairyGround.exe
if "%errorlevel%"=="11" (goto Error)
if "%ERROR%"=="1" (goto Error)
call :Make %nodeversion%-linux-x64 .\release-builds\linux\x64\FairyGround
if "%errorlevel%"=="11" (goto Error)
if "%ERROR%"=="1" (goto Error)
call :Make %nodeversion%-win-arm64 .\release-builds\win\arm64\FairyGround.exe
if "%errorlevel%"=="11" (goto Error)
if "%ERROR%"=="1" (goto Error)
call :Make %nodeversion%-linux-arm64 .\release-builds\linux\arm64\FairyGround
if "%errorlevel%"=="11" (goto Error)
if "%ERROR%"=="1" (goto Error)
call :Make %nodeversion%-macos-x64 .\release-builds\macos\x64\FairyGround.app
if "%errorlevel%"=="11" (goto Error)
if "%ERROR%"=="1" (goto Error)
call :Make %nodeversion%-macos-arm64 .\release-builds\macos\arm64\FairyGround.app
if "%errorlevel%"=="11" (goto Error)
if "%ERROR%"=="1" (goto Error)

cd ..
set result=
Expand Down Expand Up @@ -95,13 +96,16 @@ pause
exit /b 1

:Make
set ERROR=0
start /WAIT /MIN "" cmd.exe /C ^(npx pkg . --target %~1 --output %2 ^& exit ^) ^> %TEMP%\make_fairyground.log 2^>^&1
set result=
FOR /F "usebackq" %%i IN (`findstr /L /I "Error" "%TEMP%\make_fairyground.log"`) DO set result=%%i
if not "%result%"=="" (
echo Fail: Bytecode generation failed. Trying --no-bytecode...
call :TryNoByteCode %~1 %2
if "%errorlevel%"=="11" (exit /b 11)
if "!ERROR!"=="1" (
exit /b 1
)
echo Pass: %~1
exit /b 0
)
Expand All @@ -110,7 +114,9 @@ FOR /F "usebackq" %%i IN (`findstr /L /I "Failed to make bytecode" "%TEMP%\make_
if not "%result%"=="" (
echo Fail: Bytecode generation failed. Trying --no-bytecode...
call :TryNoByteCode %~1 %2
if "%errorlevel%"=="11" (exit /b 11)
if "!ERROR!"=="1" (
exit /b 1
)
echo Pass: %~1
exit /b 0
)
Expand All @@ -129,7 +135,8 @@ FOR /F "usebackq" %%i IN (`findstr /L /I "Error" "%TEMP%\make_fairyground.log"`)
if not "%result%"=="" (
echo Error: Build failed. Check the log below to see what's going on. File: %TEMP%\make_fairyground.log
type "%TEMP%\make_fairyground.log"
exit /b 11
set ERROR=1
exit /b 1
)
set result=
FOR /F "usebackq" %%i IN (`findstr /L /I "Warning" "%TEMP%\make_fairyground.log"`) DO set result=%%i
Expand Down
1 change: 1 addition & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The files in this directory are source files used for the build process of the p
| `src\html\resources.html` | `public\resources.html` | The "Resources" page. |
| `src\js\main.js` | `public\bundle.js` | The main JavaScript file attached to advanced.html which imports ffish.js & Chessground X, and contains all function of position variants (custom positions), board logic and notation system; most of interactive analysis, board setup and search move dialog; part of review mode. |
| `src\js\server.js` | `<root>\server.js` | The fairyground server or backend, which is the controller of binary engines and communicates with the webpage through WebSocket. |
| `src\js\server-parallel.js` | (none) | The parallel version of fairyground server or backend, which has the same function as `server.js` but supports load balance for HTTP. Not used by default, as it's only useful under high request frequency circumstances. |
| `src\js\BinaryEngineFeature.js` | `public\lib\BinaryEngineFeature.js` | This script exports all functions related to binary engines to advanced.html, such as UCI/UCCI/UCI-Cyclone/USI protocol translation, binary engine control logic and engine management/setup/settings UI. It does not contain GUI logic. |
| `src\js\SavedGamesParsingFeature.js` | `public\lib\SavedGamesParsingFeature.js` | This script exports all functions related to PGN/EPD parser, such as file processing and parser UI. It does not contain GUI logic. |
| `src\js\*.canvas.worker.js` | `public\lib\canvas\*.canvas.worker.js` | These scripts are canvas workers that renders the animation in an individual thread at page background for UI theme. They receive a OffscreenCanvas from main page and draw things on them. Changes made to the canvas are committed automatically to main page. You can find which UI theme uses the corresponding script in `public\uithemes.txt`. |
Expand Down
Loading

0 comments on commit b30d334

Please sign in to comment.