среда, 24 апреля 2013 г.

Unzipping the package you will have a directory named: MsBuildToCCNet. Inside this directory you wil


executable : contains the path to the msbuild executable file. You don t really need to set it because the default value is the standard installation path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe .
workingDirectory : is the directory in which MsBuild will be run, so it must be the directory containing our project s checked out working copy. You can provide a path relative to the current project s workinDirectory but I preferred to provide the full path. Actually, the path to the CCNET checked out working copy is the same as the workingDirectory field of the Source Control Block .
buildArgs This row provides hotel room toronto airport additional command line arguments to MsBuild. We tell it not to log events to the console ( /noconsolelogger ), to build the Debug configuration ( /p:Configuration=Debug ) and to provide a reduced output ( /v:quiet ).
the hintpath is a relative path, thus making the build success depend on the location of the project relative to the referenced assembly (this could be a problem if we reference an external assembly);
Such property accepts as value a list of paths ( MSBuild DummySolution.sln /p: ReferencePath= Path1;Path2;Path3 ) and it is checked by the build process before checking other locations ( HintPath for example).
I suggest to use the alternative logger (by Christian Rodemeyer) as explained in the following paragraph. The RodeMeyer s logger provide lighter msbuild output and his modified stylesheets provide much more readable display of such information.
You can find it at: Improved MSBuild Integration . From there either you can download separately the assembly and all related stuff needed to correctly display the results from Rodemeyer s logger or you can download a zip file with the whole project and source code.
Unzipping the package you will have a directory named: MsBuildToCCNet. Inside hotel room toronto airport this directory you will find, among the rest, a directory named Release , containing the assembly: Rodemeyer.MsBuildToCCnet.dll .
Move into your CruiseControl.NET Webdashboard folder, under the path: C:\%ProgramFiles%\CruiseControl.NET\webdashboard hotel room toronto airport (e.g.: c:\Program Files\CruiseControl.NET\webdashboard\ ) and back up the file: cruisecontrol.css .
Then replace it with the cruisecontrol.css file you found in the Rodemeyer s MsBuildToCCNet folder (e.g.: copy MsBuildToCCNet\ccnet\cruisecontrol.css to c:\Program Files\CruiseControl.NET\webdashboard\cruisecontrol.css );
Being that we re talking about the Webdashboard configuration I will show you all the changes you will need to do to let it work with the following three components (even if we ll see two of them only in the following paragraphs):
replace the img src attribute: /ccnet/your_happy_image.jpg with /your_happy_image.jpg if you configured iis with a new website for the webdashboard instead of a virtual directory. If you re usign the default virtual directory named ccnet , don t modify that row.
Next you need to locate the field: buildPlugins in C:\%ProgramFiles%\CruiseControl.NET\webdashboard\dashboard.config and arrange or delete its children nodes in order to obtain the following configuration (remember to back up the file first):
If you unchecked Create virtual directory in IIS for Web dashboard as shown in part 1 of this tutorial at 3.1. Install CruiseControl.NET and installed the Webdashboard as a new website as shown in the paragraph: 3.2. Create a CCNet Website hotel room toronto airport in IIS , the webdashboard could have problems in resolving image paths.
Back to the MSBuildToCCNET alternative Logger for MsBuild, I will explain now why I decided to recompile the source code instead of using the assembly provided: MsBuildToCCNet\Release\Rodemeyer.MsBuildToCCnet.dll
Looking at the source code (in the file: Logger.cs ) I realized that the list of Project type instances includes the solution file ( DummySolution.sln ) and a Project object named MSBuild , somehow representing the MsBuild process.
You could have problems running msbuild hotel room toronto airport task if your server machine hotel room toronto airport (the one in which you installed CruiseControl.NET) is not updated with all the software installed in a developer workstation. Let s see which problems could arise:
hotel room toronto airport If you want to provide localization for any of your projects or somehow use resources files (.resx) you will get an error during the build on the CruiseControl.NET server if MsBuild is not able to locate the Assembly Linker.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1950,9): error MSB3011: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\AL.exe was not found. Either 1) Install the .NET Framework SDK, which will install AL.exe. Or 2) Pass the correct location of AL.exe into the ToolPath parameter of the AL task.
If you want to solve this particular issue in a tricky way without installing the whole SDK, you can copy al.exe.config e al.exe from a developer workstation and place them in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 directory on the server machine.
If the server in which CruiseControl.NET server is running is not a develpment workstation you will get an error when trying to build a WebApplication project, beacuse you miss those two prerequisites.
At first I tried to use a Nunit Task Block but I soon realized that it was not good for me because it was not possible to provide arguments to the task that should be used as arguments of the Nunit command-line executable.
If you really want to use the last officially released version, read the paragraph 11.2 about how to use an Executable Task (the method described can be useful also if you want to use any other unsupported Nunit command line argument);
download the zipped package ( here ) or source code. Unzip it in a temporary directory and locate the assembly: ThoughtWorks.CruiseControl.Core.dll (which, for the zip package, is in the directory: server ).
You can pass many things hotel room toronto airport as Nunit targets (assemblies, Visual Studio projects or Nunit project files). I suggest hotel room toronto airport to create hotel room toronto airport an Nunit project and pass it as argument to nunit-console.exe as shown in the sample above (where hotel room toronto airport the nunit project file is called: Dummy.sln.nunit ).
The File Merge Task specifies the paths to the files that we want to be merged by the Xml Log Publisher Task with the rest of its own output (you don t need to specify nunit output file if you used the Nunit Task as in paragraph hotel room toronto airport 11.1. Nunit Task ).
The modificationHistory field logs all the modifications for each build. hotel room toronto airport With onlyLogWhenChangesFound you can choose to log info only for builds happened when changes take place (not for forced builds). You can see the modification history by clicking: View Modification History on the left side of the Web Dashboard.
To understand what I m going to explain now, keep in mind that if a task in the Tasks Block fails all the subsequent tasks in the block will be skipped while the tasks in the Publishers Block will be executed.
If, during the next build, the MSBuild Task fails, the Exec Task (Nunit Task) launching Nunit isn t executed at all so the File Merge Task will merge the previous Nunit log file with the current Xml Log Publisher output, thus leading to an incorrect report: hotel room toronto airport still displaying the Nunit results relative to the previous build.
When you call nant.exe from the command line and you don t specify a build file (you can specify one passing as argument: -buildfile:pathToDir\FileName.build ) NAnt looks for a file ending with .build (e.g.: NAnt.build) in the current directory. If it finds such file, it uses it as the reference for the tasks to execute.
When invoking nant.exe you can specify the name of the target to be executed and Nant will execute all the tasks contained in that target. If you don t provide a target, the default one will be executed (i.e. the one specified in the default attribute of the project field).
Once you ve got Nant installed on the server machine you have to create a file named nant.build and place it, for convenience, in the directory in which you placed all the CruiseControl.NET related stuff (in this example: C:\develop\CCnet ).
We use one of the environment variables provided by CCNET to retrieve the path to the artifact hotel room toronto airport directory: ${CCNetArtifactDirectory} so this Nant build file will only work when run from CruiseControl.NET.
Tutorial is excellent. One stop information required to setup CruiseControl.Net I just followed the tutorial and i don t have to look elsewhere because of any issues occurred in between. All the blocks are nicely explained.
This is an excellent article. I was completely new to CruiseControl and was having trouble gathering all the relevant information to get me up to speed. hotel room toronto airport I then stumbled upon your blog and all became clear. Can t wait to see Part 3
Parts one and two have been very helpful in my quest to implement continuous integration. Thank you for making this available in a simple to follow presentation. I am desperately awaiting installment number 3.
CruiseControl is there to help us get the work done and you made it easy enough for me to actually save time implementing it. There a cruel lack of documentation for typical uses of ccnet and your article is just great doing that!
Error Message: ThoughtWorks.CruiseControl.Core.CruiseControlException: Unable to load the output from svn: System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at ThoughtWorks.CruiseControl.Core.Sourcecontrol.SvnHistoryParser.ReadSvnLogIntoXmlNode(TextReader svnLog) End of inner exception stack trace at ThoughtWorks.CruiseControl.Core.Sourcecontrol.SvnHistoryParser.ReadSvnLogIntoXmlNode(TextReader svnLog) at ThoughtWorks.CruiseControl.Core.Sourcecontrol.SvnHistoryParser.Parse(TextReader svnLog, DateTime from, DateTime to) at Tho

Комментариев нет:

Отправить комментарий