From d2688a197bd680580699f05e8194f9180e4832fa Mon Sep 17 00:00:00 2001 From: Kostya Date: Tue, 18 Aug 2026 06:52:47 +0000 Subject: Add XML schema validation, split build scripts by module, rename BuyMenuCommand to PlaceOrderMenuCommand Introduces XMLValidatorV1 and deserializer/adapter classes for events, ledgers, markets, users, and trading mechanisms. Replaces the monolithic build.bat/run.sh scripts with per-module tools (_util.sh, build.sh, package.sh, test.sh) that compile in dependency order. --- tools/build.bat | 72 --------------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 tools/build.bat (limited to 'tools/build.bat') diff --git a/tools/build.bat b/tools/build.bat deleted file mode 100644 index eb6b460..0000000 --- a/tools/build.bat +++ /dev/null @@ -1,72 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -echo === 1. Cleaning Workspace === -if exist bin rmdir /s /q bin -if exist stage rmdir /s /q stage -if exist dist rmdir /s /q dist -mkdir bin\classes -mkdir bin\test-classes -mkdir stage -mkdir dist - -echo === 2. Compiling Production Code === -dir /s /b src\main\java\*.java > sources.txt -javac -d bin\classes -cp "lib/*" @sources.txt -if %errorlevel% neq 0 exit /b %errorlevel% - -echo === 3. Compiling Test Code === -dir /s /b src\test\java\*.java > test-sources.txt -javac -d bin\test-classes -cp "bin\classes;lib/*" @test-sources.txt -if %errorlevel% neq 0 exit /b %errorlevel% - -echo === 4. Running Automated Tests === -set "JUNIT_JAR=" -for %%f in (lib\junit-platform-console-standalone-*.jar) do set "JUNIT_JAR=%%f" -if not defined JUNIT_JAR (echo JUnit jar missing. & exit /b 1) - -rem JUnit's --class-path does NOT expand lib\* -> build it explicitly -set "TEST_CP=bin\classes;bin\test-classes" -for %%j in (lib\*.jar) do set "TEST_CP=!TEST_CP!;%%j" - -java -jar "!JUNIT_JAR!" execute -cp "!TEST_CP!" --scan-classpath -if %errorlevel% neq 0 ( - echo [X] Tests failed! Aborting build package. - exit /b %errorlevel% -) -echo [OK] Tests passed successfully! - -echo === 5. Extracting Dependencies for Fat JAR === -cd stage -for %%j in (..\lib\*.jar) do ( - echo %%~nxj | findstr /i "junit-platform-console-standalone" >nul - if errorlevel 1 ( - echo Extracting: %%~nxj - jar -xf "%%j" - ) -) - -rem Strip signatures + manifests (they break repacking) but KEEP -rem META-INF\services so ServiceLoader-based deps still work at runtime. -if exist META-INF ( - del /s /q META-INF\*.SF >nul 2>&1 - del /s /q META-INF\*.RSA >nul 2>&1 - del /s /q META-INF\*.DSA >nul 2>&1 - del /q META-INF\MANIFEST.MF >nul 2>&1 -) -cd .. - -echo === 6. Merging Assets into Fat JAR === -rem Merge ONLY production classes on top of the extracted deps -xcopy /e /q /y /i bin\classes\* stage\ >nul -rem Package the whole tree (deps + your classes), not just stage\classes -jar cfe dist/app.jar com.example.App -C stage . -if %errorlevel% neq 0 exit /b %errorlevel% - -del sources.txt test-sources.txt >nul 2>&1 -rmdir /s /q stage -echo ====================================== -echo Fat JAR Created! Run it with: -echo java -jar dist/app.jar -echo ====================================== -pause -- cgit v1.2.3