diff --git a/.gitignore b/.gitignore index a1552d8..14ccbf7 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ mole-analyze *.xcodeproj *.xcworkspace DerivedData/ +*.app diff --git a/app/Mole/Sources/Mole/Resources/mole.icon/Assets/mole.png b/app/Mole/Sources/Mole/Resources/mole.icon/Assets/mole.png deleted file mode 100644 index 861cbdd..0000000 Binary files a/app/Mole/Sources/Mole/Resources/mole.icon/Assets/mole.png and /dev/null differ diff --git a/app/Mole/Sources/Mole/Resources/mole.icon/icon.json b/app/Mole/Sources/Mole/Resources/mole.icon/icon.json deleted file mode 100644 index ff03357..0000000 --- a/app/Mole/Sources/Mole/Resources/mole.icon/icon.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "fill" : { - "solid" : "display-p3:0.97607,0.94922,0.90625,1.00000" - }, - "groups" : [ - { - "layers" : [ - { - "blend-mode" : "normal", - "glass" : false, - "image-name" : "mole.png", - "name" : "mole", - "position" : { - "scale" : 1.76, - "translation-in-points" : [ - 0, - 0 - ] - } - } - ], - "shadow" : { - "kind" : "neutral", - "opacity" : 0.5 - }, - "translucency" : { - "enabled" : true, - "value" : 0.5 - } - } - ], - "supported-platforms" : { - "circles" : [ - "watchOS" - ], - "squares" : "shared" - } -} diff --git a/app/Mole/Sources/Mole/Resources/mole.png b/app/Mole/Sources/Mole/Resources/mole.png new file mode 100644 index 0000000..6e5043f Binary files /dev/null and b/app/Mole/Sources/Mole/Resources/mole.png differ diff --git a/app/Mole/package.sh b/app/Mole/package.sh new file mode 100755 index 0000000..0eae8c1 --- /dev/null +++ b/app/Mole/package.sh @@ -0,0 +1,81 @@ +#!/bin/bash +set -e + +# Configuration +APP_NAME="Mole" +# Get the actual build path dynamically +BUILD_PATH="$(swift build -c release --show-bin-path)/$APP_NAME" +APP_BUNDLE="$APP_NAME.app" +ICON_SOURCE="Sources/Mole/Resources/mole.png" + +echo "🚀 Building Release Binary..." +swift build -c release + +echo "📦 Creating App Bundle Structure..." +rm -rf "$APP_BUNDLE" +mkdir -p "$APP_BUNDLE/Contents/MacOS" +mkdir -p "$APP_BUNDLE/Contents/Resources" + +echo "📄 Copying Executable..." +cp "$BUILD_PATH" "$APP_BUNDLE/Contents/MacOS/" + +echo "📝 Generatign Info.plist..." +cat < "$APP_BUNDLE/Contents/Info.plist" + + + + + CFBundleExecutable + $APP_NAME + CFBundleIdentifier + com.tw93.mole + CFBundleName + $APP_NAME + CFBundleIconFile + AppIcon + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + 13.0 + NSHighResolutionCapable + + + +EOF + +if [ -f "$ICON_SOURCE" ]; then + echo "🎨 Generating App Icon from $ICON_SOURCE..." + ICONSET="Mole.iconset" + mkdir -p "$ICONSET" + + # Resize images for standard icon sizes + sips -z 16 16 "$ICON_SOURCE" --out "$ICONSET/icon_16x16.png" > /dev/null + sips -z 32 32 "$ICON_SOURCE" --out "$ICONSET/icon_16x16@2x.png" > /dev/null + sips -z 32 32 "$ICON_SOURCE" --out "$ICONSET/icon_32x32.png" > /dev/null + sips -z 64 64 "$ICON_SOURCE" --out "$ICONSET/icon_32x32@2x.png" > /dev/null + sips -z 128 128 "$ICON_SOURCE" --out "$ICONSET/icon_128x128.png" > /dev/null + sips -z 256 256 "$ICON_SOURCE" --out "$ICONSET/icon_128x128@2x.png" > /dev/null + sips -z 256 256 "$ICON_SOURCE" --out "$ICONSET/icon_256x256.png" > /dev/null + sips -z 512 512 "$ICON_SOURCE" --out "$ICONSET/icon_256x256@2x.png" > /dev/null + sips -z 512 512 "$ICON_SOURCE" --out "$ICONSET/icon_512x512.png" > /dev/null + sips -z 1024 1024 "$ICON_SOURCE" --out "$ICONSET/icon_512x512@2x.png" > /dev/null + + # Convert to icns + iconutil -c icns "$ICONSET" + mv "Mole.icns" "$APP_BUNDLE/Contents/Resources/AppIcon.icns" + + # Clean up + rm -rf "$ICONSET" + + echo "✅ App Icon set successfully." +else + echo "⚠️ Icon file not found at $ICON_SOURCE. App will use default icon." +fi + +# Remove xattr com.apple.quarantine to avoid warnings +xattr -cr "$APP_BUNDLE" + +echo "✅ App Packaged: $APP_BUNDLE" +echo "👉 You can now move $APP_NAME.app to /Applications"