Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created macOS dmg + build + .icns file #168

Merged
merged 10 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/logo/macos-1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions assets/logo/macos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions configs/flutter_launcher_incons/flutter_launcher_icons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ flutter_launcher_icons:
ios: true
image_path_ios: "assets/logo/icon-1024x1024.png"
remove_alpha_ios: true
# MacOS
macos:
generate: true
image_path: "assets/logo/macos-1024x1024.png"
15 changes: 15 additions & 0 deletions installers/dmg_creator/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"title": "Table Habit",
"icon": "./icon.icns",
"icon-size": 100,
"window": {
"size": {
"width": 400,
"height": 100
}
},
"contents": [
{ "x": 250, "y": 80, "type": "link", "path": "/Applications" },
{ "x": 50, "y": 80, "type": "file", "path": "../../build/macos/Build/Products/Release/mhabit.app" }
]
}
Binary file added installers/dmg_creator/icon.icns
Binary file not shown.
2 changes: 1 addition & 1 deletion macos/Podfile.lock
FriesI23 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

COCOAPODS: 1.14.2
COCOAPODS: 1.15.2
132 changes: 66 additions & 66 deletions macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_16.png",
"scale" : "1x"
"info": {
"version": 1,
"author": "xcode"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_64.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_1024.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
"images": [
{
"size": "16x16",
"idiom": "mac",
"filename": "app_icon_16.png",
"scale": "1x"
},
{
"size": "16x16",
"idiom": "mac",
"filename": "app_icon_32.png",
"scale": "2x"
},
{
"size": "32x32",
"idiom": "mac",
"filename": "app_icon_32.png",
"scale": "1x"
},
{
"size": "32x32",
"idiom": "mac",
"filename": "app_icon_64.png",
"scale": "2x"
},
{
"size": "128x128",
"idiom": "mac",
"filename": "app_icon_128.png",
"scale": "1x"
},
{
"size": "128x128",
"idiom": "mac",
"filename": "app_icon_256.png",
"scale": "2x"
},
{
"size": "256x256",
"idiom": "mac",
"filename": "app_icon_256.png",
"scale": "1x"
},
{
"size": "256x256",
"idiom": "mac",
"filename": "app_icon_512.png",
"scale": "2x"
},
{
"size": "512x512",
"idiom": "mac",
"filename": "app_icon_512.png",
"scale": "1x"
},
{
"size": "512x512",
"idiom": "mac",
"filename": "app_icon_1024.png",
"scale": "2x"
}
]
}
FriesI23 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions scripts/build_dmg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2024 Fries_I23
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if [[ "$(uname)" != "Darwin" ]]; then
echo "Error: This script is only intended for macOS systems."
exit 1
fi

if ! command -v appdmg &>/dev/null; then
echo "Error: appdmg command not found."
exit 1
fi

HERE="$(cd "$(dirname "$0")" && pwd)"
APP_FILEPATH=$HERE/../build/macos/Build/Products/Release/mhabit.app
DMG_DIR=$HERE/../build/macos_dmg
DMG_FILEPATH=$DMG_DIR/mhabit-$(date +"%Y-%m-%d-%H-%M-%S").dmg

if [ -f "$APP_FILEPATH" ] || [ -d "$APP_FILEPATH" ]; then
echo "App $APP_FILEPATH exists, cleaning..."
rm -fr "$APP_FILEPATH"
fi
flutter build macos --release

if [ ! -d "$DMG_DIR" ]; then
mkdir -p "$DMG_DIR"
fi
appdmg $HERE/../installers/dmg_creator/config.json $DMG_FILEPATH
Loading