TeamCity build number integration with xml file

I use TeamCity to build android projects.
Android takes build number and version info from AndroidManifest.xml file, which looks like

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="org.sample.name"
          android:versionCode="55"
          android:versionName="1.2.1">
[skipped]
</manifest>

where android:versionCode is the build number and android:versionName is visible version (e.g. 4.5.1). Android projects are built with ant.

What I want is full (forward and backward) integration for build numbers, i.e. TeamCity read build number from manifest, use it, increment, update file and commit it to svn.
What is the best and most correct way to do it? A couple of special ant tasks?

1 comment
Comment actions Permalink

Hello Ildar,

  You can obtain TeamCity's build number in your ant script via ${build.number} variable.
  You can pass custom build number to TeamCity server using service message, please see here.

  Hope this helps,
  KIR

0

Please sign in to leave a comment.