BETA_PACKAGE=com.fsck.k9beta
BETA_PATH=com/fsck/k9beta
BETA_PROJ_NAME="K9 Beta"
perl -pi -e"s|\@string/app_name|\@string/beta_app_name|g" AndroidManifest.xml
perl -pi -e"s|com/fsck/k9/R.java|$BETA_PATH/R.java|g" build.xml
find src/com/fsck res -type f |xargs -n 1 perl -pi -e"s/com.fsck.k9(?=\W)/$BETA_PACKAGE/g"
perl -pi -e"s|com.fsck.k9|$BETA_PACKAGE|g" AndroidManifest.xml
mv src/com/fsck/k9 src/$BETA_PATH
perl -pi -e"s|K9|$BETA_PROJ_NAME|g" build.xml
ant $@
mv src/$BETA_PATH src/com/fsck/k9
perl -pi -e"s|$BETA_PACKAGE|com.fsck.k9|g" AndroidManifest.xml
perl -pi -e"s|$BETA_PATH/R.java|com/fsck.k9/R.java|g" build.xml
find src/com/fsck res -type f |xargs -n 1 perl -pi -e"s/$BETA_PACKAGE(?=\W)/com.fsck.k9/g"
perl -pi -e"s|$BETA_PROJ_NAME|K9|g" build.xml
perl -pi -e"s|\@string/beta_app_name|\@string/app_name|g" AndroidManifest.xml
