Files
calctext/calcpad-macos/build-rust.sh
C. Cassel 806e2f1ec6 feat: add platform shells, CLI, formatting, plugins, tests, and benchmarks
Phase 4 — Platform shells:
- calcpad-macos/: SwiftUI two-column editor with Rust FFI bridge (16 files)
- calcpad-windows/: iced GUI with Windows 11 Fluent theme (7 files, 13 tests)
- calcpad-web/: React 18 + CodeMirror 6 + WASM Worker + PWA (20 files)
- calcpad-cli/: clap-based CLI with expression eval, pipe/stdin, JSON/CSV
  output, and interactive REPL with rustyline history

Phase 5 — Engine modules:
- formatting/: answer formatting (decimal/scientific/SI notation, thousands
  separators, currency), line type classification, clipboard values (93 tests)
- plugins/: CalcPadPlugin trait, PluginRegistry, Rhai scripting stub (43 tests)
- benches/: criterion benchmarks (single-line, 100/500-line sheets, DAG, incremental)
- tests/sheet_scenarios.rs: 20 real-world integration tests
- tests/proptest_fuzz.rs: 12 property-based fuzz tests

771 tests passing across workspace, 0 failures.
2026-03-17 09:46:40 -04:00

38 lines
961 B
Bash

#!/bin/bash
# Build the Rust CalcPad engine for macOS.
#
# Produces a static library that the Swift Package Manager links against.
#
# Usage:
# ./build-rust.sh # Build release (default)
# ./build-rust.sh debug # Build debug
#
# Prerequisites:
# - Rust toolchain with targets: aarch64-apple-darwin, x86_64-apple-darwin
# - Install targets: rustup target add aarch64-apple-darwin x86_64-apple-darwin
set -euo pipefail
PROFILE="${1:-release}"
ENGINE_DIR="$(cd "$(dirname "$0")/../calcpad-engine" && pwd)"
OUTPUT_DIR="$ENGINE_DIR/target/$PROFILE"
if [ "$PROFILE" = "debug" ]; then
CARGO_FLAG=""
else
CARGO_FLAG="--release"
fi
echo "Building calcpad-engine ($PROFILE)..."
# Build for the current architecture
cd "$ENGINE_DIR"
cargo build $CARGO_FLAG
echo ""
echo "Build complete!"
echo "Static library: $OUTPUT_DIR/libcalcpad_engine.a"
echo ""
echo "To build and test the Swift package:"
echo " cd calcpad-macos && swift test"