问题
I am fairly new to CC .NET but have used other build tools in different environments (not C#) previously.
My question is, when I choose NAnt as a Build Tool (for build scripts) & NUnit as a Test Tool (for testing) does CC .NET execute the command line for these tools with the parameters I specify in the config file?
For example I have NAnt installed for my build scripts, will CC .NET execute NAnt.exe in the NAnt directory in order to build a project or does it do it by "other means"?
Thanks.
回答1:
CC.NET has a few existing "Xsl Plugins" in the menu system.
Let's take NUnit for example.
Well, if you click the NUnit Results from the CC.NET webpage on your project's build, you won't see anything (out of the box).
Why? Because there is no NUnit xml data in the "super-duper" xml file that holds all the info about the build.
So how does it get there?
One way is to run the NUNit command line, and it will create an output xml file.
NUnit.2.5.3.exe (bunch of stuff) NUnitResults.xml
(the above isn't working code, just roll with the concept at this point, please)
So the above command line will create a file NUnitResults.xml. But even if you do that, this info isn't in the "super-duper" xml file.
CC.NET has a "File/Merge" task, that will take a standalone xml file, and "suck it into" the super-duper xml file.
After this file-merge takes place, NOW that Nunit data will be in the super-duper-xml file, and now when you click the NUnit link on the CC.NET project/build page, there will be NUnit xml-data in the super-duper.xml file, and the xsl transform will actually do something, and create some html output on your cc.net project/build page.
Does that make sense?
Here is the "take some stand alone xml and suck it into the super-duper.xml file" cc.net task:
http://confluence.public.thoughtworks.org/display/CCNET/File+Merge+Task
Here is the NUNit CC.NET task. Now, you don't have to use the CC.NET task. You can also (and the way I do it) is wire up an EXEC task in my build script and that task creates the NUnit.xml data. Aka, there are a few ways to skin a cat. But I typically stay away from the proprietary cc.net tasks when there is a different way. Why? Because if I ever move from cc.net (to tfs for example), my transition will be less painful.
http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+NUnit
来源:https://stackoverflow.com/questions/20002531/how-does-cruise-control-net-use-build-test-tools