2015-06-03 20:04:05 +00:00
|
|
|
#!/bin/bash
|
2016-09-26 19:06:12 +00:00
|
|
|
# bash is required because we need bash's printf to guarantee a cross-platform
|
|
|
|
# timestamp format.
|
2015-06-03 20:04:05 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [ -z $ANDROID_HOME ]; then
|
2016-09-26 19:06:12 +00:00
|
|
|
if [ -e ~/.android/bashrc-ant-build ]; then
|
|
|
|
. ~/.android/bashrc-ant-build
|
2015-06-03 20:04:05 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
# reset version code/name to current date
|
|
|
|
versionCodeDate=`date +%s`
|
|
|
|
versionNameDate=`date +%Y-%m-%d_%H.%M.%S`
|
|
|
|
|
|
|
|
sed -i \
|
|
|
|
-e "s,android:versionCode=\"[0-9][0-9]*\",android:versionCode=\"$versionCodeDate\"," \
|
|
|
|
-e "s,android:versionName=\"\([^\"][^\"]*\)\",android:versionName=\"\1.$versionNameDate\"," \
|
|
|
|
AndroidManifest.xml
|
|
|
|
|
2016-01-04 07:32:12 +00:00
|
|
|
ndk-build
|
2015-06-03 20:04:05 +00:00
|
|
|
make -C external
|
|
|
|
./setup-ant
|