Skip to content

Commit 65e7dd8

Browse files
committed
Italian Promises and Letter Trails.
1 parent f08ed30 commit 65e7dd8

22 files changed

Lines changed: 1639 additions & 5 deletions
2.54 KB
Binary file not shown.

out/http/BinaryHttpServer.class

120 Bytes
Binary file not shown.

scripts/build-jar-macos.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# ═══════════════════════════════════════════════════════════════════════════════
3+
# NitroWebExpress™ — Build Fat JAR (macOS)
4+
# Wrapper around build-jar.sh that handles macOS specifics.
5+
# Usage: bash scripts/build-jar-macos.sh
6+
# ═══════════════════════════════════════════════════════════════════════════════
7+
8+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
9+
10+
# Set JAVA_HOME for macOS
11+
export JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home -v 21 2>/dev/null || echo /opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home)}"
12+
13+
if [ ! -d "$JAVA_HOME" ]; then
14+
echo "[FAIL] Java 21 not found. Install: brew install openjdk@21"
15+
exit 1
16+
fi
17+
18+
export PATH="$JAVA_HOME/bin:$PATH"
19+
20+
# macOS mktemp needs a template with X's
21+
export TMPDIR="${TMPDIR:-/tmp}"
22+
23+
# The main build script is Linux/macOS compatible
24+
exec bash "$ROOT/scripts/build-jar.sh" "$@"

scripts/build-jar.bat

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
@echo off
2+
REM ═══════════════════════════════════════════════════════════════════════════════
3+
REM NitroWebExpress™ — Build Fat JAR (Windows)
4+
REM Compiles all sources and packages into nwe.jar.
5+
REM Usage: scripts\build-jar.bat
6+
REM ═══════════════════════════════════════════════════════════════════════════════
7+
setlocal enabledelayedexpansion
8+
9+
set "ROOT=%~dp0.."
10+
pushd "%ROOT%"
11+
set "ROOT=%CD%"
12+
popd
13+
14+
set "SRC=%ROOT%\source"
15+
set "OUT=%ROOT%\out"
16+
set "JAR_OUT=%ROOT%\nwe.jar"
17+
set "MYSQL_JAR=%ROOT%\jars\mysql\mysql-connector-j-9.7.0.jar"
18+
set "LANTERNA_JAR=%ROOT%\jars\lanterna-3.1.5.jar"
19+
set "DJL_DIR=%ROOT%\jars\djl"
20+
set "STAGING=%TEMP%\nwe-jar-staging"
21+
22+
echo === NitroWebExpress — JAR Builder (Windows) ===
23+
echo ROOT: %ROOT%
24+
echo.
25+
26+
REM ── 1. Compile ──────────────────────────────────────────────────────────────
27+
echo [1/3] Compiling sources...
28+
if not exist "%OUT%" mkdir "%OUT%"
29+
set "CP=%OUT%;%MYSQL_JAR%;%LANTERNA_JAR%"
30+
for /r "%DJL_DIR%" %%J in (*.jar) do set "CP=!CP!;%%J"
31+
32+
dir /s /b "%SRC%\*.java" > "%TEMP%\nwe-sources.txt" 2>nul
33+
javac --release 21 -cp "%CP%" -sourcepath "%SRC%" -d "%OUT%" @"%TEMP%\nwe-sources.txt" 2>&1
34+
del "%TEMP%\nwe-sources.txt" 2>nul
35+
echo Compiled.
36+
37+
REM ── 2. Assemble fat JAR ────────────────────────────────────────────────────
38+
echo [2/3] Assembling fat JAR...
39+
if exist "%STAGING%" rmdir /S /Q "%STAGING%"
40+
mkdir "%STAGING%"
41+
42+
REM Copy application classes
43+
xcopy /E /I /Y "%OUT%\*" "%STAGING%\" >nul 2>&1
44+
45+
REM Extract dependency JARs
46+
if exist "%MYSQL_JAR%" (
47+
powershell -NoProfile -Command "Expand-Archive -Path '%MYSQL_JAR%' -DestinationPath '%STAGING%' -Force" 2>nul
48+
del "%STAGING%\META-INF\MANIFEST.MF" 2>nul
49+
del "%STAGING%\META-INF\*.SF" 2>nul
50+
del "%STAGING%\META-INF\*.RSA" 2>nul
51+
)
52+
if exist "%LANTERNA_JAR%" (
53+
powershell -NoProfile -Command "Expand-Archive -Path '%LANTERNA_JAR%' -DestinationPath '%STAGING%' -Force" 2>nul
54+
del "%STAGING%\META-INF\MANIFEST.MF" 2>nul
55+
del "%STAGING%\META-INF\*.SF" 2>nul
56+
)
57+
58+
REM DJL jars (skip native blobs)
59+
for /r "%DJL_DIR%" %%J in (*.jar) do (
60+
echo %%~nxJ | findstr /i "native" >nul || (
61+
powershell -NoProfile -Command "Expand-Archive -Path '%%J' -DestinationPath '%STAGING%' -Force" 2>nul
62+
del "%STAGING%\META-INF\MANIFEST.MF" 2>nul
63+
del "%STAGING%\META-INF\*.SF" 2>nul
64+
)
65+
)
66+
67+
REM Write manifest
68+
if not exist "%STAGING%\META-INF" mkdir "%STAGING%\META-INF"
69+
(
70+
echo Manifest-Version: 1.0
71+
echo Main-Class: Main
72+
echo Class-Path: jars/djl/pytorch-native-cpu-2.5.1-linux-x86_64.jar
73+
) > "%STAGING%\META-INF\MANIFEST.MF"
74+
75+
REM ── 3. Create JAR ──────────────────────────────────────────────────────────
76+
echo [3/3] Creating %JAR_OUT%...
77+
jar cfm "%JAR_OUT%" "%STAGING%\META-INF\MANIFEST.MF" -C "%STAGING%" .
78+
79+
REM Cleanup staging
80+
rmdir /S /Q "%STAGING%" 2>nul
81+
82+
for %%F in ("%JAR_OUT%") do echo Done. Size: %%~zF bytes
83+
echo.
84+
echo === Run with: java -jar nwe.jar ===
85+
endlocal
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# ═══════════════════════════════════════════════════════════════════════════════
3+
# NitroWebExpress™ — Compile All Modules (macOS)
4+
# Wrapper around compile-all-modules.sh that sets JAVA_HOME for macOS.
5+
# Usage: bash scripts/compile-all-modules-macos.sh
6+
# ═══════════════════════════════════════════════════════════════════════════════
7+
8+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
9+
10+
# Set JAVA_HOME for macOS
11+
export JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home -v 21 2>/dev/null || echo /opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home)}"
12+
13+
if [ ! -d "$JAVA_HOME" ]; then
14+
echo "[FAIL] Java 21 not found. Install: brew install openjdk@21"
15+
exit 1
16+
fi
17+
18+
echo "[*] JAVA_HOME=$JAVA_HOME"
19+
export PATH="$JAVA_HOME/bin:$PATH"
20+
21+
# The main compile script is Linux/macOS compatible (: classpath separator)
22+
exec bash "$ROOT/scripts/compile-all-modules.sh" "$@"

scripts/compile-all-modules.bat

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
@echo off
2+
REM ═══════════════════════════════════════════════════════════════════════════════
3+
REM NitroWebExpress™ — Compile All Modules (Windows)
4+
REM Compiles .java → .class into out\. Safe to run after every git pull.
5+
REM Usage: scripts\compile-all-modules.bat
6+
REM ═══════════════════════════════════════════════════════════════════════════════
7+
setlocal enabledelayedexpansion
8+
9+
set "ROOT=%~dp0.."
10+
pushd "%ROOT%"
11+
set "ROOT=%CD%"
12+
popd
13+
set "OUT=%ROOT%\out"
14+
if not exist "%OUT%" mkdir "%OUT%"
15+
16+
REM ── Build classpath ─────────────────────────────────────────────────────────
17+
set "MYSQL_JAR=%ROOT%\jars\mysql\mysql-connector-j-9.7.0.jar"
18+
set "LANTERNA_JAR=%ROOT%\jars\lanterna-3.1.5.jar"
19+
set "CP=%OUT%;%MYSQL_JAR%;%LANTERNA_JAR%"
20+
21+
REM Add DJL JARs
22+
for /r "%ROOT%\jars\djl" %%J in (*.jar) do set "CP=!CP!;%%J"
23+
24+
echo ═══════════════════════════════════════════════════════════════
25+
echo NWE — Compile All Modules (Windows)
26+
echo ═══════════════════════════════════════════════════════════════
27+
echo.
28+
29+
REM ── Source paths ────────────────────────────────────────────────────────────
30+
set "SP=%ROOT%\source;%ROOT%\modules\fbi\source;%ROOT%\modules\cia\source;%ROOT%\modules\nsa\source;%ROOT%\modules\duke\source;%ROOT%\modules\library\source;%ROOT%\modules\gray\source;%ROOT%\modules\gray.a85\source;%ROOT%\modules\red\Futures\source"
31+
32+
REM ── 1. Core sources ─────────────────────────────────────────────────────────
33+
echo [1/8] Core sources (source\)...
34+
dir /s /b "%ROOT%\source\*.java" > "%TEMP%\nwe-core.txt" 2>nul
35+
javac -d "%OUT%" -cp "%CP%" -sourcepath "%SP%" @"%TEMP%\nwe-core.txt" 2>&1 | findstr /i "error" || echo OK
36+
del "%TEMP%\nwe-core.txt" 2>nul
37+
38+
REM ── 2. FBI/CIA/NSA, Duke, Library ───────────────────────────────────────────
39+
echo [2/8] FBI/CIA/NSA, Duke, Library...
40+
set "MOD_FILES="
41+
if exist "%ROOT%\modules\fbi\source\CaliforniaFBIServer.java" set "MOD_FILES=!MOD_FILES! "%ROOT%\modules\fbi\source\CaliforniaFBIServer.java""
42+
if exist "%ROOT%\modules\cia\source\CaliforniaCIAServer.java" set "MOD_FILES=!MOD_FILES! "%ROOT%\modules\cia\source\CaliforniaCIAServer.java""
43+
if exist "%ROOT%\modules\nsa\source\CaliforniaNSAServer.java" set "MOD_FILES=!MOD_FILES! "%ROOT%\modules\nsa\source\CaliforniaNSAServer.java""
44+
if exist "%ROOT%\modules\duke\source\DukeUniversityServer.java" set "MOD_FILES=!MOD_FILES! "%ROOT%\modules\duke\source\DukeUniversityServer.java""
45+
if exist "%ROOT%\modules\library\source\StanfordLibraryServer.java" set "MOD_FILES=!MOD_FILES! "%ROOT%\modules\library\source\StanfordLibraryServer.java""
46+
if defined MOD_FILES (
47+
javac -d "%OUT%" -cp "%CP%" -sourcepath "%SP%" !MOD_FILES! 2>&1 | findstr /i "error" || echo OK
48+
) else echo SKIP
49+
50+
REM ── 3. Gray registries ──────────────────────────────────────────────────────
51+
echo [3/8] Gray Port Registry + Gray85...
52+
set "GRAY_FILES="
53+
if exist "%ROOT%\modules\gray\source\GrayPortRegistryServer.java" set "GRAY_FILES=!GRAY_FILES! "%ROOT%\modules\gray\source\GrayPortRegistryServer.java""
54+
if exist "%ROOT%\modules\gray\source\PortBindingGate.java" set "GRAY_FILES=!GRAY_FILES! "%ROOT%\modules\gray\source\PortBindingGate.java""
55+
if exist "%ROOT%\modules\gray.a85\source\Gray85PortRegistryServer.java" set "GRAY_FILES=!GRAY_FILES! "%ROOT%\modules\gray.a85\source\Gray85PortRegistryServer.java""
56+
if exist "%ROOT%\modules\gray.a85\source\PortBindingGate85.java" set "GRAY_FILES=!GRAY_FILES! "%ROOT%\modules\gray.a85\source\PortBindingGate85.java""
57+
if defined GRAY_FILES (
58+
javac -d "%OUT%" -cp "%CP%" -sourcepath "%SP%;%ROOT%\modules\gray\source;%ROOT%\modules\gray.a85\source" !GRAY_FILES! 2>&1 | findstr /i "error" || echo OK
59+
) else echo SKIP
60+
61+
REM ── 4. Futures ──────────────────────────────────────────────────────────────
62+
echo [4/8] Futures (DemocraticAIServer)...
63+
if exist "%ROOT%\modules\red\Futures\source" (
64+
dir /s /b "%ROOT%\modules\red\Futures\source\*.java" > "%TEMP%\futures.txt" 2>nul
65+
for %%F in ("%TEMP%\futures.txt") do if %%~zF gtr 0 (
66+
javac -d "%OUT%" -cp "%CP%" -sourcepath "%SP%" @"%TEMP%\futures.txt" 2>&1 | findstr /i "error" || echo OK
67+
) else echo SKIP
68+
del "%TEMP%\futures.txt" 2>nul
69+
) else echo SKIP
70+
71+
REM ── 5. StrernaryDirectory ───────────────────────────────────────────────────
72+
echo [5/8] StrernaryDirectory (port 2000)...
73+
if exist "%ROOT%\source\strernary\StrernaryDirectoryServer.java" (
74+
javac -d "%OUT%" -cp "%CP%" -sourcepath "%ROOT%\source" "%ROOT%\source\strernary\StrernaryDirectoryServer.java" 2>&1 | findstr /i "error" || echo OK
75+
) else echo SKIP
76+
77+
REM ── 6. AE6E66 ──────────────────────────────────────────────────────────────
78+
echo [6/8] AE6E66 (UK Parliament)...
79+
if exist "%ROOT%\modules\AE6E66\source" (
80+
dir /s /b "%ROOT%\modules\AE6E66\source\*.java" > "%TEMP%\ae6e66.txt" 2>nul
81+
for %%F in ("%TEMP%\ae6e66.txt") do if %%~zF gtr 0 (
82+
javac -d "%OUT%" -cp "%CP%" -sourcepath "%SP%;%ROOT%\modules\AE6E66\source" @"%TEMP%\ae6e66.txt" 2>&1 | findstr /i "error" || echo OK
83+
) else echo SKIP
84+
del "%TEMP%\ae6e66.txt" 2>nul
85+
) else echo SKIP
86+
87+
REM ── 7. GDGH ─────────────────────────────────────────────────────────────────
88+
echo [7/8] Green.Durham.Grass.and.Herb...
89+
if exist "%ROOT%\modules\Green.Durham.Grass.and.Herb\source" (
90+
dir /s /b "%ROOT%\modules\Green.Durham.Grass.and.Herb\source\*.java" > "%TEMP%\gdgh.txt" 2>nul
91+
for %%F in ("%TEMP%\gdgh.txt") do if %%~zF gtr 0 (
92+
javac -d "%OUT%" -cp "%CP%" -sourcepath "%SP%;%ROOT%\modules\Green.Durham.Grass.and.Herb\source" @"%TEMP%\gdgh.txt" 2>&1 | findstr /i "error" || echo OK
93+
) else echo SKIP
94+
del "%TEMP%\gdgh.txt" 2>nul
95+
) else echo SKIP
96+
97+
REM ── 8. Verify ───────────────────────────────────────────────────────────────
98+
echo [8/8] Verifying key classes...
99+
set MISSING=0
100+
if not exist "%OUT%\Main.class" (echo [MISSING] Main.class & set /a MISSING+=1)
101+
if not exist "%OUT%\source\CaliforniaFBIServer.class" (echo [MISSING] CaliforniaFBIServer.class & set /a MISSING+=1)
102+
if not exist "%OUT%\source\CaliforniaCIAServer.class" (echo [MISSING] CaliforniaCIAServer.class & set /a MISSING+=1)
103+
if not exist "%OUT%\source\CaliforniaNSAServer.class" (echo [MISSING] CaliforniaNSAServer.class & set /a MISSING+=1)
104+
if not exist "%OUT%\strernary\StrernaryDirectoryServer.class" (echo [MISSING] StrernaryDirectoryServer.class & set /a MISSING+=1)
105+
if %MISSING%==0 echo All key classes present.
106+
107+
echo.
108+
echo ═══════════════════════════════════════════════════════════════
109+
echo Compilation complete.
110+
echo Restart: scripts\start-backends.bat
111+
echo ═══════════════════════════════════════════════════════════════
112+
endlocal

0 commit comments

Comments
 (0)