From 6a59894d97a7ecab3c9198b34be146ce18651a5d Mon Sep 17 00:00:00 2001 From: u8slvn Date: Fri, 30 Aug 2024 10:48:53 +0200 Subject: [PATCH] build: imporve macos dmg file --- README.md | 4 ++-- {images => assets}/demo.gif | Bin assets/icon-42.png | Bin 0 -> 1277 bytes {src/doggo/assets => assets}/splash.png | Bin scripts/build.py | 14 ++++++++------ scripts/create-appimage.sh | 4 ++++ scripts/create-dmg.sh | 10 +++++++--- 7 files changed, 21 insertions(+), 11 deletions(-) rename {images => assets}/demo.gif (100%) create mode 100644 assets/icon-42.png rename {src/doggo/assets => assets}/splash.png (100%) diff --git a/README.md b/README.md index 5c85268..c3e7469 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- Until Zero - タイマー | logo + Until Zero - タイマー | logo

@@ -18,7 +18,7 @@ Here is a list of the dog states: *idle*, *idle and bark*, *walk*, *walk and bark*, *sit*, *sit and bark*, *lie down*, *lie down and bark*., *run*, *run and bark*, *stand*, *stand and bark*, *sleep*.

- doggo demo + doggo demo

**Project context**: A colleague of mine wanted to have a dog, but he couldn't because of lots of reasons. So I decided to make him a virtual dog and it was the opportunity for me to play with Markov chains. diff --git a/images/demo.gif b/assets/demo.gif similarity index 100% rename from images/demo.gif rename to assets/demo.gif diff --git a/assets/icon-42.png b/assets/icon-42.png new file mode 100644 index 0000000000000000000000000000000000000000..2756c1af8cd60038c9d0a98771de0df6fd29d689 GIT binary patch literal 1277 zcmVPx(w@E}nR9J=Wm`zL^Wf;eQQ%IM>M%Zq#1V6TG_$tIwbZuG=dTW~2RFXym#seAy zN8CFhq}fC9f*d@QM8m;k4Mb}Jjo}2CKxlW{E~bF6k&mR!#F0cwhhScpVq zfPpjhhOW^%>*KZJV(D%u#IBrvUjBXn%S!6{H+7xO2sF__Fdkyz;J4p@#|4We>AW7SCg?#rXcRUj=s)G4 z5!g7;!*DQDSSfZ5J1hq?ftAje6mvHeQnTT(9MprA@+4%V?!m!0s0Di@8^9}fekj032l7m_`$MqN-x=hT723cxzE zS$Y@_18_vE5lAJEtC7}O-+_d?dSaaFiE+OAr~!b7;V`>0%JKy2`YA7c`KB&t$iD&P z)>+}800g-9$$bDx7-_heiYtx-xp6ku!B|M!iDOCM)pgWf*F^ryAF9V<&VHOt3* zqc=MjX?Inn|5-7*SbvJj=FybS3boGq3o|YWeeEV z=T92TI`l#!1t3~rXW#mO+n;@!HQ@D*3S-4&RKnT)0H#ycIhsyloy`PN5Ad&(Rw%Q= zgT>tBs8KZxtt&g_B>;>Jt#kkF6YBY{K0mwlRRA)3>6sMz{W_|pu0B5_dvK068*h+S^+0>9bCu^c`uP*>7 zpMfAPy=4TvTR5(o33ktMvQUy_-xfSrjBoP<@Py|lP^wL`6ctEgz7S{W7W1Y0$TT8mG;YX1~V2C!;>E!5~V(rNz z6~NkE8|QAYdroy+{1E%SH6kU2>N9dqUX7otwQ^@JD1*}Z+v}QmaQkz$<$Klsj5Pmv z2XjFY1xHOX!160Esz9;(iCoLSJla2~7O(*HF8>NBQLsPzoH&*8A^oY@BpnNH#{njh n=Mp$piSG?GU?oTf{LkrcgY`7rQKf=~00000NkvXXu0mjf-cMs5 literal 0 HcmV?d00001 diff --git a/src/doggo/assets/splash.png b/assets/splash.png similarity index 100% rename from src/doggo/assets/splash.png rename to assets/splash.png diff --git a/scripts/build.py b/scripts/build.py index 9342d60..3bc9269 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -28,9 +28,11 @@ # ------ Build paths ------ BUILD_PATH = Path(__file__).parent.resolve() +ROOT_PATH = BUILD_PATH.parent.resolve() PROJECT_PATH = BUILD_PATH.parent.joinpath("src").resolve() PACKAGE_PATH = PROJECT_PATH.joinpath(PACKAGE_NAME).resolve() -ASSETS_PATH = PACKAGE_PATH.joinpath(ASSETS_FOLDER) +ASSETS_PATH = PACKAGE_PATH.joinpath(ASSETS_FOLDER).resolve() +ROOT_ASSETS_PATH = ROOT_PATH.joinpath(ASSETS_FOLDER).resolve() def build_pyinstaller_args( @@ -53,20 +55,20 @@ def build_pyinstaller_args( logger.info(f"Output exe filename: {output_filename}") build_args += ["-n", output_filename] - logger.info(f"Output file icon: {ASSETS_PATH.joinpath('icon-42.png')}") - build_args += ["--icon", f"{ASSETS_PATH.joinpath('icon-42.png')}"] + logger.info(f"Output file icon: {ROOT_ASSETS_PATH.joinpath('icon-42.png')}") + build_args += ["--icon", f"{ROOT_ASSETS_PATH.joinpath('icon-42.png')}"] logger.info(f"Add assets folder: {ASSETS_PATH}") build_args += ["--add-data", f"{ASSETS_PATH}:./{ASSETS_FOLDER}"] for items in ASSETS_PATH.glob("**/*"): if not items.is_dir(): continue - logger.info(f"Add data: {items};./{ASSETS_FOLDER}/{items.name}") + logger.info(f"Add data: {items}:./{ASSETS_FOLDER}/{items.name}") build_args += ["--add-data", f"{items}:./{ASSETS_FOLDER}/{items.name}"] if os in ["windows"]: - logger.info(f"Add splash image: {ASSETS_PATH.joinpath('splash.png')}") - build_args += ["--splash", f"{ASSETS_PATH.joinpath('splash.png')}"] + logger.info(f"Add splash image: {ROOT_ASSETS_PATH.joinpath('splash.png')}") + build_args += ["--splash", f"{ROOT_ASSETS_PATH.joinpath('splash.png')}"] logger.info("Build options: onefile") build_args += [ diff --git a/scripts/create-appimage.sh b/scripts/create-appimage.sh index 426b38e..c8abd49 100755 --- a/scripts/create-appimage.sh +++ b/scripts/create-appimage.sh @@ -1,3 +1,7 @@ #!/bin/bash +echo "Remove previous build if exists ..." +rm -rf ./dist/Doggo.AppImage + +echo "Create AppImage ..." appimage-builder --recipe AppImageBuilder.yml --skip-tests diff --git a/scripts/create-dmg.sh b/scripts/create-dmg.sh index 125b788..6d899cb 100755 --- a/scripts/create-dmg.sh +++ b/scripts/create-dmg.sh @@ -1,13 +1,17 @@ #!/bin/bash +echo "Remove previous build if exists ..." +rm -rf ./dist/Doggo.dmg + +echo "Create DMG ..." create-dmg \ --volname "Doggo" \ --window-pos 200 200 \ - --window-size 460 350 \ - --icon "Doggo.app" 130 60 \ + --window-size 460 160 \ + --icon "Doggo.app" 130 80 \ --icon-size 64 \ --hide-extension "Doggo.app" \ - --app-drop-link 325 60 \ + --app-drop-link 325 80 \ --format UDBZ \ --no-internet-enable \ "./dist/Doggo.dmg" \