feat: add build and test script for Starworld
This commit is contained in:
57
build_and_test.sh
Executable file
57
build_and_test.sh
Executable file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Quick build and test script for Starworld
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "=== Starworld Build & Test Script ==="
|
||||||
|
echo
|
||||||
|
|
||||||
|
# 1. Build the Rust bridge
|
||||||
|
echo "[1/3] Building Rust bridge..."
|
||||||
|
cd "$(dirname "$0")/bridge"
|
||||||
|
cargo build --release
|
||||||
|
echo "✓ Rust bridge built successfully"
|
||||||
|
echo
|
||||||
|
|
||||||
|
# 2. Build the C++ client
|
||||||
|
echo "[2/3] Building C++ client..."
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||||
|
make -j$(nproc)
|
||||||
|
echo "✓ C++ client built successfully"
|
||||||
|
echo
|
||||||
|
|
||||||
|
# 3. Verify the bridge library exists
|
||||||
|
echo "[3/3] Verifying build artifacts..."
|
||||||
|
BRIDGE_PATH="$(dirname "$0")/bridge/target/release/libstardust_bridge.so"
|
||||||
|
if [ -f "$BRIDGE_PATH" ]; then
|
||||||
|
echo "✓ Bridge library found: $BRIDGE_PATH"
|
||||||
|
ls -lh "$BRIDGE_PATH"
|
||||||
|
else
|
||||||
|
echo "✗ Bridge library not found at: $BRIDGE_PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLIENT_PATH="$(dirname "$0")/build/stardust-overte-client"
|
||||||
|
if [ -f "$CLIENT_PATH" ]; then
|
||||||
|
echo "✓ Client executable found: $CLIENT_PATH"
|
||||||
|
ls -lh "$CLIENT_PATH"
|
||||||
|
else
|
||||||
|
echo "✗ Client executable not found at: $CLIENT_PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Build Complete! ==="
|
||||||
|
echo
|
||||||
|
echo "To test with simulation mode:"
|
||||||
|
echo " export STARWORLD_SIMULATE=1"
|
||||||
|
echo " export STARWORLD_BRIDGE_PATH=$(dirname "$0")/bridge/target/release"
|
||||||
|
echo " $(dirname "$0")/build/stardust-overte-client"
|
||||||
|
echo
|
||||||
|
echo "To connect to an Overte server:"
|
||||||
|
echo " export STARWORLD_BRIDGE_PATH=$(dirname "$0")/bridge/target/release"
|
||||||
|
echo " $(dirname "$0")/build/stardust-overte-client ws://domain.example.com:40102"
|
||||||
|
echo
|
||||||
Reference in New Issue
Block a user