new scripts
This commit is contained in:
Regular → Executable
+57
-14
@@ -1,22 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
cd /Volumes/Developer/Applications/DbSyn
|
||||
# Resolve script location under Bash or Zsh.
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
# Remove previous build
|
||||
rm -rf ./build
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Find the Xcode project.
|
||||
PROJECT="$(find "$PROJECT_ROOT" -maxdepth 2 -name '*.xcodeproj' -type d -print -quit)"
|
||||
|
||||
if [[ -z "$PROJECT" ]]; then
|
||||
echo "ERROR: No Xcode project found in $PROJECT_ROOT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Project: $PROJECT"
|
||||
|
||||
# Detect the application scheme.
|
||||
SCHEME="$(xcodebuild -list -json -project "$PROJECT" | python3 -c '
|
||||
import json
|
||||
import sys
|
||||
|
||||
data = json.load(sys.stdin)
|
||||
schemes = data.get("project", {}).get("schemes", [])
|
||||
|
||||
if not schemes:
|
||||
sys.exit("ERROR: No Xcode schemes found")
|
||||
|
||||
print(schemes[0])
|
||||
')"
|
||||
|
||||
if [[ -z "$SCHEME" ]]; then
|
||||
echo "ERROR: Could not detect Xcode scheme"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Scheme: $SCHEME"
|
||||
|
||||
DERIVED_DATA="$PROJECT_ROOT/.build"
|
||||
|
||||
echo "Building Rsync Studio..."
|
||||
|
||||
# Clean and build DBSyn
|
||||
xcodebuild \
|
||||
-project DBSyn.xcodeproj \
|
||||
-scheme DBSyn \
|
||||
-project "$PROJECT" \
|
||||
-scheme "$SCHEME" \
|
||||
-configuration Debug \
|
||||
-destination 'platform=macOS,arch=arm64' \
|
||||
-derivedDataPath ./build \
|
||||
clean build
|
||||
-derivedDataPath "$DERIVED_DATA" \
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
build
|
||||
|
||||
# Stop any running instance
|
||||
pkill -x DBSyn 2>/dev/null || true
|
||||
APP="$(find "$DERIVED_DATA/Build/Products/Debug" -maxdepth 1 -name '*.app' -type d -print -quit)"
|
||||
|
||||
# Launch the newly built application
|
||||
open ./build/Build/Products/Debug/DBSyn.app
|
||||
if [[ -z "$APP" ]]; then
|
||||
echo "ERROR: Built application not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Build successful: $APP"
|
||||
|
||||
if [[ "${LAUNCH_AFTER_BUILD:-1}" == "1" ]]; then
|
||||
echo "Launching application..."
|
||||
open "$APP"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user