Project

General

Profile

Development Environment » History » Version 21

Luke Murphey, 01/10/2011 07:52 AM

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 20 Luke Murphey
h2. Build Directory
10 20 Luke Murphey
11 20 Luke Murphey
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.
12 20 Luke Murphey
13 15 Luke Murphey
h2. Directory Structure
14 15 Luke Murphey
15 15 Luke Murphey
Below is a description of NSIA's source-code directory structure:
16 15 Luke Murphey
|_.Path               |_.Description                                                               |
17 15 Luke Murphey
| bin                 | The location that the binaries and packages are placed |
18 15 Luke Murphey
| tmp                 | The location where temporary files are placed (like Java compiled code)  |
19 15 Luke Murphey
| var                 | The location where the application database is stored when NSIA is executed (potentially for debugging)  |
20 15 Luke Murphey
| doc                 | Various documents that are distributed with NSIA  |
21 15 Luke Murphey
| dev                 | Various related to development that are not source-code  |
22 15 Luke Murphey
| etc                 | Location for configuration files distributed with NSIA  |
23 15 Luke Murphey
| lib                 | Libraries distributed with NSIA  |
24 15 Luke Murphey
| src                 | NSIA source-code  |
25 15 Luke Murphey
26 1 Luke Murphey
h2. Libraries
27 1 Luke Murphey
28 17 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.
29 17 Luke Murphey
30 17 Luke Murphey
The ant tasks require the following libraries to work (must be added in Eclipse under Window --> Preferences, Ant --> Runtime):
31 17 Luke Murphey
32 17 Luke Murphey
|_.Library                |_.Purpose                                                              |_.Source |
33 17 Luke Murphey
|svnant.jar               | Used for building the NSIA.jar file (populates the archive with the build info)  |         http://subclipse.tigris.org/svnant.html |
34 17 Luke Murphey
|svnClientAdapter.jar     | Required by SVN Ant | http://subclipse.tigris.org/svnant.html | 
35 19 Luke Murphey
|svnjavahl.jar           | Required by SVN Ant | http://subclipse.tigris.org/svnant.html | 
36 19 Luke Murphey
|jdeb-0.8.jar              | Used to make the Debian packages   | http://vafer.org/projects/jdeb/    |
37 17 Luke Murphey
|commons-compress-1.0.jar | Required by jdeb |http://commons.apache.org/compress/download_compress.cgi |
38 19 Luke Murphey
|nsisant-1.2.jar           | Needed to make the Windows installer | http://nsisant.sourceforge.net/  |
39 17 Luke Murphey
40 2 Luke Murphey
41 6 Luke Murphey
h2. Build Script
42 6 Luke Murphey
43 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.
44 6 Luke Murphey
45 16 Luke Murphey
h2. Build Properties
46 4 Luke Murphey
47 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:
48 4 Luke Murphey
49 5 Luke Murphey
|_.Property                              |_.Example                  |_.Description                                                               |
50 1 Luke Murphey
| value.build.version                    | 0.9.2                     | Current version of the application (used when creating the Debian package) |
51 1 Luke Murphey
| value.build.debianpackage.directory    | build/dpkg                | Directory to use as the temporary directory for building the Debian package|
52 5 Luke Murphey
| value.build.makensis.directory         | C:\\Program Files\\NSIS   | Directory where makensis exists |
53 18 Luke Murphey
| 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) |
54 18 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 |
55 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. |
56 1 Luke Murphey
57 11 Luke Murphey
h2. Creating Packages Using jDeb and NSIS (included as an Ant task)
58 1 Luke Murphey
59 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.
60 11 Luke Murphey
61 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:
62 11 Luke Murphey
63 11 Luke Murphey
<pre>
64 11 Luke Murphey
value.build.makensis.directory=C:\\Program Files\\NSIS
65 11 Luke Murphey
</pre>
66 7 Luke Murphey
67 21 Luke Murphey
Finally, you'll need to "install":http://nsis.sourceforge.net/How_can_I_install_a_plugin 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).
68 14 Luke Murphey
69 2 Luke Murphey
h2. "Access restriction: Class is not accessible due to restriction..."
70 2 Luke Murphey
71 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":
72 3 Luke Murphey
73 3 Luke Murphey
!Project_Access_Restriction.png!