开发者

Custom build activity - display changes made since previous commit

Using a custom activity inside the build template, is there a way to enumerate through the changes made since the previous build?

I plan on eventually compiling a list of changes so when the build is triggered an E-mail is sent displaying information on the build as well as the changes made.

Any information or links would be great.

Thanks

Edit

Would something similar to this work, if I passed the changeset into my custom activity?

public sealed class ChangeSetActivity : CodeActivity
{
    // Define an activity input argument of type string
    public InArgument<string> Text { get; set; }
    public InArgument<IBuildDetail> currentBuild { get; set; }
    public InArgument<List<IChangesetSummary>> changes { get; set; }
    public OutArgument<string> changeSet { get; set; }

    // If your activity returns a value, deri开发者_如何学Gove from CodeActivity<TResult>
    // and return the value from the Execute method.
    protected override void Execute(CodeActivityContext context)
    {
        // Obtain the runtime value of the Text input argument
        string text = context.GetValue(this.Text);
        string str = "";
        foreach (IChangesetSummary c in changes.Get(context))
        {
            str = string.Format("User - {0}  Comment - {1}", c.CheckedInBy, c.Comment);
        }
        context.SetValue<string>(this.changeSet, str);
    }
}

Obviously this is very basic stuff at the minute, just to get it working.

Edit

Found this:

http://blogs.msdn.com/b/codejunkie/archive/2010/09/02/custom-build-activity-for-tfs-2010-to-send-email-with-build-details-part-1.aspx


In the DefaultTemplate there is at the end an activity called AssociateChangesetsAndWorkitems which calculates the changes and stores the information in the associatedChangesets variable. You can use this information to sent your email.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜