Created
October 10, 2012 14:46
-
-
Save neofreko/3866084 to your computer and use it in GitHub Desktop.
Version bumper for Android manifest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #configure this as external tool to run on your project | |
| #!/bin/sh | |
| #git revision | |
| rev=$(git log --pretty=format:'%h' -n 1) | |
| #version code | |
| vc=$(grep android:versionCode AndroidManifest.xml | cut -f2 -d\") | |
| vc=$(($vc+1)) | |
| #update versionName | |
| sed -i.name.bak "s/android:versionName=\"[a-z0-9]*\"/android:versionName=\"$rev\"/1" AndroidManifest.xml | |
| #update versionCode | |
| sed -i.code.bak "s/android:versionCode=\"[0-9\.]*\"/android:versionCode=\"$vc\"/1" AndroidManifest.xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment