- Restructure project into three targets: - AppleIntelligenceCore: Shared gRPC service code - AppleIntelligenceServer: CLI server - AppleIntelligenceApp: Menu bar app - Menu bar app features: - Toggle server on/off from menu bar - Chat window with streaming AI responses - Settings: host, port, API key, auto-start, launch at login - Proper window focus handling for menu bar apps - Add build scripts for distribution: - build-app.sh: Creates signed .app bundle - create-dmg.sh: Creates distributable DMG 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
61 lines
1.4 KiB
Bash
Executable File
61 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Configuration
|
|
APP_NAME="Apple Intelligence Server"
|
|
DMG_NAME="AppleIntelligenceServer"
|
|
VERSION="1.0.0"
|
|
|
|
# Paths
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
DIST_DIR="$PROJECT_DIR/dist"
|
|
APP_BUNDLE="$DIST_DIR/$APP_NAME.app"
|
|
DMG_PATH="$DIST_DIR/$DMG_NAME-$VERSION.dmg"
|
|
TEMP_DMG="$DIST_DIR/temp.dmg"
|
|
|
|
# Check if app bundle exists
|
|
if [ ! -d "$APP_BUNDLE" ]; then
|
|
echo "App bundle not found. Running build-app.sh first..."
|
|
"$SCRIPT_DIR/build-app.sh"
|
|
fi
|
|
|
|
echo "Creating DMG..."
|
|
|
|
# Remove old DMG if exists
|
|
rm -f "$DMG_PATH"
|
|
rm -f "$TEMP_DMG"
|
|
|
|
# Create a temporary directory for DMG contents
|
|
DMG_TEMP_DIR="$DIST_DIR/dmg-temp"
|
|
rm -rf "$DMG_TEMP_DIR"
|
|
mkdir -p "$DMG_TEMP_DIR"
|
|
|
|
# Copy app to temp directory
|
|
cp -R "$APP_BUNDLE" "$DMG_TEMP_DIR/"
|
|
|
|
# Create symbolic link to Applications folder
|
|
ln -s /Applications "$DMG_TEMP_DIR/Applications"
|
|
|
|
# Create the DMG
|
|
hdiutil create -volname "$APP_NAME" \
|
|
-srcfolder "$DMG_TEMP_DIR" \
|
|
-ov -format UDRW "$TEMP_DMG"
|
|
|
|
# Convert to compressed DMG
|
|
hdiutil convert "$TEMP_DMG" -format UDZO -o "$DMG_PATH"
|
|
|
|
# Clean up
|
|
rm -f "$TEMP_DMG"
|
|
rm -rf "$DMG_TEMP_DIR"
|
|
|
|
echo ""
|
|
echo "DMG created: $DMG_PATH"
|
|
echo ""
|
|
echo "Size: $(du -h "$DMG_PATH" | cut -f1)"
|
|
echo ""
|
|
echo "To distribute:"
|
|
echo "1. Code sign the app (requires Apple Developer account)"
|
|
echo "2. Notarize the DMG (required for Gatekeeper)"
|
|
echo "3. Share the DMG file"
|