add fixed api to example
[andGMXsms.git] / bump.sh
blobb78e5cfdbe7d0bd3fcf00d871ce443ddba104804
1 #! /bin/sh
3 if [ "$(basename $0)" == "bump-connector.sh" ] ; then
4 echo -n "bump connector: "
5 basename $PWD
6 n=$(fgrep app_name res/values/*.xml | cut -d\> -f2 | cut -d\< -f1 | tr ' ' '-' | tr -d ':')
7 else
8 echo "bump websms"
9 n=$(fgrep app_name res/values/*.xml | cut -d\> -f2 | cut -d\< -f1 | cut -d\ -f1 | tr -d \ )
12 v=${1}
13 vv=$(echo ${v}0000 | tr -d . | head -c4 | sed -e 's:^0::g')
15 if [ -n "$2" ] ; then
16 vn="$v $2"
17 else
18 vn=$v
21 echo v $v
22 echo vn $vn
23 echo vv $vv
24 echo n $n
25 echo tag "${n}-${vn/ /-}"
26 echo tagm "$(echo ${n} | tr '-' ' ' | sed -e 's/Connector /Connector: /') v${vn}"
28 sed -i -e "s/android:versionName=\"[^\"]*/android:versionName=\"${vn}/" AndroidManifest.xml
29 sed -i -e "s/android:versionCode=\"[^\"]*/android:versionCode=\"${vv}/" AndroidManifest.xml
30 vfile=$(grep -l app_version res/values/*.xml)
31 sed -i -e "s/app_version\">[^<]*/app_version\">${vn}/" "${vfile}"
33 git diff
35 ant debug || exit -1
37 mv bin/*-debug.apk ~/public_html/h/flx/ 2> /dev/null
39 echo "enter for commit+tag"
40 read a
41 git commit -am "bump to ${n} v${vn}"
42 git tag -a "${n}-${vn/ /-}" -m "${n} v${vn}"