-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathbuildscript-android-release.sh
executable file
·87 lines (72 loc) · 2.47 KB
/
buildscript-android-release.sh
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
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
#
# This script builds "enroute flight navigation" for Android in release mode.
#
# See https://github.com/Akaflieg-Freiburg/enroute/wiki/Build-scripts
#
#
# Copyright © 2020 Stefan Kebekus <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# Fail on first error
#
set -e
#
# Clean up
#
rm -rf build-android-release
mkdir -p build-android-release
#
# Configure
#
$Qt6_DIR_ANDROID\_x86_64/bin/qt-cmake \
-S . \
-B build-android-release \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DQT_ANDROID_BUILD_ALL_ABIS:BOOL=On \
-DQT_HOST_PATH=$Qt6_DIR_MACOS \
-G Ninja
#
# Build the executable
#
cmake --build build-android-release
cmake --build build-android-release --target aab
#
# Sign files … and done.
#
if [ -z "$ANDROID_KEYSTORE_FILE" -o -z "$ANDROID_KEYSTORE_PASS" ]
then
echo "Not signing APK because \$ANDROID_KEYSTORE_FILE or \$ANDROID_KEYSTORE_PASS not set"
else
echo "Signing APK"
$ANDROID_SDK_ROOT/build-tools/34.0.0/apksigner \
sign \
--ks $ANDROID_KEYSTORE_FILE \
--ks-pass pass:$ANDROID_KEYSTORE_PASS \
--in build-android-release/src/android-build/build/outputs/apk/release/android-build-release-unsigned.apk \
--out build-android-release/enroute-release-signed.apk
echo "Signed APK file is available at $PWD/enroute-release-signed.apk"
echo
echo "Signing AAB"
jarsigner \
-keystore $ANDROID_KEYSTORE_FILE \
-storepass $ANDROID_KEYSTORE_PASS \
build-android-release/src/android-build/build/outputs/bundle/release/android-build-release.aab "Stefan Kebekus"
cp build-android-release/src/android-build/build/outputs/bundle/release/android-build-release.aab build-android-release/enroute-release-signed.aab
echo "Signed AAB file is available at $PWD/enroute-release-signed.aab"
nautilus $PWD/build-android-release &
fi