1

We have ccnet+tfs+ant

I need to configure automation build process for android application with auto increment build version, based on tfs changeset number.In build process Version number taking from androidmanifest.xml.

Is this possible to auto-increment version number in androidmanifest.xml based on TFS changeset number?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
mirakl
  • 167
  • 3
  • 14

1 Answers1

1

Of course it is! Ant can (almost) do anything with a little bit of work.

Here's how you'd grab the TFS changeset number using the respective bindings:

<Target Name="GetVersionChangeSet">
<TfsVersion
    TfsLibraryLocation="$(DevEnvDir)ReferenceAssemblies\v2.0"
    LocalPath="$(SolutionDir)">
    <Output TaskParameter="Changeset" PropertyName="ChangesetNumber"/>
</TfsVersion>

Note: the above TfsLibraryLocation will only work with VS2010+. You'll need to find this out for any other version you're running.

And using Ant variables, here's an example of how you'd use it:

<Message Text="TFS ChangeSetNumber: $(ChangesetNumber)" />
KushalP
  • 10,976
  • 6
  • 34
  • 27
  • Could you please give more detail information. I'm not a pro in this direction. How the changeset number get into the androidmanifest.xml. – mirakl May 12 '11 at 13:24
  • You wrote that this is Ant task but why when I've tried to use it I got the error: Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any / declarations have taken place. – mirakl Jul 01 '11 at 15:03
  • If you run ant in verbose mode, can you post what the full error message is please? Alternatively, on Freenode, there's an #ant channel that might be able to provide further assistance. Link: http://webchat.freenode.net/ – KushalP Jul 01 '11 at 20:12
  • 1
    Sorry but TFSVersion is not an Ant task it is MSbuild task. I think this topic can be closed , I'll trying to find Ant tasks for increment version. – mirakl Jul 06 '11 at 20:14