TFS edit build log using custom activity - tfs

In TFS while we fire a build. the build log is generated with all the details. like testcases result, code analysis etc...
How do I add some more details in build log? Which API need to be used to edit build log from custom activity?
Please provide me some article links if possible.

Related

TFSBuild - Saving OpenCover/ReportGenerator output for each tfs build on tfs2013

I'm currently trying to run custom code coverage using OpenCover and to generate output in easily readable format using Report Generator. The final output of these two applications is xml files.
I am running these applications using InvokeProcess activity in build definition to get their outputs but the output are currently present only in my build controller's Build binaries folder.(ex:C:\Builds\1\project_collection\build_definition\bin)
I want to save these files per build in some location and to retrieve them back when needed by clicking on a hyperlink present in Build summary similar to how built-in code coverage results are displayed in tfs build summary.
I tried this question but as you can see there is no correct answers listed there.
So how do I copy these output files to some remote location and refer them in my build summary to retrieve them?
Copy outputs to some remote location is similar to copy outputs to drop folder. You can simply specify the drop location in Build Definition--Build Defaults--Staging location. Check the screenshot below:
Refer the binaries in your build summary to retrieve them, you can add a new activity “WriteCustomSummaryInformation” to your build process template, which has several properties that allow you create a new Section and add text to that section. Check this blog for more information: http://blogs.msdn.com/b/jpricket/archive/2012/06/07/tfs11-rc-simple-build-summary-customization.aspx
As I also answered here Display OpenCover results in TFS 2015 build Summary, it is now possible to customize the build results in TFS 2015.
I managed to upload the OpenCover xml result file as 'testrun-attachment' via REST-interface and got the pieces in place to show the summary values on both the build summary tab and on its own extended “build-results-view”.

In a TFS 2010 build summary, how do I a show a link to the logs from a custom MSBuild task?

In my TFS 2010 build definition, I call MSBuild on my own custom my.targets MSBuild project. It does all the compilation, testing, etc. that I need. Its log file is specified, as is a log drop location, and the log appears properly in that place. However I can't see it in the TFS Build Summary report. The "View Log File" link is grayed out. It seemed to work when the project I was building was a ".sln" file. What magic voodoo is baked deep in to the heart of the common MSBuild files to make this log link work properly, and how can I reproduce it?
You may find your answer in these posts from Jason Prickett:
TFS2010 – Changing The Way Build Information IS Displayed
TFS2010 – Customizing the Build Details View – Summary View
Important to note is that the MSBuild Log File will only appear if you enabled inside the build definition to copy output to the Drop Folder. If that option is disabled, the link will not appear in the build log view.

integrate dotCover with TFS

Is there a tutorial somehwere or can somebody explain how to integrate dotCover with TFS? I want to run dotCover (probably the console runner?) as part of the team build process and would like to generate a report that is integrated in the TFS build report.
Running dotCover itself will be easy enough. Simply add an InvokeProcess activity to the build workflow and call the appropriate command line options. I've got a blog post showing how this is done (calling the VB6 compiler in my example) but it should show you what you need to do.
The hard part will be integrating a report into the TFS build report. All you'll really be able to do is slightly customise the log - see Ewald Hoffmans blog post (and series) on customising the build if you want to do this.

Custom Build Summary entries in TFS Team Build

I have succesfully added a custom build step to my TFS Team Build script, however, after my build fails (as intended by my custom build step), I want to add a URL to my custom failure report in the "Summary" section at the top of the build report.
This is the section that says...
"Build Name:"
"Requested by:"
"Team project:"
etc
How can I do this?
This cannot be done with the current versions of Team Foundation Server. The only thing that you could possibly customize in TFS2008 is to change the Build Log location to point to a URL that contains the information you are interested in along with a link to the actual build log should somebody want to look at the full details.
For more information on updating the log location, take a look at the following blog post of mine:
http://www.woodwardweb.com/teamprise/000415.html
It looks as if this cannot be done. See the first part of this post for confirmation.
http://blogs.blackmarble.co.uk/blogs/rfennell/archive/2008/12/22/update-in-using-stylecop-in-tfs-team-build.aspx
You can add it to IBuildInformation to access programmatically (if say, you had a custom dashboard to show your build status).
Vaccano

How can I create custom sections in TFS build reports?

I know how to add custom BuildStep task; however, it would be nice to create a new section, similar to the Summary and Build Steps sections.
We are selectively deploying the files on a successful build based on the difference between the workspace and destination environment. We do create an HTML and XML log of the files we move and the files they overwrite. It would be nice to add a section to the build report to display this information.
Something like this:
image http://www.freeimagehosting.net/uploads/71360b417a.png
Any ideas?
Currently Microsoft do not provide any mechanism for extending the build report in VS 2008 or VS 2005. They are doing heavy changes to the build report for TFS 2010 however and I know that customization of that report has been a much requested feature but I'm not sure what the status is of that yet.

Resources