forked from xemu-project/xemu
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathbuild-aab.sh
More file actions
38 lines (31 loc) · 1.12 KB
/
build-aab.sh
File metadata and controls
38 lines (31 loc) · 1.12 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
#!/usr/bin/env bash
set -euo pipefail
project_source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
android_dir="${project_source_dir}/android"
key_props="${android_dir}/key.properties"
release_aab="${android_dir}/app/build/outputs/bundle/release/app-release.aab"
if [[ ! -f "${key_props}" ]]; then
printf 'Creating "%s" with placeholders...\n' "${key_props}"
cat >"${key_props}" <<'EOF'
storeFile=/path/to/your-release-key.jks
storePassword=REPLACE_ME
keyAlias=REPLACE_ME
keyPassword=REPLACE_ME
EOF
printf '\nEdit %s with your real values, then rerun this script.\n' "${key_props}"
exit 1
fi
if grep -Fq 'REPLACE_ME' "${key_props}"; then
printf '\nPlease replace the placeholders in %s before building.\n' "${key_props}"
exit 1
fi
if grep -Fq '/path/to/your-release-key.jks' "${key_props}" || \
grep -Fq 'C:/path/to/your-release-key.jks' "${key_props}"; then
printf '\nPlease replace the storeFile placeholder in %s before building.\n' "${key_props}"
exit 1
fi
cd "${android_dir}"
bash ./gradlew bundleRelease
printf '\nBuild complete.\n'
printf 'Release AAB:\n'
printf ' %s\n' "${release_aab}"