0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00
Anki-Android/tools/parallel-package-release.sh
Mike Hardy e6eb737a40 Add tool to build typical parallel packages
Uses the names used for the previous parallel builds so should
generate 3 new builds that should work as upgrades for the old parallel builds
2017-12-19 12:01:53 +09:00

35 lines
1.3 KiB
Bash
Executable File

#!/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
# Read the key passwords
read -sp "Enter keystore password: " KSTOREPWD; echo
read -sp "Enter key password: " KEYPWD; echo
export KSTOREPWD
export KEYPWD
# Get on to the tag requested
#git checkout $TAG
BUILDNAMES='A B C'
for BUILD in $BUILDNAMES; do
git reset --hard
git clean -f
LCBUILD=`tr '[:upper:]' '[:lower:]' <<< $BUILD`
./tools/parallel-package-name.sh com.ici2.anki.$LCBUILD AnkiDroid.$BUILD
./gradlew assembleRelease
cp AnkiDroid/build/outputs/apk/AnkiDroid-release.apk ../AnkiDroid-$TAG.parallel.$BUILD.apk
done