Building NPanday

Building NPanday is quite simple and follows the typical convention for a Maven project.

Pre-requisites

You must first have any pre-requisites installed:

  • Visual Studio 2005 or above
  • .NET 2.0 runtime, or above
  • .NET 2.0 SDK, or above
  • NUnit 2.2.8 or above
  • Apache Maven 2.0.9 or above

See the Installation Guide, and particularly the information on how to Set the PATH for more information. The easiest way to do this is to run the Visual Studio 2005 Command Prompt from the Windows Start menu.

NUnit in particular must be installed and in the PATH. In some versions, you may need to include the bin\net-2.0 directory instead of just the bin directory in your PATH to get the correct test runner version.

Checking out the Source Code

You can check out the latest source code from https://svn.apache.org/repos/asf/incubator/npanday/trunk. You can also download a previous version as an archive from the web site, or from check it out from the subdirectory of https://svn.apache.org/repos/asf/incubator/npanday/tags.

For example:

svn co https://svn.apache.org/repos/asf/incubator/npanday/trunk npanday

Enabling additional Remote Repositories

NPanday has some dependencies that are not in Maven Central. In order to have them downloaded to your local repository you have to uncomment some additional repositories in the repositories section of NPanday's pom.xml, or you can add the following remote repositories to your local settings.xml.

<repository>
  <id>npanday.3rdparty</id>
  <name>NPanday 3rd-Party Repository</name>
  <url>http://repo.npanday.org/archiva/repository/3rdparty</url>
  <snapshots>
        <enabled>false</enabled>
  </snapshots>
</repository>
<repository> 
  <id>aduna.org</id>  
  <url>http://repository.aduna-software.org/maven2</url> 
</repository>

For performance reasons you should disable them again after the first successful build.

Building All with Maven

Everything in the distribution, including the Visual Studio add-in, is built using the following command:

mvn clean install

Note: On Windows Vista and Windows 7, this presently needs to be run as an administrator to build successfully, as it installs 3 libraries into the GAC.

Note: Building NPanday on Windows 64bit needs some workarounds, until NPANDAY-369 is fixed.

Once this command has completed, you can proceed to use the Maven plugins immediately. To install the Visual Studio Add-in, you will need to still run the mvn npanday.plugin:maven-vsinstaller-plugin:install command as described in the Installation Guide.

Building the Visual Studio Add-in with Visual Studio / MSBuild

If you just wish to work on the Visual Studio Add-in, it can be loaded into Visual Studio and built there. More information is available in Debugging the Visual Studio Add-in.

Building All and executing the ITs

You can also build the source code and execute the ITs. But first you have to install the ITs in your local repository using the following command:

mvn clean install

After you have installed the ITs locally, you can now build the source code and execute the ITs by using the following command:

mvn clean install -PintegrationTests

Running Integration Tests

The Maven command line plugins feature a series of integration tests to ensure that everything is working as expected. They can be obtained by checking out the source code at https://svn.apache.org/repos/asf/incubator/npanday/npanday-its/trunk.

For example:

svn co https://svn.apache.org/repos/asf/incubator/npanday/npanday-its/trunk npanday-its

From within that directory, you can run it against the latest available version of NPanday (likely the one you have just built above) using the following command:

mvn test -Prun-its

The command will indicate which version of NPanday is being used, and which tests pass and fail. It will also indicate which version of .NET SDK is installed and used by the tests - for example, if .NET 3.5 SDK is not available, tests that depend on it will be skipped.

You can also run them against a specific previous version of NPanday (which will be downloaded from the repository if needed):

mvn test -Prun-its -Dnpanday.version=1.3-incubating

When contributing fixes for issues in the Maven plugins, it is appropriate to write an integration test along with it. They are written in Java, using JUnit, and contain a sample project against which mvn is run against, and the the expected results are then verified. Existing integration tests can be used as a guide.

Cleaning the Environment

It is common under the current architecture of NPanday to get clashes between versions, so if you are developing on a different version to the one previously run, you may wish to clean up your environment beforehand. The full steps to do so can be found in the Uninstalling NPanday guide. You will need to rebuild NPanday with the steps above afterwards.

Note: Not all steps are always required. The most common source of problems is the uac directory, and in particular the rdfRepository subdirectory, and the npanday.artifacts.resolved file. These can be safely deleted at any time without affecting the system as they will be regenerated.