Project

General

Profile

Development Environment » History » Version 16

Luke Murphey, 07/31/2010 03:21 PM

1 1 Luke Murphey
h1. Development Environment
2 1 Luke Murphey
3 1 Luke Murphey
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":http://ondemand.yoxos.com/geteclipse/rap?profiles=868129468_1269911860683718583. 
4 1 Luke Murphey
5 1 Luke Murphey
h2. Compiler Requirements
6 1 Luke Murphey
7 1 Luke Murphey
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).
8 1 Luke Murphey
9 15 Luke Murphey
h2. Directory Structure
10 15 Luke Murphey
11 15 Luke Murphey
Below is a description of NSIA's source-code directory structure:
12 15 Luke Murphey
|_.Path               |_.Description                                                               |
13 15 Luke Murphey
| bin                 | The location that the binaries and packages are placed |
14 15 Luke Murphey
| tmp                 | The location where temporary files are placed (like Java compiled code)  |
15 15 Luke Murphey
| var                 | The location where the application database is stored when NSIA is executed (potentially for debugging)  |
16 15 Luke Murphey
| doc                 | Various documents that are distributed with NSIA  |
17 15 Luke Murphey
| dev                 | Various related to development that are not source-code  |
18 15 Luke Murphey
| etc                 | Location for configuration files distributed with NSIA  |
19 15 Luke Murphey
| lib                 | Libraries distributed with NSIA  |
20 15 Luke Murphey
| src                 | NSIA source-code  |
21 15 Luke Murphey
22 1 Luke Murphey
h2. Libraries
23 1 Luke Murphey
24 1 Luke Murphey
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. 
25 2 Luke Murphey
26 6 Luke Murphey
h2. Build Script
27 6 Luke Murphey
28 6 Luke Murphey
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.
29 6 Luke Murphey
30 16 Luke Murphey
h2. Build Properties
31 4 Luke Murphey
32 16 Luke Murphey
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:
33 4 Luke Murphey
34 5 Luke Murphey
|_.Property                              |_.Example                  |_.Description                                                               |
35 1 Luke Murphey
| value.build.version                    | 0.9.2                     | Current version of the application (used when creating the Debian package) |
36 1 Luke Murphey
| value.build.debianpackage.directory    | build/dpkg                | Directory to use as the temporary directory for building the Debian package|
37 5 Luke Murphey
| value.build.makensis.directory         | C:\\Program Files\\NSIS   | Directory where makensis exists |
38 16 Luke Murphey
| value.build.licensekey                 | 1111-2222-3333-4444-5555  | License key to be used for downloading definitions that will included with the NSIA package (not currently used) |
39 16 Luke Murphey
| 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. |
40 1 Luke Murphey
41 11 Luke Murphey
h2. Creating Packages Using jDeb and NSIS (included as an Ant task)
42 1 Luke Murphey
43 11 Luke Murphey
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 attachment:jdeb-0.8.jar, "Apache commons compress":http://commons.apache.org/compress/download_compress.cgi (commons-compress-1.0.jar) and "NSIS Ant":http://sourceforge.net/projects/nsisant/files/ Jar files.
44 11 Luke Murphey
45 12 Luke Murphey
Note that you will need to the specify the path to makensis in your sbin/local.properties file, below is an example:
46 11 Luke Murphey
47 11 Luke Murphey
<pre>
48 11 Luke Murphey
value.build.makensis.directory=C:\\Program Files\\NSIS
49 11 Luke Murphey
</pre>
50 7 Luke Murphey
51 14 Luke Murphey
Finally, you'll need the NSIS "service control manager plugin":http://nsis.sourceforge.net/NsSCM_plug-in in order to create the NSIS package (since the Windows installer needs to be able to manage services).
52 14 Luke Murphey
53 2 Luke Murphey
h2. "Access restriction: Class is not accessible due to restriction..."
54 2 Luke Murphey
55 2 Luke Murphey
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":
56 3 Luke Murphey
57 3 Luke Murphey
!Project_Access_Restriction.png!