Add Quick Start docs and branch-specific Docker builds

- README.md: Add Quick Start section with full build sequence
- docker/README.md: Document branch-specific builds with git worktrees
- docker/build.sh: Use branch name for COMPOSE_PROJECT_NAME
- docker/docker-compose.yml: Remove hardcoded container_name

Each branch now gets isolated Docker containers/volumes, enabling
parallel development across git worktrees.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-01-03 07:31:46 +01:00
commit 2b96d4ba21
4 changed files with 65 additions and 1 deletions

View file

@ -2,6 +2,38 @@
Run KiCad PCBnew in the browser using WebAssembly.
## Quick Start
### Full Build (KiCad + All Tests)
```bash
# 1. Initialize submodules
git submodule update --init --recursive
# 2. Build KiCad WASM (Docker, ~10 min incremental, ~1-2 hours full)
./docker/build.sh
# 3. Build wxWidgets for local testing
./scripts/build-wxuniversal-wasm.sh
# 4. Build wxWidgets test apps
./scripts/build-wasm-test.sh
# 5. Run all tests
cd tests && npm install
npm test # wxWidgets tests (256 tests)
npm run test:kicad # KiCad tests (2 tests)
```
### wxWidgets Only (No Docker)
```bash
# Requires: Emscripten SDK 4.0+, Node.js 18+
./scripts/build-wxuniversal-wasm.sh
./scripts/build-wasm-test.sh
cd tests && npm install && npm test
```
## Project Structure
```

View file

@ -21,6 +21,33 @@ This directory contains Docker configuration for building KiCad for WebAssembly
./docker/shell.sh
```
## Branch-Specific Builds
Each git branch gets isolated Docker containers and volumes, enabling parallel development:
```bash
# On branch 'main' → containers/volumes prefixed with 'kicad-wasm-main'
# On branch 'feature-x' → containers/volumes prefixed with 'kicad-wasm-feature-x'
```
This allows you to:
- Work on multiple branches simultaneously using git worktrees
- Each worktree has its own build cache (no conflicts)
- Switch branches without rebuilding from scratch
**Using git worktrees for parallel development:**
```bash
# Create a worktree for a new branch
git worktree add ../kicad-wasm-feature path/to/branch
# Build in the worktree (uses isolated Docker volumes)
cd ../kicad-wasm-feature
./docker/build.sh
# List all worktrees
git worktree list
```
## What Gets Built
The build process includes:

View file

@ -11,6 +11,11 @@ set -e
cd "$(dirname "$0")/.."
# Use branch name as Docker Compose project name for isolated containers/volumes
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD | tr '/' '-' | tr '[:upper:]' '[:lower:]')
export COMPOSE_PROJECT_NAME="kicad-wasm-${BRANCH_NAME}"
echo "Using Docker project: ${COMPOSE_PROJECT_NAME}"
# Add -j 10 by default if no -j flag is given
ARGS=("$@")
if [[ ! " ${ARGS[*]} " =~ " -j " ]]; then

View file

@ -3,7 +3,7 @@ services:
build:
context: ..
dockerfile: docker/Dockerfile
container_name: kicad-wasm-builder
# Container name is auto-generated with project prefix (set in build.sh)
# Resource limits (adjust based on your machine)
deploy: