mirror of
https://github.com/Homebrew/BrewUI.git
synced 2026-10-14 04:39:20 +08:00
Rename the Xcode app target, product, and project from Brew to Homebrew: - Brew.xcodeproj -> Homebrew.xcodeproj, and fix the file-system- synchronized group path (Brew -> Homebrew) so the app target picks up its sources again - Source folder Brew/ -> Homebrew/ - Update schemes, test plans, CI workflows, README, and bootstrap script - PRODUCT_BUNDLE_IDENTIFIER and pkgbuild identifier -> sh.brew.app The package and repository names are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
70 lines
2.3 KiB
Bash
Executable File
70 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# bootstrap — one-time/local setup for Brew development.
|
|
#
|
|
# Safe to re-run: installs missing tooling and refreshes package resolution.
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT_DIR"
|
|
|
|
echo "==> Checking Xcode Command Line Tools"
|
|
if ! xcode-select -p >/dev/null 2>&1; then
|
|
echo "Xcode Command Line Tools are required."
|
|
echo "Run: xcode-select --install"
|
|
echo "Then re-run: ./scripts/bootstrap"
|
|
exit 1
|
|
fi
|
|
|
|
echo "==> Checking Homebrew"
|
|
if ! command -v brew >/dev/null 2>&1; then
|
|
echo "Homebrew not found. Installing..."
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
fi
|
|
|
|
# Ensure brew is available in this shell session (Apple Silicon or Intel).
|
|
if [[ -x /opt/homebrew/bin/brew ]]; then
|
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
|
elif [[ -x /usr/local/bin/brew ]]; then
|
|
eval "$(/usr/local/bin/brew shellenv)"
|
|
fi
|
|
|
|
echo "==> Installing tooling from Brewfile"
|
|
brew bundle --file "$ROOT_DIR/Brewfile"
|
|
|
|
if ! command -v mint >/dev/null 2>&1; then
|
|
echo "mint not found after brew bundle. Check Brewfile and Homebrew setup."
|
|
exit 1
|
|
fi
|
|
|
|
echo "==> Installing Mintfile packages (SwiftFormat, SwiftLint)"
|
|
mint bootstrap --mintfile "$ROOT_DIR/Mintfile"
|
|
|
|
echo "==> Installing repository git hooks"
|
|
"$ROOT_DIR/scripts/install-git-hooks"
|
|
|
|
echo "==> Resolving Swift package dependencies"
|
|
xcodebuild -resolvePackageDependencies -project "$ROOT_DIR/Homebrew.xcodeproj"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Per-developer signing config
|
|
# ---------------------------------------------------------------------------
|
|
SIGNING_LOCAL="$ROOT_DIR/Configurations/Signing.local.xcconfig"
|
|
SIGNING_EXAMPLE="$ROOT_DIR/Configurations/Signing.local.xcconfig.example"
|
|
|
|
if [ ! -f "$SIGNING_LOCAL" ]; then
|
|
cp "$SIGNING_EXAMPLE" "$SIGNING_LOCAL"
|
|
echo ""
|
|
echo "==> Created Configurations/Signing.local.xcconfig"
|
|
echo " Open that file and replace YOUR_TEAM_ID_HERE with your"
|
|
echo " 10-character Apple Team ID (Xcode → Settings → Accounts)."
|
|
echo " Then open Homebrew.xcodeproj — signing will resolve automatically."
|
|
else
|
|
echo "==> Signing config already exists (Configurations/Signing.local.xcconfig)"
|
|
fi
|
|
|
|
echo ""
|
|
echo "==> Bootstrap complete"
|
|
echo "Next step: open Homebrew.xcodeproj"
|