开发者

Auto-increment build number using Ant

开发者 https://www.devze.com 2023-03-04 20:51 出处:网络
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

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

精彩评论

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