views:

12

answers:

1

Hi all,

I need to implement auto-increment for each nightly builds.

For this, i need to read existing version, increment only the build number and save the incremented build number to assemblyinfo.cs files as well as some custom xml files having the following syntax.

<?xml version="1.0" encoding="utf-8"?>
<MyProduct>
  <Version>v.3.0.13</Version>
  <Build>3.0.13</Build>
</MyProduct>

I am having trouble to read existing version and build number separately. I could increment build number using the Sdc.Sum Task from Microsoft.Sdc task but there is a problem while trying to read the assembly version.

Kindly help

Thanks

A: 

Got the solution, First i checked out the required .xml and assemblyinfo. files

the problem was solved using Microsft.SDc.tasks and using the Version task and a proper XPath query, the version was easily read.

using Math.Sum from Microsoft.Sdc or Math.Add from MsBuild Community tasks increment can be performed on any of the single variable that may represent, lets say build number...

using File.Replace task i was able to change the build number for each nightly build and used a regular expression to match and change version not only in the xml files but also in the assemblyinfo.* files.

Finally i checked in the changes

All the above tasks were performed in the Afterget Target.

Steve Johnson