Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing Project Properties for Publish Version in team build

i have a nightly build in my TFS server that runs every night and is working completely fine. we plan to create a clickonce application as well which is currently working fine except the publish version (ApplicationVersion) which we want to automatically increment with each build instead of entering it manually. An important point to mention is that we only want the Revision part to be increment by 1 with each build. e.g 1.1.1.1 for first time and 1.1.1.2 for the next build.

Please note as alot of information is available for assembly versioning so i am not at all interested in it, i just want my application version to increment so please do point me in this direction.

My VS and TFS server is 2008.Is there any way i can edit my Publish version before build as i do in this case to edit the InstallUrl of the projecte-g

<File.RegEx Path="$(BuildDirectory)/Sources/Client/Client/Client.csproj"
      RegularExpression="&lt;InstallUrl&gt;(.*?)&lt;/InstallUrl&gt;"
      NewValue="&lt;InstallUrl&gt;$(InstallUrl)&lt;/InstallUrl&gt;" Force="true"/>

The publish version is a combination of

<ApplicationVersion> 
and 
<ApplicationRevision> 

and in my scenerio it is defined as follows

<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.9.4.%2a</ApplicationVersion>

and then

<File.RegEx Path="$(BuildDirectory)/Sources/Client/Client/Client.csproj"
      RegularExpression="&lt;ApplicationRevision&gt;(.*?)&lt;/ApplicationRevision&gt;"
      NewValue="&lt;ApplicationRevision&gt;$(ApplicationRevision)&lt;/ApplicationRevision&gt;" Force="true"/>

    <File.RegEx Path="$(BuildDirectory)/Sources/Client/Client/Client.csproj"
      RegularExpression="&lt;ApplicationVersion&gt;(.*?)&lt;/ApplicationVersion&gt;"
      NewValue="&lt;ApplicationVersion&gt;$(ApplicationVersion)&lt;/ApplicationVersion&gt;" Force="true"/>

But the value is never incremented after first run. after the first run the value is always 1.9.4.1. Is there any way that it should be incremented for the next Build. Have tried application revision with *+1, #+1 ...

like image 596
Fabulist Avatar asked Nov 14 '22 01:11

Fabulist


1 Answers

You should update your TFS server to TFS 2012 first. This will maintain support for VS2008 (TFS 2013 no longer supports it) and gives you access to community tools that no longer support 2008.

You will find two custom activities in the TFS Community Build Extensions that will do what you need.

  • ClickOnce - this updates and configures the manifests for clickonce deployments from build
  • TfsVersion - this creates and populates the versions number with the correct incrementing

No, I do not know any what to do this (except to roll you own) in TFS 2008. It is just too old to be supported by the community.

like image 198
MrHinsh - Martin Hinshelwood Avatar answered Dec 27 '22 20:12

MrHinsh - Martin Hinshelwood