- Rename tests/wasm-app/ to tests/apps/ for brevity - Move lib/gl_immediate_shim.js to wasm/shims/ (consolidates WASM files) - Delete docs/ directory (outdated Nov 2024 research docs) - Delete patches/ directory (already applied to fork submodules) - Delete wasm/patches/ and wasm/config/ (empty/unused) - Update all file references in scripts, configs, and documentation - Update .gitignore for new tests/apps/ paths Verified both build workflows pass: - wxWidgets tests: 255 passed - Docker KiCad build: completed successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
2 KiB
Shell
Executable file
44 lines
2 KiB
Shell
Executable file
#!/bin/bash
|
|
# Copies KiCad WASM build output to test directory
|
|
#
|
|
# Priority: Use local output/ directory (populated by docker/build.sh)
|
|
# Fallback: Copy from Docker volume directly
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
KICAD_TEST="$PROJECT_ROOT/tests/apps/kicad"
|
|
OUTPUT_DIR="$PROJECT_ROOT/output"
|
|
|
|
mkdir -p "$KICAD_TEST"
|
|
|
|
# Check if output directory has the build files
|
|
if [ -f "$OUTPUT_DIR/pcbnew.js" ] && [ -f "$OUTPUT_DIR/pcbnew.wasm" ]; then
|
|
echo "Copying KiCad WASM files from output directory..."
|
|
cp "$OUTPUT_DIR/pcbnew.js" "$KICAD_TEST/"
|
|
cp "$OUTPUT_DIR/pcbnew.wasm" "$KICAD_TEST/"
|
|
# Source map for debug symbols (optional)
|
|
cp "$OUTPUT_DIR/pcbnew.wasm.map" "$KICAD_TEST/" 2>/dev/null || true
|
|
# Worker file for pthreads (optional)
|
|
cp "$OUTPUT_DIR/pcbnew.worker.js" "$KICAD_TEST/" 2>/dev/null || true
|
|
else
|
|
echo "Output directory not found, copying from Docker build..."
|
|
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
|
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.js "$KICAD_TEST/"
|
|
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
|
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.wasm "$KICAD_TEST/"
|
|
# Source map for debug symbols (optional)
|
|
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
|
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.wasm.map "$KICAD_TEST/" 2>/dev/null || true
|
|
# Worker file for pthreads (optional)
|
|
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
|
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.worker.js "$KICAD_TEST/" 2>/dev/null || true
|
|
fi
|
|
|
|
# wxWidgets WASM JavaScript glue code (defines JS functions called from WASM)
|
|
echo "Copying wxWidgets WASM glue code..."
|
|
cp "$PROJECT_ROOT/wxwidgets/build/wasm/wx.js" "$KICAD_TEST/"
|
|
|
|
echo "KiCad WASM files copied to $KICAD_TEST"
|
|
ls -lh "$KICAD_TEST"
|