Building NMS

Currently our main build tool for NMS is NAnt

Setup For *NIX Users
  • Install Mono
  • On some operating systems (e.g. OS X), you may need to point the PKG_CONFIG_PATH environment variable at the mono packages
    Excerpt from ~/.bash_profile
    export PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/:${PKG_CONFIG_PATH}"
  • Depending on your installation of Mono, you may need additional steps to get NAnt going on OS X. The more recent versions of the Mono installer for OS X seem to set things up properly. However, if you are having problems running NAnt, try the following:
    • download the binary of NAnt
    • create a script file called nant
    • chmod a+x nant
    • put the following into the script...
      #!/bin/sh
      exec /usr/bin/mono /path/to/nant/NAnt.exe "$@"

       

Thanks to the hints from this page.

Building NMS with Nant

To build the code with Nant type the following

cd activemq-dotnet
nant

 

Running the Unit Tests

The unit tests depend on an ActiveMQ broker running on tcp://localhost:61616 so that the test cases can connect to ActiveMQ and send and receive messages etc.
So if you have a distribution of ActiveMQ, run the broker first before building OpenWire.Net


 
If you want to run a build with the unit tests (assuming you have a broker running) then type

nant test

 

Building NMS using Maven 2

Its a little in a stake of flux as we write but ultimately we'd prefer to use Maven to build NMS as then we've a single tool for creating distros & doing builds etc.

You can use the Maven C# plugin to build the code if you have Maven 2.0.2 or later installed.

First you need to tell maven the location of the .NET enviorment and where to get the Maven C# Plugins. To do that you need to edit your ~/.m2/settings.xml so that it looks like the following. This file works on OS X - for other platforms use the correct value of dotnet.home for where Mono/.Net is on your machine.

<settings>

   <profiles>
     <profile>
      <id>default</id>
         <properties>
           <dotnet.home>/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/1.0</dotnet.home>
         </properties>

          <repositories>
              <repository>
                <id>maven-csharp</id>
                <name>maven-csharp</name>
                <url>http://maven-csharp.javaforge.com/repo</url>
               </repository>
               <repository>
                  <id>codehaus-snapshot</id>
                  <name>CodeHaus Snapshot Repo</name>
                  <url>http://snapshots.maven.codehaus.org/maven2</url>
               </repository>
           </repositories>

           <pluginRepositories>
                  <pluginRepository>
                    <id>maven-csharp-plugins</id>
                    <name>maven-csharp</name>
                    <url>http://maven-csharp.javaforge.com/repo</url>
                  </pluginRepository>
           </pluginRepositories>

     </profile>
   </profiles>

  <activeProfiles>
     <activeProfile>default</activeProfile>
 </activeProfiles>

  <pluginGroups>
    <pluginGroup>com.javaforge.maven-csharp</pluginGroup>
  </pluginGroups>

</settings>

Once that's done you only need to:

cd activemq-dotnet
mvn install

IDE Tips

If you are on windows then you probably want to use Visual Studio; we highly recommend using ReSharper as well, - its a shame there is not a distro for OS X and Linux .

Using X-develop to edit C#

If you are on OS X we recommend the use of X-developfor editing, refactoring and running the code.  Just tell it to load the activemq-dotnet.sln file and X-develop should be ready to go.

Using Eclipse to edit C#

You can use Eclipse as your IDE to edit C# code.

If you want to use Eclipse there are the following two C# eclipse plugins we are aware of

We tend to use BlackSun as it has auto-format and outline view support along with compiler warnings (though you might want to change the default font size).

Graphic Design By Hiram