-
Notifications
You must be signed in to change notification settings - Fork 0
/
ichnaea-nlp.sh
executable file
·44 lines (41 loc) · 1.28 KB
/
ichnaea-nlp.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
#!/bin/sh
MYDIR="$(dirname $(realpath $0))"
OUTAPK=build/outputs/apk/IchnaeaNlpBackend-release.apk
MODULE=IchnaeaNlpBackend
[ -z "$ANDROID_HOME" ] && . ${MYDIR}/envsetup.sh
[ -z "$APP_ROOT_PATH" ] && APP_ROOT_PATH=$MYDIR
[ -z "$VERSION" ] && VERSION=v1.3.3
mkdir -p "$APP_ROOT_PATH"
cd "$APP_ROOT_PATH"
[ -d $MODULE ] || git clone git@github.com:microg/IchnaeaNlpBackend.git $MODULE --branch $VERSION --single-branch
[ -d secret-keys ] || git clone git@github.com:OpenMandrivaAssociation/secret-keys
if [ -d secret-keys ]; then
CERTS="$(pwd)"/secret-keys
fi
cd $MODULE
if [ -n "$CERTS" ]; then
P="$(cat $CERTS/aosp/password)"
if ! grep -q fmo.jks build.gradle; then
cat >>build.gradle <<EOF
android {
signingConfigs {
release {
storeFile file("$CERTS/aosp/fmo.jks")
storePassword "$P"
keyAlias "apps"
keyPassword "$P"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
EOF
fi
./gradlew clean assembleRelease
cp -f $OUTAPK $PRODUCT_OUT_PATH/$MODULE.apk
else
echo "Warning: Debug build is not supported"
fi