diff --git a/assets/logo/macos-1024x1024.png b/assets/logo/macos-1024x1024.png new file mode 100644 index 00000000..ad25459a Binary files /dev/null and b/assets/logo/macos-1024x1024.png differ diff --git a/assets/logo/macos.svg b/assets/logo/macos.svg new file mode 100644 index 00000000..ff889265 --- /dev/null +++ b/assets/logo/macos.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/flutter_launcher_incons/flutter_launcher_icons.yaml b/configs/flutter_launcher_incons/flutter_launcher_icons.yaml index b1971d0b..d66f86a0 100644 --- a/configs/flutter_launcher_incons/flutter_launcher_icons.yaml +++ b/configs/flutter_launcher_incons/flutter_launcher_icons.yaml @@ -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" diff --git a/installers/dmg_creator/config.json b/installers/dmg_creator/config.json new file mode 100644 index 00000000..f51ca2fc --- /dev/null +++ b/installers/dmg_creator/config.json @@ -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" } + ] + } \ No newline at end of file diff --git a/installers/dmg_creator/icon.icns b/installers/dmg_creator/icon.icns new file mode 100644 index 00000000..f5a8e6f2 Binary files /dev/null and b/installers/dmg_creator/icon.icns differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index a2ec33f1..96d3fee1 100644 --- a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png index 82b6f9d9..e3209d10 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png index 13b35eba..97cd7452 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png index 0a3f5fa4..979d1483 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png index bdb57226..b449ff38 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png index f083318e..3656a791 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png index 326c0e72..b7a04dac 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png index 2f1632cf..5078bb9e 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/scripts/build_dmg.sh b/scripts/build_dmg.sh new file mode 100755 index 00000000..c6236bac --- /dev/null +++ b/scripts/build_dmg.sh @@ -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