I'm currently trying to add a set of commands for the AfterBuild event of my build. The commands are as follows
The section defined in my project file looks like
<Target Name="AfterBuild">
<PropertyGroup>
<TF>"$(VS100COMNTOOLS)..\IDE\tf.exe"</TF>
</PropertyGroup>
<!-- include the Challenges dll and config -->
<ItemGroup>
<UtilityDLLs Include="$(OutDir)\*.*" />
</ItemGroup>
<!-- Automticly checkout files -->
<Exec Condition=" '$(BuildingInsideVisualStudio)' == 'false' " Command="$(TF) checkout /noprompt /recursive $(SolutionDir)..\Binaries\Latest\$(ConfigurationName)\">
</Exec>
<!-- copy the file to features build output-->
<Copy Condition=" '$(BuildingInsideVisualStudio)' == 'false' " ContinueOnError="true" OverwriteReadOnlyFiles="true" SourceFiles="@(UtilityDLLs)" DestinationFolder="$(SolutionDir)..\Binaries\Latest\$(ConfigurationName)\" />
<!-- Automatically checkin files -->
<Exec Condition=" '$(BuildingInsideVisualStudio)' == 'false' " Command="$(TF) checkin /noprompt /recursive /comment:"COMMENT HERE" $(SolutionDir)..\Binaries\Latest\$(ConfigurationName)\">
</Exec>
</Target>
In my last command, you'll see the option of /comment:"COMMENT HERE"
I would like to substitute "COMMENT HERE" with the MSBUILD or TFS property that contains the comment of the dev who made the initial checkin. Is this an option? If so, how do I accomplish this?
I didn't find one in Common MSBuild Project Properties
Elaboration
Without divulging too much information, let me elaborate on what I'm trying to accomplish. Our TFS structure is essentionally laid out something like this
When a developer checks in a change to /trunkCore/Library# a build kicks off and the resulting binaries are automatically checked into /trunkWeb/CoreBinaries and /trunkAPI/CoreBinaries. The checkin occurs as a result of the AfterBuild config settings I have defined in the Library1, Library2, and Library3 csproj files (as seen above).
The initial code checkin and the checkin of the binaries are two seperate checkins. I would like to reference the comment of the original code checkin in the checkin notes of the automated checkin instead of using some canned text like "Automated checkin of binaries". Doing so would offer much more clarity when viewing history of the binaries in the CoreBinaries directories. This isn't a must have but most definitely would be nice.
Checkins and builds aren't 1 to 1. There could be no checkins related for manually queued builds, or multiple for scheduled or rolling builds.
You will need to add either a custom task, or call a custom executable, but as long as you aren't using Gated Checkins (as the checkin doesn't technically happen until after the build) you should be able to query for all the checkin comments and grab what you need.
var changesetSummaries = InformationNodeConverters.GetAssociatedChangesets(IBuildDetail);
foreach(var changesetSummary in changesetSummaries) {
changesetSummary.Comment....
}