I want assemblies that are built in queue in build machine to have custom assembly details which helps us track in finding bugs. Ex I want file description of assembly to contain BranchName_Timestamp.rev_Changeset ex Live_20120301.7_12345
Asked
Active
Viewed 468 times
2
-
Do you build it on a TFS build server? – abatishchev Apr 20 '12 at 12:42
-
yes we build on TFS build server – Suresh Balaji Apr 20 '12 at 12:53
2 Answers
0
- To get the timespam:
http://msbuildtasks.tigris.org/
<UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Time" />
<MSBuild.Community.Tasks.Time Format="MM.dd.yyyy.HH.mm">
<Output TaskParameter="FormattedTime" PropertyName="_time_spam" />
</MSBuild.Community.Tasks.Time>
- To get the latest changeset:
https://stackoverflow.com/a/10252772/1268570
- To get the name of the current branch:
You could check the following link
http://msdn.microsoft.com/en-us/library/dcbx5yce.aspx
Actually i have not tried to get the name of the current branch, the way we work is with labels instead of adding the name of the branch we add the name of the label and we label every time we release a new version, if you are interested in this approach, I built this functionality in NCastor AutoBuilder (I am planning a release in about one week):
Putting all together:
<PropertyGroup>
<InformationalVersion>$(SemanticVersion) $(BranchName)_$(_time_spam).rev_$(TFSRevisionVersion)</InformationalVersion>
</PropertyGroup>
<UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.AssemblyInfo" />
<MSBuild.Community.tasks.AssemblyInfo OutputFile="$(AssemblyVersionFilePath)"
CodeLanguage="C#"
AssemblyFileVersion="$(FileVersion)"
AssemblyInformationalVersion="$(InformationalVersion)"
AssemblyVersion="$(SemanticVersion)" />
-
Hi thanks a lot. I am checking out the answer. I will let you know once i complete – Suresh Balaji Apr 23 '12 at 05:47