From cf187ee46b06439bda8b850756c452ef6f302c17 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 7 Mar 2024 20:42:08 -0500 Subject: [PATCH] Reorder things so that we only zipalign -z during a dist build. To slow for make all. --- GNUmakefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 14893466..b782e0b8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -726,7 +726,7 @@ out/apk/TildeFriends-arm-%.unsigned.apk: @cp out/apk/classes.dex out/apk-arm-$(BUILD_TYPE)/ @cd out/apk-arm-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../ @zip -u $@.zip -q $(RAW_FILES) - @rm -f $@ && $(ANDROID_BUILD_TOOLS)/zipalign -z 4 $@.zip $@ + @$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@ out/apk/TildeFriends-x86-%.unsigned.apk: @mkdir -p $(dir $@) out/apk-x86-$(BUILD_TYPE)/lib/x86_64/ out/apk-x86-$(BUILD_TYPE)/lib/x86/ @@ -739,13 +739,18 @@ out/apk/TildeFriends-x86-%.unsigned.apk: @cp out/apk/classes.dex out/apk-x86-$(BUILD_TYPE)/ @cd out/apk-x86-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../ @zip -u $@.zip -q $(RAW_FILES) - @rm -f $@ && $(ANDROID_BUILD_TOOLS)/zipalign -z 4 $@.zip $@ + @$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@ out/%.apk: out/apk/%.unsigned.apk @echo "[apksigner] $(notdir $@)" @$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --min-sdk-version $(ANDROID_MIN_SDK_VERSION) --out $@ $< -release-apk: out/TildeFriends-arm-release.apk out/TildeFriends-x86-release.apk +out/%.zopfli.apk: out/%.apk + @echo "[zopfli] $(notdir $@)" + $(ANDROID_BUILD_TOOLS)/zipalign -f -z 4 $< $@.zopfli + @$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --min-sdk-version $(ANDROID_MIN_SDK_VERSION) --out $@ $@.zopfli + +release-apk: out/TildeFriends-arm-release.zopfli.apk out/TildeFriends-x86-release.zopfli.apk .PHONY: release-apk releaseapkgo: out/TildeFriends-arm-release.apk @@ -859,9 +864,9 @@ dist: release-apk iosrelease-ipa --exclude=deps/zlib/doc \ -caf dist/tildefriends-$(VERSION_NUMBER).tar.xz out/tildefriends-$(VERSION_NUMBER) @echo "[cp] TildeFriends-x86-$(VERSION_NUMBER).apk" - @cp out/TildeFriends-x86-release.apk dist/TildeFriends-x86-$(VERSION_NUMBER).apk + @cp out/TildeFriends-x86-release.zopfli.apk dist/TildeFriends-x86-$(VERSION_NUMBER).apk @echo "[cp] TildeFriends-arm-$(VERSION_NUMBER).apk" - @cp out/TildeFriends-arm-release.apk dist/TildeFriends-arm-$(VERSION_NUMBER).apk + @cp out/TildeFriends-arm-release.zopfli.apk dist/TildeFriends-arm-$(VERSION_NUMBER).apk @echo "[cp] TildeFriends-$(VERSION_NUMBER).ipa" @cp out/tildefriends-release.ipa dist/TildeFriends-$(VERSION_NUMBER).ipa .PHONY: dist