-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_wrapper_template.sh
More file actions
executable file
·85 lines (74 loc) · 2.47 KB
/
Copy pathbuild_wrapper_template.sh
File metadata and controls
executable file
·85 lines (74 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
set -e
echo "🔨 Building WrapperTemplate.app..."
# Paths
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
WRAPPER_DIR="$SCRIPT_DIR/WrapperTemplate"
BUILD_DIR="$SCRIPT_DIR/build"
APP_NAME="WrapperTemplate"
APP_BUNDLE="$BUILD_DIR/$APP_NAME.app"
# Clean and create build directory
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
mkdir -p "$APP_BUNDLE/Contents/MacOS"
mkdir -p "$APP_BUNDLE/Contents/Resources"
echo "📦 Creating app bundle structure..."
# Compile Swift files
echo "⚙️ Compiling Swift files..."
swiftc -o "$APP_BUNDLE/Contents/MacOS/$APP_NAME" \
"$WRAPPER_DIR/WrapperApp.swift" \
"$WRAPPER_DIR/WebViewManager.swift" \
"$WRAPPER_DIR/NavigationToolbar.swift" \
"$WRAPPER_DIR/AppConfig.swift" \
-framework SwiftUI \
-framework WebKit \
-framework AppKit \
-target arm64-apple-macos13.0
echo "✅ Compilation successful"
# Make executable
chmod +x "$APP_BUNDLE/Contents/MacOS/$APP_NAME"
# Create Info.plist
echo "📝 Creating Info.plist..."
cat > "$APP_BUNDLE/Contents/Info.plist" << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>WrapperTemplate</string>
<key>CFBundleIdentifier</key>
<string>com.appforge.WrapperTemplate</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>WrapperTemplate</string>
<key>CFBundleDisplayName</key>
<string>WrapperTemplate</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
EOF
# Copy Resources
echo "📋 Copying resources..."
cp "$WRAPPER_DIR/Resources/AppConfig.json" "$APP_BUNDLE/Contents/Resources/"
# Copy entitlements (for reference, not applied yet)
cp "$WRAPPER_DIR/WrapperTemplate.entitlements" "$BUILD_DIR/"
echo "✅ WrapperTemplate.app built successfully at: $APP_BUNDLE"
echo ""
echo "📍 Build location: $BUILD_DIR"
echo "🚀 To run: open \"$APP_BUNDLE\""