#!/bin/bash

revno=`bzr revno`
nextrev=`expr $revno + 1`

# TODO: when bzr zipping works again change these to zip files
for d in droidparty-demos droidparty-tests droidparty-abstractions;
do
	bzr export $d.tgz ../$d/
done

rm PdDroidParty-debug.apk
cp ../bin/PdDroidParty-debug.apk PdDroidParty-debug-$nextrev.apk
ln -s PdDroidParty-debug-$nextrev.apk PdDroidParty-debug.apk

sed "s/PdDroidParty-debug-[0-9][0-9][0-9].apk*/PdDroidParty-debug-$nextrev.apk/g" index.html > index.html.tmp
mv index.html.tmp index.html

bzr commit -m "Version bump for release v$nextrev"

rsync -avz . mccormick.cx:~/mccormick.cx/projects/PdDroidParty/
