Reputation: 14272
We currently have a "fairly" CI agnostic MSBuild script that is being built on TeamCity.
The script does the following:
I say "fairly" CI agnostic because there are a couple of places we publish content to TeamCity via the MSbuild message task.
We have now been given direction from the business to move the build and source from GIT to TFS. The last Microsoft source control I used was SourceSafe and I have no experience with TFS as a CI server. I want to know if we can keep the MSBuild script as agnostic as it currently is and still achieve the same functionality it has now.
Upvotes: 2
Views: 1009
Reputation: 22255
You can call an MSBuild script from TFS Build easily. I believe where it asks for solutions to build you can just give it any MSBuild file (don't know if I've ever specified a non-sln file) but if that doesn't work for some reason, you can do a small tweak to the TFS Build Template and use the MSBuild activity to call any MSBuild script you wish.
You can pass in dynamic parameters to MSBuild by editing the Build Template (or static parameters by editing the Build Definition).
For versioning I usually customize the Build Template to generate a Version # of the format Major.Minor.YYMM.DDRRRR where Major and Minor are arguments set in the Build Definition. YYMMDD is the date, and RRR I pull from the TFS BuildNumber Revision component (what # build for this build def today).
I use the TFSVersion custom TFS Build Activity from the TFS Community Build Extensions to update all my AssemblyInfo's, but if you already have the versioning process in your MSBuild you can just generate the desired version # in the Build Template then pass it as an argument to your MSBuild Activity.
As for publishing files back to TFS you can use a custom MSBuild Task (I'm sure one exists somewhere, but I don't have a link handy), you can call out to the tfs command-line tool, or you can do that in the Build Template (instead of MSBuild) using the provided Workflow Activities.
Upvotes: 2