Browse Source
android build: set SOURCE_DATE_EPOCH to cur time for debug builds
Otherwise One would have to git commit every change to be tested on a phone.
patch-4
SomberNight
3 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
12 additions and
1 deletions
-
contrib/android/Makefile
-
contrib/android/make_apk
|
|
@ -4,7 +4,17 @@ PYTHON = python3 |
|
|
|
# for reproducible builds
|
|
|
|
export LC_ALL := C |
|
|
|
export TZ := UTC |
|
|
|
export SOURCE_DATE_EPOCH := $(shell git log -1 --pretty=%ct) |
|
|
|
ifndef ELEC_APK_USE_CURRENT_TIME |
|
|
|
export SOURCE_DATE_EPOCH := $(shell git log -1 --pretty=%ct) |
|
|
|
else |
|
|
|
# p4a sets "private_version" based on SOURCE_DATE_EPOCH. "private_version" gets compiled into the apk, |
|
|
|
# and is used at runtime to decide whether the already extracted project files in the app's datadir need updating. |
|
|
|
# So, "private_version" needs to be reproducible, but it would be useful during development if it changed |
|
|
|
# between subsequent builds (otherwise the new code won't be unpacked and used at runtime!). |
|
|
|
# For this reason, for development purposes, we set SOURCE_DATE_EPOCH here to the current time. |
|
|
|
# see https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/bootstraps/common/build/build.py#L567-L579 |
|
|
|
export SOURCE_DATE_EPOCH := $(shell date +%s) |
|
|
|
endif |
|
|
|
export PYTHONHASHSEED := $(SOURCE_DATE_EPOCH) |
|
|
|
export BUILD_DATE := $(shell LC_ALL=C TZ=UTC date +'%b %e %Y' -d @$(SOURCE_DATE_EPOCH)) |
|
|
|
export BUILD_TIME := $(shell LC_ALL=C TZ=UTC date +'%H:%M:%S' -d @$(SOURCE_DATE_EPOCH)) |
|
|
|
|
|
@ -71,6 +71,7 @@ else |
|
|
|
-storepass "$P4A_DEBUG_KEYSTORE_PASSWD" \ |
|
|
|
-keypass "$P4A_DEBUG_KEYALIAS_PASSWD" |
|
|
|
fi |
|
|
|
export ELEC_APK_USE_CURRENT_TIME=1 |
|
|
|
# only build one apk for debug build, for faster testing iterations |
|
|
|
export APP_ANDROID_ARCH=arm64-v8a |
|
|
|
make apk |
|
|
|