I read an article by John Robbins TFS 2010 Build Number and assembly file versions: it is fully synchronized only with MSBuild 4.0 , and I'm wondering about how best to integrate this.
The download for an article has two files, one is a targets file, and one is a proj file.
There are several tasks in the goals file to clear the build number based on the Tfs build number (the same one used for the build), and write that number to some place (name it BuildNumberFile) for consumption by other proj files.
The proj file is very simple. It simply imports the aforementioned goal file, and then declares the goal with the name โEveryoneโ, and also declares DefaultTargets in the Project element to everyone as well.
<Project ToolsVersion="4.0" DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TFSMajorBuildNumber>3</TFSMajorBuildNumber>
<TFSMinorBuildNumber>1</TFSMinorBuildNumber>
</PropertyGroup>
<Import Project="Wintellect.TFSBuildNumber.targets"/>
<Target Name="All"
DependsOnTargets="WriteSharedCSharpAssemblyVersionFile;
WriteSharedVBAssemblyVersionFile;
WriteSharedCPPCLIAssemblyVersionFile;
WriteSharedCPPAssemblyVersionFile;
WriteSharedWiXAssemblyVersionFile;
WriteSharedTextAssemblyVersionFile;"/>
</Project>
I have two questions:
- MSBuild. , ? , ?
- , csproj Include BuildNumberFile, compiletime?
- DependsOnTargets -, , ?
- csproj, , , DependsOnTargets BuildNumberFile?
!