Skip to content

Commit 2bbdaa7

Browse files
committed
build: added some wip Makefile targets using bundletool
1 parent 536a7dd commit 2bbdaa7

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ AABDIR = mobile/build/outputs/bundle
1515
WEBUI_SRCDIR := aw-server-rust/aw-webui
1616
WEBUI_DISTDIR := $(WEBUI_SRCDIR)/dist
1717

18+
# NOTE: you have to download bundletool manually and set this path
19+
# https://github.com/google/bundletool/releases
20+
BUNDLETOOL := java -jar ~/Downloads/bundletool-all-1.15.5.jar
21+
1822
# Main targets
1923
all: aw-server-rust metadata
2024
build: all
@@ -26,6 +30,27 @@ build-bundle: dist/aw-android.aab
2630
# builds a complete, signed apk, puts it in dist
2731
build-apk: dist/aw-android.apk
2832

33+
# Attempts at working with bundletool to build device-specific APKs
34+
# See: https://github.com/ActivityWatch/aw-android/issues/61
35+
dist/aw-android.apks:
36+
rm -rf dist/aw-android.apks
37+
$(BUNDLETOOL) \
38+
build-apks --bundle=dist/aw-android.aab --output=dist/aw-android.apks
39+
40+
# Extracts device-specific APKs from the apks bundle
41+
build-device-specific-apks:
42+
# TODO: add arm(7), x86, x86_64
43+
$(BUNDLETOOL) \
44+
extract-apks \
45+
--apks=dist/aw-android.apks \
46+
--output-dir=dist/splits/arm64 \
47+
--device-spec=scripts/device-arm64.json
48+
49+
# Useful for inspecting the contents of the apks
50+
unzip-apks: dist/aw-android.apks
51+
rm -rf dist/apks
52+
unzip -o dist/aw-android.apks -d dist/apks
53+
2954
# builds debug and test apks (unsigned)
3055
build-apk-debug: $(APKDIR)/debug/mobile-debug.apk $(APKDIR)/androidTest/debug/mobile-debug-androidTest.apk
3156
mkdir -p dist

scripts/device-arm64.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"supportedAbis": ["arm64-v8a"],
3+
"supportedLocales": ["en"],
4+
"screenDensity": 640,
5+
"sdkVersion": 27
6+
}

0 commit comments

Comments
 (0)