diff --git a/.gitignore b/.gitignore index 52c5622..b50b39b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ *.ico *.apk *.apk.sha1 +/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +/android/app/src/main/res/values/colors.xml # Miscellaneous *.class diff --git a/Makefile b/Makefile index 8ac2eb6..3b6517e 100644 --- a/Makefile +++ b/Makefile @@ -1,52 +1,70 @@ -all: app web -app: fonts icons - flutter build apk +FLUTTER=flutter BASEHREF=/demo/ -web: fonts icons - flutter build web --base-href=$(BASEHREF) --release + +all: app web +app: assets-android + $(FLUTTER) config --no-analytics + $(FLUTTER) build apk +web: assets-web + $(FLUTTER) build web --base-href=$(BASEHREF) --release rm -rf website/demo/ cp -p -r build/web/ website/demo/ gh-pages: - flutter clean - make BASEHREF=/everest/demo/ web + $(FLUTTER) clean + $(MAKE) BASEHREF=/everest/demo/ web # assumes worktree gh-pages is checked out in ./gh-pages/ cd gh-pages && git rm -rf . --ignore-unmatch && cp -p -r ../website/* . && git add . && git commit --amend --no-edit host: cd website && python -m http.server 8000 -run: fonts icons - flutter run +run: assets-android assets-web + $(FLUTTER) run test: - flutter test test/expressions_test.dart + $(FLUTTER) test test/expressions_test.dart clean: icons-clean - flutter clean + $(FLUTTER) clean rm -rf website/demo/ -icons: android/app/src/main/res/mipmap-hdpi/ic_launcher.png website/favicon.ico web/favicon.ico web/icons/Icon-192.png web/icons/Icon-maskable-192.png web/icons/Icon-512.png web/icons/Icon-maskable-512.png -android/app/src/main/res/mipmap-hdpi/ic_launcher.png: assets/launcher_icon.png - flutter pub get - flutter pub run flutter_launcher_icons:main +assets-android: fonts icons-android +assets-web: fonts icons-web + +# rasterized icons are generated from an svg file +icons-android: android/app/src/main/res/mipmap-hdpi/ic_launcher.png assets/launcher_icon.png: assets/launcher_icon.svg - inkscape -w 1024 -h 1024 assets/launcher_icon.svg -o assets/launcher_icon.png + rsvg-convert --width=1024 --height=1024 --keep-aspect-ratio assets/launcher_icon.svg > $@ +assets/launcher_icon_adaptive.png: assets/launcher_icon_adaptive.svg + rsvg-convert --width=1024 --height=1024 --keep-aspect-ratio assets/launcher_icon_adaptive.svg > $@ +android/app/src/main/res/mipmap-hdpi/ic_launcher.png: assets/launcher_icon.png assets/launcher_icon_adaptive.png + $(FLUTTER) pub get + $(FLUTTER) pub run flutter_launcher_icons:main + +icons-web: website/favicon.ico web/favicon.ico web/icons/Icon-192.png web/icons/Icon-maskable-192.png web/icons/Icon-512.png web/icons/Icon-maskable-512.png web/favicon.ico website/favicon.ico: assets/launcher_icon.svg magick -background none assets/launcher_icon.svg -define icon:auto-resize $@ -web/icons/Icon-192.png web/icons/Icon-maskable-192.png: assets/launcher_icon.svg +web/icons/Icon-192.png: assets/launcher_icon.svg + mkdir -p web/icons/ + rsvg-convert --width=192 --height=192 --keep-aspect-ratio assets/launcher_icon.svg > $@ +web/icons/Icon-512.png: assets/launcher_icon.svg + mkdir -p web/icons/ + rsvg-convert --width=512 --height=512 --keep-aspect-ratio assets/launcher_icon.svg > $@ +web/icons/Icon-maskable-192.png: assets/launcher_icon_maskable.svg mkdir -p web/icons/ - inkscape -w 192 -h 192 assets/launcher_icon.svg -o $@ -web/icons/Icon-512.png web/icons/Icon-maskable-512.png: assets/launcher_icon.svg + rsvg-convert --width=192 --height=192 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_maskable.svg > $@ +web/icons/Icon-maskable-512.png: assets/launcher_icon_maskable.svg mkdir -p web/icons/ - inkscape -w 512 -h 512 assets/launcher_icon.svg -o $@ + rsvg-convert --width=512 --height=512 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_maskable.svg > $@ icons-clean: rm -f android/app/src/main/res/mipmap-*/ic_launcher.png rm -f website/favicon.ico web/favicon.ico web/icons/*.png - rm -f assets/launcher_icon.png + rm -f assets/launcher_icon.png assets/launcher_icon_adaptive.png +# fonts are downloaded and bundled into the app fonts: fonts/NotoSansMath-Regular.ttf fonts/NotoSansMath-Regular.ttf: | build/upstream/Noto_Sans_Math.zip mkdir -p fonts/ unzip -o build/upstream/Noto_Sans_Math.zip -d fonts/ build/upstream/Noto_Sans_Math.zip: mkdir -p build/upstream/ - wget -O build/upstream/Noto_Sans_Math.zip https://fonts.google.com/download?family=Noto%20Sans%20Math + curl --output build/upstream/Noto_Sans_Math.zip https://fonts.google.com/download?family=Noto%20Sans%20Math .INTERMEDIATE: build/upstream/Noto_Sans_Math.zip -.PHONY: all app web gh-pages host run test zip fonts icons icons-clean clean +.PHONY: all app web gh-pages host run test assets-android assets-web fonts icons-android icons-web icons-clean clean diff --git a/README.md b/README.md index a609361..f1ebaf3 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,9 @@ A mathematical puzzle game. Try it at https://mwageringel.github.io/everest/ ## Build dependencies -Building with `make` requires `flutter, python, inkscape, imagemagick`. +Building with `make` requires `flutter, curl, rsvg-convert, imagemagick`. + + +APK signing certificate fingerprint (SHA-256): + + 576bae61b2aba5d1d32a17d373baa36e05beaaefb67d9b47218d004c0e8333d9 diff --git a/assets/launcher_icon.svg b/assets/launcher_icon.svg index 7397272..5510bb0 100644 --- a/assets/launcher_icon.svg +++ b/assets/launcher_icon.svg @@ -7,10 +7,11 @@ viewBox="0 0 60.235294 60.235294" version="1.1" id="svg1791" - inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" + inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)" sodipodi:docname="launcher_icon.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> + inkscape:current-layer="layer3" /> - + + + + + + + + - + style="fill:#536dfe;fill-opacity:1;fill-rule:evenodd;stroke-width:0.285539" + d="m 528.86287,535.68072 -19.71379,42.5658 51.68888,-0.0382 -19.0253,-35.53374 -4.17353,8.30178 z m 1.1324,14.7102 6.98504,11.16235 4.05343,-8.28159 9.77124,18.26745 -30.97297,-0.16891 z" + sodipodi:nodetypes="cccccccccccc" /> + sodipodi:nodetypes="ccccccc" /> diff --git a/assets/launcher_icon_adaptive.svg b/assets/launcher_icon_adaptive.svg new file mode 100644 index 0000000..5aa445b --- /dev/null +++ b/assets/launcher_icon_adaptive.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/launcher_icon_alt.svg b/assets/launcher_icon_alt.svg new file mode 100644 index 0000000..f9c7a1f --- /dev/null +++ b/assets/launcher_icon_alt.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/launcher_icon_maskable.svg b/assets/launcher_icon_maskable.svg new file mode 100644 index 0000000..38d1cba --- /dev/null +++ b/assets/launcher_icon_maskable.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + diff --git a/pubspec.yaml b/pubspec.yaml index 510c7df..c23043f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,3 +107,5 @@ flutter_icons: android: true ios: false image_path: assets/launcher_icon.png + adaptive_icon_foreground: assets/launcher_icon_adaptive.png + adaptive_icon_background: "#536dfe" diff --git a/web/manifest.json b/web/manifest.json index 20a155d..31d3e31 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -3,8 +3,8 @@ "short_name": "everest", "start_url": ".", "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", + "background_color": "#536dfe", + "theme_color": "#536dfe", "description": "A mathematical puzzle game.", "orientation": "portrait-primary", "prefer_related_applications": false,