-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
make-release-build
executable file
·45 lines (38 loc) · 1.1 KB
/
make-release-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
#!/bin/bash
# bash is required because we need bash's printf to guarantee a cross-platform
# timestamp format.
set -e
set -x
if [ -z $ANDROID_HOME ]; then
if [ -e ~/.android/bashrc ]; then
. ~/.android/bashrc
else
echo "ANDROID_HOME must be set!"
exit
fi
fi
if [ -z $ANDROID_NDK_HOME ]; then
if which ndk-build 2>&1 /dev/null; then
ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'`
else
echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH"
exit
fi
fi
projectroot=`pwd`
# standardize timezone to reduce build differences
export TZ=UTC
TIMESTAMP=`printf '%(%Y-%m-%d %H:%M:%S)T' \
$(git log -n1 --format=format:%at)`
git reset --hard
git clean -fdx
git submodule foreach --recursive git reset --hard
git submodule foreach --recursive git clean -fdx
git submodule sync --recursive
git submodule foreach --recursive git submodule sync
git submodule update --init --recursive
./setup-ant
faketime -f "$TIMESTAMP" make -C external/
faketime -f "$TIMESTAMP" $ANDROID_NDK_HOME/ndk-build
ant release
# `ant release` handles the gpg signing