开发者

Auto-increment build number using Ant

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开发者_JAVA技巧.xml based on TFS changeset number?


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)" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜