FOray

FOray Users
Module Users
Developers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FOray: Development Environment

Contents

Tools

The following tools are needed for FOray development:

  • A Java Integrated Development Environment (IDE) running JDK 1.5 or higher. Although it is theoretically possible to develop without an IDE, it is not practical. If you do not have a Java IDE, consider Eclipse, which is free, and suitable for FOray development (see below for details).
  • A Subversion client. Most IDEs have one built-in.
  • Ant
  • Checkstyle
  • JUnit

Configuration

The problem with configuring development environments for a team of developers is that there are differences in the local environments that must be handled flexibly. And yet, we wish to hard-code as much information as possible, to prevent each developer from needing to deal with the details of setting up the various projects, finding the libraries, configuring checkstyle, etc. To achieve these contradictory goals, FOray uses a centralized build configuration properties file and makes that file available through the local environment. This file is always named "foray-build.properties" and should be placed in a directory whose location can be found by java at FORAY_CONFIG. The FORAY_CONFIG variable can be set either in your local environment or by using the -D switch when starting up your various Java processes, including your IDE. It is usually easier to set it in your local environment.

A documented, pro-forma example of "foray-build.properties" is located in the "scripts" directory. Please be sure to set up the various properties noted there.

Sandbox

Before you can work on the source code, you will need to get a copy of it from the FOray Subversion Repository. As suggested in the repository documentation, be sure to append "/trunk" to the URL documented there. We also strongly recommend keeping your Subversion sandbox separate from your Integrated Development Environment (IDE). For example, the default Eclipse behavior is to download the code directory into the Eclipse workspace. You will generally get better results if you keep your sandbox in a separate location, and just point projects in your IDE to that sandbox.

Eclipse IDE Quick-Start

Install Eclipse.

After downloading your sandbox, open Eclipse in the workspace of your choice. Make sure you have a J2SE-1.5 Execution Environment installed. Open the "Window / Preferences menu item, then select "Java / Installed JREs / Execution Environments". Click on the "J2SE-1.5" environment, and make sure it points to a valid Java 1.5 JRE.

The easiest thing to do is to let maven import the FOray projects into your workspace. Make sure you have m2e installed as a plugin to Eclipse (it is a plugin to Eclipse, not to Maven).

  1. Run the "File / Import" menu item.
  2. Select "Maven / Existing Maven Projects".
  3. Point "Root directory" to the root of your sandbox.
  4. A list of the FOray projects will be created. Select all of the projects listed.
  5. Note the control allowing you to add the projects to an Eclipse working set. Select according to your preferences.
  6. Under the "Advanced" section, enable "Resolve Workspace projects". This will allow m2e to treat FOray projects as workspace dependencies instead of needing to build them and use them from your maven repository.
  7. Press "Finish". This will import and configure all of the FOray projects into your workspace. You should now be able to build and develop from within Eclipse.

If you intend to submit patches or commit code, please also install the following Eclipse plugins:

  • Eclipse-CS, a checkstyle plugin. After plugin installation, create the Check configuration for FOray. Open the Window/Preferences menu. Select the "Checkstyle" page. Click the "New" button. Select Type "External Configuration". Enter the name "FOray Checkstyle". (Enter this exactly so that the FOray modules will automatically attach to it). Enter the location that corresponds to your ${foray.sandbox}/scripts/checkstyle-config.xml. Click the "Additional Properties" button, and create a property "foray.sandbox" which points to your ${foray.sandbox}. (This is necessary because there is no way to tell Eclipse-CS to read your foray-build.properties file.)