forked from learningequality/kolibri-installer-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (60 loc) · 2.25 KB
/
Makefile
File metadata and controls
74 lines (60 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
OSNAME := $(shell uname -s)
ifeq ($(OSNAME), Darwin)
PLATFORM := macosx
else
PLATFORM := linux
endif
ANDROID_HOME ?= $(HOME)/.android/sdk
ANDROID_API := 34
ADB := adb
DOCKER := docker
PODMAN := podman
TOOLBOX := toolbox
.PHONY: clean
clean:
./gradlew clean
.PHONY: kolibri.apk
# Build debug and release APKs
kolibri.apk:
./gradlew build
.PHONY: kolibri.aab
# Bundle debug and release APKs
kolibri.aab:
./gradlew bundle
.PHONY: install
# Install the debug APK
install:
./gradlew installDebug
# DOCKER BUILD
# Build the docker image. Should only ever need to be rebuilt if project requirements change.
# Makes dummy file
.PHONY: build_docker
build_docker: Dockerfile
$(DOCKER) build -t android_kolibri .
# Toolbox build
build_toolbox: Dockerfile-toolbox
$(PODMAN) build -t android_kolibri_toolbox -f $< .
$(TOOLBOX) rm -f android_kolibri || :
$(TOOLBOX) create -c android_kolibri -i android_kolibri_toolbox
logcat:
$(ADB) logcat '*:F' EndlessKey EKWebConsole AndroidRuntime python.stdout python.stderr
$(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager:
@echo "Downloading Android SDK command line tools"
wget https://dl.google.com/android/repository/commandlinetools-$(PLATFORM)-7583922_latest.zip
rm -rf cmdline-tools
unzip commandlinetools-$(PLATFORM)-7583922_latest.zip
# This is unfortunate since it will download the command line tools
# again, but after this it will be properly installed and updatable.
yes y | ./cmdline-tools/bin/sdkmanager "cmdline-tools;latest" --sdk_root=$(ANDROID_HOME)
rm -rf cmdline-tools
rm commandlinetools-$(PLATFORM)-7583922_latest.zip
sdk: $(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager
yes y | $(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager "platform-tools"
yes y | $(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager "platforms;android-$(ANDROID_API)"
yes y | $(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager "system-images;android-$(ANDROID_API);google_apis_playstore;x86_64"
yes y | $(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager "system-images;android-$(ANDROID_API);google_atd;x86_64"
yes y | $(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager "build-tools;33.0.1"
@echo "Accepting all licenses"
yes | $(ANDROID_HOME)/cmdline-tools/latest/bin/sdkmanager --licenses
clean-sdk:
rm -rf ${ANDROID_HOME}