notecipher / make-release-build.sh @ master
History | View | Annotate | Download (860 Bytes)
1 |
#!/bin/sh |
---|---|
2 |
|
3 |
set -e |
4 |
|
5 |
if [ -e ~/.android/bashrc ]; then |
6 |
. ~/.android/bashrc |
7 |
else |
8 |
echo "No ~/.android/bashrc found, 'android' and 'ndk-build' must be in PATH" |
9 |
fi |
10 |
|
11 |
projectroot=`pwd` |
12 |
projectname=`sed -n 's,.*name="app_name">\(.*\)<.*,\1,p' app/res/values/strings.xml` |
13 |
|
14 |
for f in $projectroot/external/*/.git; do |
15 |
dir=`echo $f | sed 's,\.git$,,'` |
16 |
cd $dir |
17 |
git reset --hard |
18 |
git clean -fdx |
19 |
cd $projectroot |
20 |
done |
21 |
|
22 |
cd $projectroot |
23 |
git reset --hard |
24 |
git clean -fdx |
25 |
|
26 |
git submodule update --init --recursive |
27 |
|
28 |
if [ -e ~/.android/ant.properties ]; then |
29 |
cp ~/.android/ant.properties $projectroot/app/ |
30 |
else |
31 |
echo "skipping release ant.properties" |
32 |
fi |
33 |
|
34 |
./setup-ant.sh |
35 |
./fix-support-library.sh |
36 |
cd app/ |
37 |
ant release |
38 |
|
39 |
apk=$projectroot/app/bin/$projectname-release.apk |
40 |
if [ -e $apk ]; then |
41 |
gpg --detach-sign $apk |
42 |
else |
43 |
echo $apk does not exist! |
44 |
fi |