2017-12-15 05:04:53 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This script assumes a few things -
|
|
|
|
#
|
|
|
|
# 1) you are in the main directory of the Anki source code (e.g. 'Anki-Android' is the current working directory)
|
|
|
|
# 2) you have a Java keystore at the file path $home/src/android-keystore
|
|
|
|
# 3) In that java keystore you have the key alias 'nrkeystorealias'
|
|
|
|
# 4) you have no local changes in your working directory (e.g. "git reset --hard && git clean -f")
|
|
|
|
# If those assumptions are met, this script will generate 3 parallel builds that should be the same as your current checkout
|
|
|
|
# They will be placed in the parent directory ('..') as 'AnkiDroid-<version>.parallel.<A B or C>.apk'
|
|
|
|
|
|
|
|
# It takes 1 argument - the tag name to use for the build (e.g. '2.9alpha16')
|
|
|
|
# It will ask you for your keystore and key password
|
|
|
|
|
|
|
|
TAG=$1
|
2018-09-14 08:57:08 +02:00
|
|
|
if [ "$TAG" == "" ]; then
|
|
|
|
echo "Please enter a tag (likely a version number) for the APK file names"
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-12-15 05:04:53 +01:00
|
|
|
|
|
|
|
# Read the key passwords
|
2020-06-16 01:03:16 +02:00
|
|
|
if [ "$KSTOREPWD" == "" ]; then
|
|
|
|
read -sp "Enter keystore password: " KSTOREPWD; echo
|
|
|
|
read -sp "Enter key password: " KEYPWD; echo
|
|
|
|
export KSTOREPWD
|
|
|
|
export KEYPWD
|
|
|
|
fi
|
2017-12-15 05:04:53 +01:00
|
|
|
|
|
|
|
# Get on to the tag requested
|
|
|
|
#git checkout $TAG
|
|
|
|
|
2018-12-21 06:22:11 +01:00
|
|
|
BUILDNAMES='A B C D E'
|
2017-12-15 05:04:53 +01:00
|
|
|
for BUILD in $BUILDNAMES; do
|
|
|
|
git reset --hard
|
|
|
|
git clean -f
|
|
|
|
LCBUILD=`tr '[:upper:]' '[:lower:]' <<< $BUILD`
|
2018-09-14 08:57:08 +02:00
|
|
|
./tools/parallel-package-name.sh com.ichi2.anki.$LCBUILD AnkiDroid.$BUILD
|
2021-04-20 05:39:06 +02:00
|
|
|
./gradlew assemblePlayRelease -Duniversal-apk=true
|
|
|
|
cp AnkiDroid/build/outputs/apk/play/release/AnkiDroid-play-universal-release.apk ./AnkiDroid-$TAG.parallel.$BUILD.apk
|
2017-12-15 05:04:53 +01:00
|
|
|
done
|
2020-06-15 22:12:24 +02:00
|
|
|
git reset --hard
|
|
|
|
git clean -f
|