Project

General

Profile

Development Environment

Below is information regarding what you'll need if you want to modify or develop NSIA. You can use whatever IDE you like, or you can use a preconfigured instance of Eclipse.

Compiler Requirements

NSIA requires Java JDK 6 (1.6) in order to compile successfully. It will not compile on earlier versions of Java (including Java 1.5).

Build Directory

The build script excepts that the output directory of the build script will be /tmp/java. Failing to the set the correct build path will cause the build script to fail indicating that it cannot find the directory to create the build.properties file.

Directory Structure

Below is a description of NSIA's source-code directory structure:
Path Description
bin The location that the binaries and packages are placed
tmp The location where temporary files are placed (like Java compiled code)
var The location where the application database is stored when NSIA is executed (potentially for debugging)
doc Various documents that are distributed with NSIA
dev Various related to development that are not source-code
etc Location for configuration files distributed with NSIA
lib Libraries distributed with NSIA
src NSIA source-code

Libraries

Make sure that the libraries (under the /lib directory) are on the classpath. Additionally, JUnit 3 is required for the unit tests. Note that you will get errors if you link to JUnit 4 as opposed to JUnit 3.

The ant tasks require the following libraries to work (must be added in Eclipse under Window --> Preferences, Ant --> Runtime):

Library Purpose Source
svnant.jar Used for building the NSIA.jar file (populates the archive with the build info) http://subclipse.tigris.org/svnant.html
svnClientAdapter.jar Required by SVN Ant http://subclipse.tigris.org/svnant.html
svnjavahl.jar Required by SVN Ant http://subclipse.tigris.org/svnant.html
jdeb-0.8.jar Used to make the Debian packages http://vafer.org/projects/jdeb/
commons-compress-1.0.jar Required by jdeb http://commons.apache.org/compress/download_compress.cgi
nsisant-1.2.jar Needed to make the Windows installer http://nsisant.sourceforge.net/

Build Script

NSIA includes an Ant task for handling various development related functions. You'll need to have the svnbinclean run every time a build occurs so that SVN does not think that the java-bin scratch directory is part of the repository.

Build Properties

The build script uses a local build properties (dev/local.properties) that sets variables that dictate how the build process will be performed. The local properties file overrides the default properties file (in dev/default.properties). Below are the attributes that are can be used:

Property Example Description
value.build.version 0.9.2 Current version of the application (used when creating the Debian package)
value.build.debianpackage.directory build/dpkg Directory to use as the temporary directory for building the Debian package
value.build.makensis.directory C:\\Program Files\\NSIS Directory where makensis exists
value.build.workingcopy.directory /home/luke/workspace/nsia Directory where the working copy of NSIA exists (this is the root of directory you checked out of SVN)
value.build.licensekey 1111-2222-3333-4444-5555 License key to be used for downloading definitions that will included with the NSIA package
value.test.licensekey 1111-2222-3333-4444-5555 License key to be used for the test cases to determine if NSIA can download definitions correctly.

Creating Packages Using jDeb and NSIS (included as an Ant task)

The project includes a build target for creating Debian packages using jDeb and an Windows installer using NSIS. For the build script to work you must add the jDeb, Apache commpress and the NSISAnt library to the Ant classpath. To do this in Eclipse, go to Window --> Preferences, Ant --> Runtime. Select "Global Entries" in the Classpath tab and then select "Add External JARs...". Add the jdeb-0.8.jar, Apache commons compress (commons-compress-1.0.jar) and NSIS Ant Jar files.

Note that you will need to the specify the path to makensis in your sbin/local.properties file, below is an example:

value.build.makensis.directory=C:\\Program Files\\NSIS

Finally, you'll need to install the NSIS service control manager plugin in order to create the NSIS package (since the Windows installer needs to be able to manage services).

"Access restriction: Class is not accessible due to restriction..."

Eclipse may not let NSIA compile giving the message "Access restriction: Class is not accessible due to restriction on required library". This issue is due to an Eclipse setting. To fix it, change the "Forbidden reference" setting to "Ignore"; this setting is under "Errors/Warnings":

Project_Access_Restriction.png View (89.7 KB) Luke Murphey, 05/07/2010 09:29 PM

jdeb-0.8.jar - jDeb Java archive 0.8 (79.1 KB) Luke Murphey, 07/27/2010 11:24 PM

commons-compress-1.0.jar - Apache commons compress Java archive 1.0 (140 KB) Luke Murphey, 07/27/2010 11:24 PM

nsisant-1.2.jar - NSISAnt Java archive 1.2 (4.44 KB) Luke Murphey, 07/29/2010 12:49 PM