I have application which uploaded into Subversion/SVN repo. Is it possible to use script to somehow change application version code stored in AndroidManifest
? I mean during/after checkout/update?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackage"
android:versionCode="100000"
android:versionName="1.0">
SVN has keyword substitution which you can use to put the revision number in a file. However, this will result in the revision when the manifest file itself was last changed, which is not what you want.
The best way to achieve what you want is to call svnversion
from your build script, and embed the output in the manifest file from there. You could have a manifest.template
file under version control which can be used by your build script to generate the real manifest file. Put a placeholder word in the template and replace it by the revision number obtained with svnversion
.
edit: in Eclipse you would probably use an Ant script, and invoke it before the normal build. The linked example generates a class file with the revision number, but you could also generate a manifest file in a very similar way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With