开发者

TFS 2010, BuildAgent and MSBuild for changelog.txt with changeset

We use TFS 2010 with VS 2010 for our web projects (php). Since we do not actualy use .proj files I have created my own to do builds (only zip files to output dir). Also we use MSBuild community tasks. My msbuild.proj for my web application (php) goes like this:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
    <Target Name="Changelog">
        <!-- need to create changelog.txt (all checkin files comments) -->
    </Target>
    <Target Name="Zip" DependsOnTargets="Changelog">
        <ItemGroup>
            <ZipFiles Include="**\*.*"/>
        </ItemGroup>
        <Zip Files="@(ZipFiles)" ZipFileName="$(OutDir)_myzip.zip" />
    </Target>
    <Target Name="Default" DependsOnTargets="Zip">
        <Message Text="My Build Complete" />
    </Target>
</Project>

My question is how to write Target "Changelog" that will create changelog.txt with all de开发者_如何学Pythonveloper comments for all-time check-in files in TFS. If necesery I can modify DefaultTemplate.xaml file and/or build definition. BuildAgent is started as NETWORK SERVICE and places file on drop folder/network share.


If you're using TFS Build the Build Summary report will by default give you a list of associated changesets for that build (this is the list of changesets since the last successful build).

If you want a list of all changesets since the beginning of time you're going to have to do some customization. You have two options, creating a custom MSBuild task, or creating a custom Build Workflow Activity. I'd recommend the latter in this case as that is the new way of doing things in TFS 2010.

Either approach is actually pretty straightforward. To create a custom workflow activity see this blog post to get you started: http://blogs.msdn.com/b/jimlamb/archive/2009/11/18/how-to-create-a-custom-workflow-activity-for-tfs-build-2010.aspx alternatively if you choose to go the MSBuild route here's a post to show you how to create a custom task: http://blogs.msdn.com/b/msbuild/archive/2006/01/21/515834.aspx and here's the reference for the TFS API method you'll probably want to call to get a list of changesets: http://msdn.microsoft.com/en-us/library/bb138960.aspx


In my opinion, there are two ways in which we can approach to resolve this issue. First one will be to customize .proj file and so the Build aspect. Second way will be use something like http://tfschangelog.codeplex.com application.

TFS ChangeLog allows users to automatically generate release notes from TFS by providing project, branch and changeset range information. It then extracts information about each changeset and their associated workitems within the given range of changesets into XML file.

Users can use this application either from command prompt (automate generating release notes using scheduled task) or use GUI interface to generate release notes.

Hope this helps.

Best Regards,

Dharmesh Shah.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜