|
|
How To Integrate Regionerate With NAnt,
published Saturday, June 2, 2007
Regionerate can easily run as part of your NAnt build machine. Warning: boring details ahead.
The installation package comes with an assembly called Regionerate.Presentation.Addins.NAnt.Tasks.dll which contains the Regionerate NAnt Task.
You should provide this task with a few details about what it should do, such as which projects or solutions it should run on and which Code Layout it should apply on them.
Here are the steps which should be performed in order for Regionerate to run under NAnt:
1. Tell NAnt to load the Regionerate NAnt Task assembly by adding the following element to your build file:
<target name="setup"> <loadtasks assembly="C:\Program Files\Regionerate\Regionerate.Presentation.Addins.NAnt.Tasks.dll"> </target>
2. Call the Regionerate NAnt Task called "rgn". For example:
<target name="regionerate" depends="setup"> <rgn noInfo="true" noWarn="false"> <solutions> <include name="Solution1.sln" /> </solutions> <ignoredProjects> <include name="IgnoredProjectFromSolution1.csproj" /> </ignoredProjects> <ignoredFiles> <include name="IgnoredFileFromAllProjectsInSolution1.cs" /> </ignoredFiles> </rgn> </target>
Here is a detailed explanation of the different elements and attributes you can use in this task:
rgn element - Starts the Regionerate task. rgn/layout attribute (optional, defaults to the default Code Layout) - Sets the Code Layout that will be used to apply layout within this task. rgn/noInfo attribute (optional, defaults to false) - Determines whether progress information should be displayed. rgn/noWarn attribute (optional, defaults to false) - Determines whether non-critical warnings should be displayed. Note that critical warnings will always be shown. rgn/solutions element (optional) - Regionerates solution (.sln) files. rgn/solutions/include element (mandatory) - Regionerates a solution file. rgn/solutions/include/name attribute (mandatory) - The path to the .sln file. rgn/ignoredProjects element (optional) - Ignore certain project (.csproj) files from all solutions. rgn/ignoredProjects/include element (mandatory) - Ignore a certain project (.csproj) file. rgn/ignoredProjects/include/name attribute (mandatory) - Name or partial name of a .csproj file. (e.g: "MyProj.csproj" for all projects which include "MyProj.csproj" in their file name or ".Tests" for all projects that include ".Tests" in their file name) rgn/projects element (optional) - Regionerates project (.csproj) files. rgn/projects/include element (mandatory) - Regionerates a project file. rgn/projects/include/name attribute (mandatory) - The path to the .csproj file. rgn/ignoredFiles element (optional) - Ignore certain code (.cs) files from all solutions and projects. rgn/ignoredFiles/include element (mandatory) - Ignore a certain code (.cs) file. rgn/ignoredFiles/include/name attribute (mandatory) - Name or partial name of a .cs file. (e.g: "WorkItem.cs" for all code files which include "WorkItem.cs" in their file name or "Attribute" for all code files that include "Attribute" in their file name)
3. Optionally, you may wish to check-in any modifications made with a message such as "Nightly Regionerate". Since this task is performed in a different way for every source control provider, it will not be discussed here for now. If you need help with a specific source control provider, comment this post and maybe I'll expand on it.Labels: Documentation
0 comments. Add a comment.
|
|