Here's a quick guide to get you started on writing your own Code Layout. Code Layouts are simply XML files which follow the Code Layout Schema.
The Code Layout Schema (CodeLayoutSchema.xsd) can be found in your installation directory. If you are using Visual Studio, the Code Layout Schema is copied during installation into your Visual Studio Schemas directory.
Here are the steps neccesary to start writing a custom Code Layout in Visual Studio:
Create a new XML file in Visual Studio (File->New->File->XML File->Open)
Type in "<CodeLayout xmlns="http://regionerate.net/schemas/0.6/CodeLayout.xsd">"(substitue 0.6 to the current version you are working with).
If you are using Visual Studio, the file should be linked to the Code Layout Schema immediatly, and you should be able to receive intellisense assistance.
If you are not using Visual Studio, or for some reason you are not getting intellisense assitance:
Open the Properties window for the XML file.
Choose "Schemas" and click on the button.
Click on "Add" and browse for the CodeLayoutSchema.xsd file under your installation directory. (typically C:\Program Files\Regionerate)
Click OK. The XML file is now validated by the Code Layout Schema.
The Code Layout Schema structure is pretty simple, I'm sure you'll manage from here.
Once you have your Code Layout all ready, you can easily load it into the Visual Studio add-in by following these steps:
Click on Tools->Regionerate Settings.
Under "Code Layout" check "Use Custom".
Hit the "Browse" button and browse for your custom Code Layout.
Click "Save".
If you are having any difficulties with the structure of the Code Layout Schema, post a comment this post and I'll expand on the topic.
Developing Regionerate comes with the costs of web hosting, caffeine and the occasional 3am pizza. If you enjoy Regionerate and would like to help keep it alive you are welcome to feed me (donate money, that is) by clicking on the PayPal button.
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:
Here is a detailed explanation of the different elements and attributes you can use in this task:
rgn element - Starts the Regionerate task. rgn/layoutattribute (optional, defaults to the default Code Layout) - Sets the Code Layout that will be used to apply layout within this task. rgn/noInfoattribute (optional, defaults to false) - Determines whether progress information should be displayed. rgn/noWarnattribute (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/includeelement (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/projectselement (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/includeelement (mandatory) - Ignore a certain code (.cs) file. rgn/ignoredFiles/include/nameattribute (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.
Contribute
I'm currently looking for good people to help me with the remaining development tasks for Regionerate v1.0. If you like Regionerate and want to be a part of it, contact me at omer at rauchy dot net.