Configure TFS 2012 to Build All Solutions Under Directory - tfs

To prevent unexpected build breaks and test failures, We have been using gated check ins. This works very well for our core solutions, and has helped improve our quality.
As part of our overall architecture, we have a certain section of our code with many micro-services, each of which is a new solution. New solutions are added to this part of the code base regularly. These are important parts of the system, and I need to make sure they get compiled as part of a gated check in without the chance for developer error.
Is there a way to configure TFS to find ALL solutions under a certain path and include them in a gated check in build?
Thanks

Not without modifying the build process template, which is almost never a good idea. The new build system in TFS2015 does allow that, however.

TFS 2015 vNext builds allow wild cards to search for all solutions. I haven't had success getting this to work with Visual Studio build steps, which you would need, but it works well with NuGet Installer and other build steps. We will not see gated builds in vNext builds until we get update 2 see TFS feature timeline

Related

Migrating a build definition from TFS to VSTS

I've been tasked with migrating a build from TFS to VSTS, I've used TFS from a developer point of view, however I've never created builds. Can anyone give me any advice where to start, good websites, tutorials, tools that might help, anything that might catch me out etc, basically my knowledge on this is very limited so anything would help. I've no doubt there must be somebody out there who can say we've done this, here is what we did...the new VSTS build will need to be a copy of the TFS build however some analysis needs to be done as the build process is old and certain parts may not be necessary. Thanks in advance!
Migrate New Vnext build definition from TFS to VSTS
If you want to template your builds or move them from TFS to VSTS, you could also use the REST API's to perform this. Details please refer this blog: HOW TO MOVE BUILD DEFINITIONS IN TFS TO OTHER PROJECTS USING THE REST API
Another example shown here. It shows how to get the JSON response of a build definition and again using the same reference to make a new one in the project you desire.
Migrate Old XAML to New Vnext build definition from TFS to VSTS
Unfortunately, there will not be any automated conversion processes. The new builds are based on a different architecture and run on a completely different system. And you can use both the new builds and agents alongside your XAML builds, controllers, and agents.
If you have heavily customized XAML builds and custom activities, you
can continue using those builds until you are ready to port your
business logic into scripts that can run in the new builds.
You should also take a look at these series of articles by jessehouwing devoted specifically to the case like yours.
About how to create a build, you could refer this tutorial from MSDN.

How can i get Team City builds to show up in TFS's build explorer

So here's the setup we have right now
1) We use TFS2013 for our code repository
2) We use TeamCity to do our builds
3) we have our tests created in CodedUI
From what I've read online is that for the CodedUI tests to run automatically, they need a build to reference. However, since we are using Team City to do the builds, our Build Explorer in TFS is empty. Switching off of Team City for builds is a no, so I'm trying to find a way to have the builds appear in the Build Explorer so I can have the automated tests run via MTM.
TL;DR: I need to get the Team City builds to appear in the TFS Build Explorer.
I saw this question, but it was for 2010, so I'm hoping it's changed since How do I make a TeamCity build appear in the TFS Build Explorer?
It can be done using the API. You could use the following blog post as a starting point to create an app that records in TFS the results from your TeamCity build. Then you could run your app as part of your TeamCity build.
http://blogs.msdn.com/b/jpricket/archive/2010/02/23/creating-fake-builds-in-tfs-build-2010.aspx
Update: There are however downsides. Some capabilities of ALM are only available if the build is done in TFS. You loose Test Impact Analysis, relationships between builds and Work Items, identification of Verifiable Bug fixes, roll up for release management of release contents.
TF Build is more than just orchestrating a compilation, it is the glue that knits your ALM strategy together and you will not be able to amortize the realm value in TFS without builds in TF Build or a whole lot of custom work.
Sorry, it's not possible. Team Explorer is designed to show you Team Builds.

How can I control the order of builds in TFS 2010 when common library is checked in?

I have a TFS 2010 with some projects and a common library used in 5 of them. We use VS 2013 and we have Rolling Builds enabled in most if not all build definitions. When the common library is checked in, all of the projects referencing it are recompiled - but the order is poor, the most commonly used project is compiled as the last one. Is there a way to change that so it gets compiled first?
This question hints at a lot of problems and possible solutions. The simplest answer is probably to just add more build servers to run all the builds in parallel.
Otherwise you need to consider turning off rolling builds and writing your own build scheduler. That or other strategies such as building the DLL once and checking it in as source to the other builds or running the build on a branch that is outside of the other 5 builds and merging the source into those builds when they want to pick up the change.
If you are otherwise happy with how things are now and don't want to do a lot of work to solve the problem.... then just scale out your build farm with additional agents.
There's a "Priority in queue" on the build definition, but it sounds like you might want to change your solution's > Project Dependencies' > Build Order?

Stylecop Checkin Policy VS2012, TFS2010

We have StyleCop as part of the project and every time we compile, Stylecop is checking the code. But we already have 100K+ lines of code and it only grows every day. So rebuild of the solution is taking longer and longer than 20 seconds already. I think that the worst part of it is Stylecop.
So we are thinking of the way to remove StyleCop from compilation process, but have it as check-in policy for TFS. I have found 2 projects: SourceAnalysysPolicy and StyleCopPolicy. But neither seem to support VS2012 and numerous posts online suggest they do not work in VS2012.
I can slap StyleCop as a step into our build server (TeamCity), but then we'll have a lot of false failed builds - not really a solution.
I was hoping to have to force all check-ins in TFS to be gated check-ins and run stylecop there via MSBuild script: if no violations - actually check-in and pass control over to TeamCity. If there are violations - warn the developer and not check-in. But I've no idea if that is possible in TFS2010 and how to implement it.
Any other ideas?
I know it's an older post but I just released a check-in policy for Visual Studio 2013. I don't know if you already using VS2013 but take a look at this extension. If you want VS2012 support, you can add an issue. If there are enough votes I will add support for it.
https://stylecopcheckinpolicy.codeplex.com/
As a solution to this problem, we have Stylecop sitting on the build server and checking the rules on every check-in. We initially did have a lot of failed builds because of the stylecop rules, but after a while everybody learned all the rules and got used it. And last 2 months we had no failed builds because of Stylecop. So it all the matter of discipline.

How do I notify TFS of build stats?

I am told TFS can accept data on build/test metrics from 3rd party continuous integration tools. Does anyone know how this works or have any good links for me? My google-fu seems weak today and I cannot find any info on this. We would like to have a short powershell script or app run at the end of the build and send all known metrics up to TFS so it could show up in certain reports. I actually would like things that (I think) should already have space for in the data warehouse for TFS BUild Server, but I will be using CC.NET. I am thinking build name, result (Pass/Fail), Number of Warnings, Number of Errors, Time, UnitTests Run, UnitTests Passed, Code Coverage, FxCop resultsThanks.
I'm afraid that there is not a ready made integration that does this yet. The plug-in that links CC.NET to TFS is available over at CodePlex but this just lets CC.NET use TFS for version control and doesn't allow the results of the builds to be published back into TFS.
To get the data into TFS from CruiseControl.NET you have a couple of options. You could write your own custom TFS Data Warehouse Adapter which is complex but ultimately flexible or you could use a combination of the Team Build API and a little bit of vodoo to push data in to the TFS Build store that would also get pushed into the TFS Data warehouse. However, this would be limited in TFS2008 as you would only be able to push data about the build and the unit tests but not things like Code Coverage.
That said, pushing data from CC.NET to TFS is something that I originally wanted to do. However in TFS2008 the built in build system was so good that I switched from using CC.NET to trigger the builds to using TFS to trigger and manage the build. This had the advantage that all the stats stuff was taken care of automatically (and the built in UI in Visual Studio). Because I moved to TFS2008 I then lost the motivation to get the CC.NET stuff built.
If anyone wanted to contribute a TFS build result publishing feature to the CC.NET integration then feel free to join the project on CodePlex - I would love to have any help going.

Resources