Development

From Angry IP Scanner

Jump to: navigation, search

Contents

Writing plugins

See FAQ: Plugins

Contributing

Angry IP Scanner's project is hosted by the Sourceforge.net – a free hosting site for open-source projects. The source code is in the Subversion repository provided by the website.

In order to get the source code, the following command must be run (svn, the subversion client, is pre-installed on most Linux hosts and is freely available for other platforms):

svn checkout http://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk ipscan

This command will fetch the full source code of the program into local directory named 'ipscan'. The 'trunk' at the end of the Subversion URL means the main development branch of the source code (according to Subversion naming convention). If the source of particular release is required, then 'trunk' can be substituted by the release number, e.g. 'releases/3.0-beta1'.

Then, in order to build the binaries, you need only to run 'ant' in the 'ipscan' directory. Ant will use the standard build.xml script there and compile, test, and package the program for all platforms. Note: some packaging features were tested only on Linux.

The source code tree also includes the preconfigured Eclipse project for convenience. So, if the checkout was made from the Eclipse GUI (using the Subclipse plugin) or from the command-line, it can be opened as a project and run using the net.azib.ipscan.Main class.

Then, after some changes are made, a patch file can be generated either using the command-line diff program or the GUI provided by Eclipse. The patch will then be reviewed and if accepted, will be committed into the Subversion repository.

Source structure

You may refer to the README file in the Subversion repository.

Directories

  • src - the main subdirectory of the project tree, which contains the Java package structure of the source (net.azib.ipscan and its sub packages). All the source code, needed for running the program is stored there.
  • test - contains exactly the same Java package structure as src does, but is intended for unit tests and other classes, which are not needed for running Angry IP Scanner itself. Each test case Java class should have the same name as the original class under test, but with the Test suffix, for example, Feeder and FeederTest.
  • ext - for external libraries. The contents of each library's directory will depend on the original structure of that library, however, not all the original files may be included.
  • resources - textual and graphical resources to be packaged with the program.

Java packages

Angry IP Scanner source code is in the net.azib.ipscan Java package.

Dependency injection

Angry IP Scanner uses dependency injection pattern in its design, provided by the PicoContainer library, which was chosen for its lightweightness (adds about 60 kb).

PicoContainer encourages constructor injection, i.e. classes declare all required dependencies in their constrcutors, and container then resolves these dependencies (mostly) automatically, so that the classes themselves don't have to worry where these dependencies come from. This eases both development and unit testing of the code. Components are registered in the ComponentRegistry class.



Personal tools