Skip to content

Commit 41c6cc0

Browse files
authoredSep 11, 2021
AAB support related changes (#2467)
* Added support for aab * Move to build:gradle:3.5.4 (adds support for API 30), fix some tests * Github actions test apps (apk + aab) * Add missing bdistaab * Fix automated tests * ndk lib folder (or ndk platform) now is ABI specific * Fixes dist lookup + some tests * Added .aab and .apks to blacklist * Interrupt build and alert the user if tried to build an aab in debug mode * Updates troubleshooting instructions to reflect current structure. * Exclude gdbserver and gdb.setup from release builds * Add a paragraph in history + fixes --arch docs * Fix versioning * Minor fixes to docs * Some code cleanup * Removes unusued versioning logic in unpackPyBundle and add a FIXME
1 parent 54139ea commit 41c6cc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+486
-313
lines changed
 

‎.github/workflows/push.yml

+32-8
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,10 @@ jobs:
4141
pip install tox>=2.0
4242
make test
4343
44-
build:
44+
build_apk:
4545
name: Unit test apk
4646
needs: [flake8]
4747
runs-on: ubuntu-latest
48-
strategy:
49-
fail-fast: false
50-
matrix:
51-
build-arch: ['arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86']
5248
steps:
5349
- name: Checkout python-for-android
5450
uses: actions/checkout@v2
@@ -64,15 +60,43 @@ jobs:
6460
- name: Pull docker image
6561
run: |
6662
make docker/pull
67-
- name: Build apk Python 3 ${{ matrix.build-arch }}
63+
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
6864
run: |
6965
mkdir -p apks
70-
make docker/run/make/with-artifact/testapps-with-numpy/${{ matrix.build-arch }}
66+
make docker/run/make/with-artifact/apk/testapps-with-numpy
7167
- uses: actions/upload-artifact@v1
7268
with:
73-
name: bdist_test_app_unittests__${{ matrix.build-arch }}-debug-1.1.apk
69+
name: bdist_unit_tests_app-debug-1.1-.apk
7470
path: apks
7571

72+
build_aab:
73+
name: Unit test aab
74+
needs: [flake8]
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout python-for-android
78+
uses: actions/checkout@v2
79+
# helps with GitHub runner getting out of space
80+
- name: Free disk space
81+
run: |
82+
df -h
83+
sudo swapoff -a
84+
sudo rm -f /swapfile
85+
sudo apt -y clean
86+
docker rmi $(docker image ls -aq)
87+
df -h
88+
- name: Pull docker image
89+
run: |
90+
make docker/pull
91+
- name: Build Android App Bundle Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
92+
run: |
93+
mkdir -p aabs
94+
make docker/run/make/with-artifact/aab/testapps-with-numpy-aab
95+
- uses: actions/upload-artifact@v1
96+
with:
97+
name: bdist_unit_tests_app-release-1.1-.aab
98+
path: aabs
99+
76100
rebuild_updated_recipes:
77101
name: Test updated recipes
78102
needs: [flake8]

‎Makefile

+17-8
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ rebuild_updated_recipes: virtualenv
3434
ANDROID_SDK_HOME=$(ANDROID_SDK_HOME) ANDROID_NDK_HOME=$(ANDROID_NDK_HOME) \
3535
$(PYTHON) ci/rebuild_updated_recipes.py
3636

37-
testapps-with-numpy/%: virtualenv
38-
$(eval $@_APP_ARCH := $(shell basename $*))
37+
testapps-with-numpy: virtualenv
3938
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
4039
python setup.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
4140
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
42-
--arch=$($@_APP_ARCH)
41+
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86
42+
43+
testapps-with-numpy-aab: virtualenv
44+
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
45+
python setup.py aab --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
46+
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
47+
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86 --release
4348

4449
testapps/%: virtualenv
4550
$(eval $@_APP_ARCH := $(shell basename $*))
@@ -69,14 +74,18 @@ docker/run/test: docker/build
6974
docker/run/command: docker/build
7075
docker run --rm --env-file=.env $(DOCKER_IMAGE) /bin/sh -c "$(COMMAND)"
7176

72-
docker/run/make/%: docker/build
73-
docker run --rm --env-file=.env $(DOCKER_IMAGE) make $*
77+
docker/run/make/with-artifact/apk/%: docker/build
78+
docker run --name p4a-latest --env-file=.env $(DOCKER_IMAGE) make $*
79+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app-debug-1.1-.apk ./apks
80+
docker rm -fv p4a-latest
7481

75-
docker/run/make/with-artifact/%: docker/build
76-
$(eval $@_APP_ARCH := $(shell basename $*))
82+
docker/run/make/with-artifact/aab/%: docker/build
7783
docker run --name p4a-latest --env-file=.env $(DOCKER_IMAGE) make $*
78-
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app__$($@_APP_ARCH)-debug-1.1-.apk ./apks
84+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app-release-1.1-.aab ./aabs
7985
docker rm -fv p4a-latest
8086

87+
docker/run/make/%: docker/build
88+
docker run --rm --env-file=.env $(DOCKER_IMAGE) make $*
89+
8190
docker/run/shell: docker/build
8291
docker run --rm --env-file=.env -it $(DOCKER_IMAGE)

0 commit comments

Comments
 (0)
Please sign in to comment.