From 920e23275d1f68363e7d60c88c78c006f4446421 Mon Sep 17 00:00:00 2001 From: moogman Date: Wed, 8 Apr 2026 20:08:08 +0100 Subject: [PATCH] Update/fix build.sh --- README.md | 18 ++++++- build.sh | 120 +++++++++++++++++++++++++++++++++++++------ build_incremental.sh | 22 -------- 3 files changed, 120 insertions(+), 40 deletions(-) delete mode 100755 build_incremental.sh diff --git a/README.md b/README.md index 710bf570..c62f3b30 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ Whisper supports up to 99 languages, depending on the model size you choose. - Intel Macs are supported from 1.5.1 builds using Whisper models! - Microphone access - Accessibility permissions for typing +- Cohere Transcribe and Qwen3 ASR require macOS 15.0 or later ## Join our small community to help us grow and give feedback :) ( Or just hang?!) @@ -134,6 +135,20 @@ open Fluid.xcodeproj Build and run in Xcode. All dependencies are managed via Swift Package Manager. +### Build Output Location and Launch + +If you use the provided scripts, the app bundle is written directly into ./build/ + +Build and launch examples: + +```bash +./build.sh dev # Debug build to ./build +./build.sh release # Release build to ./build +./build.sh -l dev # Build and launch +./build.sh -i -l release # Build, install to /Applications, then launch +open -n "$PWD/build/FluidVoice Debug.app" +``` + ## Contributing Contributions are welcome! Please create an issue first to discuss any major changes or feature requests before submitting a pull request. @@ -161,7 +176,8 @@ Contributions are welcome! Please create an issue first to discuss any major cha 5. **Build only (no signing):** ```bash - xcodebuild -project Fluid.xcodeproj -scheme Fluid -destination 'platform=macOS' build CODE_SIGNING_ALLOWED=NO + ./build.sh dev + ./build.sh release ``` 5. **(Optional) Install pre-commit hook** to prevent accidental team ID commits: diff --git a/build.sh b/build.sh index 86d7fef4..1c6fb7c7 100755 --- a/build.sh +++ b/build.sh @@ -1,30 +1,116 @@ #!/bin/bash -# FluidVoice Build Profile Router -# Routes to existing scripts without changing build_dev.sh behavior. -# -# Usage: -# ./build.sh # dev/full-compatible path (build_dev.sh) -# ./build.sh dev # same as above -# ./build.sh full # same as above -# ./build.sh incremental # fast local loop (build_incremental.sh) -# BUILD_PROFILE=incremental ./build.sh - set -euo pipefail PROJECT_DIR="$(cd "$(dirname "$0")" && pwd)" -PROFILE="${1:-${BUILD_PROFILE:-dev}}" +PROJECT_FILE="${PROJECT_DIR}/Fluid.xcodeproj" +SCHEME="Fluid" +DESTINATION="platform=macOS" +BUILD_DIR="${PROJECT_DIR}/build" + +usage() { + echo "Usage: ./build.new.sh [-i] [-l] [dev|release|clean]" + echo "Options:" + echo " -i Install built app into /Applications" + echo " -l Launch app after build (or after install if -i is set)" + echo "Profiles:" + echo " dev Debug, incremental build for development" + echo " release Optimized build for production/release" + echo " clean Delete generated build artifacts" +} + +INSTALL_APP=0 +LAUNCH_APP=0 +PROFILE="" + +while [[ $# -gt 0 ]]; do + case "$1" in + -i) + INSTALL_APP=1 + ;; + -l) + LAUNCH_APP=1 + ;; + -h|--help) + usage + exit 0 + ;; + dev|release|clean) + if [[ -n "${PROFILE}" ]]; then + echo "Only one profile may be provided." + usage + exit 1 + fi + PROFILE="$1" + ;; + *) + echo "Unknown argument: $1" + usage + exit 1 + ;; + esac + shift +done + +if [[ -z "${PROFILE}" ]]; then + usage + exit 1 +fi case "${PROFILE}" in - dev|full) - exec "${PROJECT_DIR}/build_dev.sh" + dev) + CONFIGURATION="Debug" + SWIFT_COMPILATION_MODE="incremental" + ;; + release) + CONFIGURATION="Release" + SWIFT_COMPILATION_MODE="wholemodule" ;; - incremental|fast) - exec "${PROJECT_DIR}/build_incremental.sh" + clean) + rm -rf "${BUILD_DIR}" + echo "Deleted build artifacts: ${BUILD_DIR}" + exit 0 ;; *) - echo "Unknown build profile: ${PROFILE}" - echo "Valid profiles: dev, full, incremental (or fast)" + echo "Unknown profile: ${PROFILE}" + echo "Valid profiles: dev, release, clean" exit 1 ;; esac + +CODE_SIGNING_ALLOWED="${CODE_SIGNING_ALLOWED:-NO}" +CODE_SIGNING_REQUIRED="${CODE_SIGNING_REQUIRED:-NO}" + +mkdir -p "${BUILD_DIR}" + +xcodebuild \ + -project "${PROJECT_FILE}" \ + -scheme "${SCHEME}" \ + -configuration "${CONFIGURATION}" \ + -destination "${DESTINATION}" \ + build \ + CONFIGURATION_BUILD_DIR="${BUILD_DIR}" \ + SWIFT_COMPILATION_MODE="${SWIFT_COMPILATION_MODE}" \ + CODE_SIGNING_ALLOWED="${CODE_SIGNING_ALLOWED}" \ + CODE_SIGNING_REQUIRED="${CODE_SIGNING_REQUIRED}" + +if [[ "${CONFIGURATION}" == "Debug" ]]; then + APP_PATH="${BUILD_DIR}/FluidVoice Debug.app" +else + APP_PATH="${BUILD_DIR}/FluidVoice.app" +fi + +echo "App bundle: ${APP_PATH}" + +if [[ "${INSTALL_APP}" == "1" ]]; then + APP_NAME="$(basename "${APP_PATH}")" + INSTALL_PATH="/Applications/${APP_NAME}" + rsync -a --delete "${APP_PATH}/" "${INSTALL_PATH}/" + APP_PATH="${INSTALL_PATH}" + echo "Installed app bundle: ${APP_PATH}" +fi + +if [[ "${LAUNCH_APP}" == "1" ]]; then + open -n "${APP_PATH}" + echo "Launched app bundle: ${APP_PATH}" +fi diff --git a/build_incremental.sh b/build_incremental.sh deleted file mode 100755 index 92f05766..00000000 --- a/build_incremental.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# FluidVoice Fast Incremental Build Wrapper -# Keeps build_dev.sh unchanged; only overrides defaults for local fast loops. -# -# Defaults: -# - Release configuration -# - Incremental Swift compilation -# - Install + launch enabled -# -# You can override any value: -# INSTALL_APP=1 LAUNCH_APP=1 ./build_incremental.sh - -set -euo pipefail - -PROJECT_DIR="$(cd "$(dirname "$0")" && pwd)" - -CONFIGURATION="${CONFIGURATION:-Release}" \ -SWIFT_COMPILATION_MODE="${SWIFT_COMPILATION_MODE:-incremental}" \ -INSTALL_APP="${INSTALL_APP:-1}" \ -LAUNCH_APP="${LAUNCH_APP:-1}" \ -"${PROJECT_DIR}/build_dev.sh"