-
Notifications
You must be signed in to change notification settings - Fork 42
/
z-build
executable file
·62 lines (50 loc) · 1.74 KB
/
z-build
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
#!/bin/bash
if [[ "$1" = "" || "$2" = "" ]] ; then
echo "Usage: z-build <gplay|gplayhalloween|fdroid> <debug|release> [install]"
exit
fi
VERSION_NAME=`cat gradle.properties | grep VERSION_NAME | sed -e 's/^[ ]*VERSION_NAME[ ]*=//' | sed -e 's/[ ]*$//'`
if [[ "$3" = "install" ]] ; then
PREFIX="install"
else
PREFIX="assemble"
fi
case "$2" in
debug)
SUFFIX="Debug"
;;
release)
SUFFIX="Release"
;;
*)
echo "Unknown build type: $2"
exit
esac
case "$1" in
gplay)
TASK="ForgplayWithgplayWithzeemoteWoutkoWouthalloween"
LCTASK="forgplaywithgplaywithzeemotewoutkowouthalloween"
SRCNAME="gloomy-dungeons-2-forgplay-withgplay-withzeemote-woutko-wouthalloween-release.apk"
DSTNAMEPART="gloomy-dungeons-2-fullnfree-${VERSION_NAME}"
;;
gplayhalloween)
TASK="ForgplayhalloweenWithgplayWithzeemoteWoutkoWithhalloween"
LCTASK="forgplayhalloweenwithgplaywithzeemotewoutkowithhalloween"
SRCNAME="gloomy-dungeons-2-forgplayhalloween-withgplay-withzeemote-woutko-withhalloween-release.apk"
DSTNAMEPART="gloomy-dungeons-2-halloween-${VERSION_NAME}"
;;
fdroid)
TASK="ForfdroidWoutgplayWoutzeemoteWoutkoWouthalloween"
LCTASK="forfdroidwoutgplaywoutzeemotewoutkowouthalloween"
;;
*)
echo "Unknown build variant: $1"
exit
esac
./gradlew "${PREFIX}${TASK}${SUFFIX}"
if [[ "$2" = "release" && -e "temp" && "$SRCNAME" != "" && "$DSTNAMEPART" != "" ]] ; then
[ -e "temp/${DSTNAMEPART}.apk" ] && rm "temp/${DSTNAMEPART}.apk"
[ -e "temp/${DSTNAMEPART}.txt" ] && rm "temp/${DSTNAMEPART}.txt"
[ -e "build/outputs/apk/${SRCNAME}" ] && cp "build/outputs/apk/${SRCNAME}" "temp/${DSTNAMEPART}.apk"
[ -e "build/outputs/mapping/${LCTASK}/release/mapping.txt" ] && cp "build/outputs/mapping/${LCTASK}/release/mapping.txt" "temp/${DSTNAMEPART}.txt"
fi