This documentation assumes IntelliJ 6.0 or higher, and the sample projects are built using IntelliJ 6.0.
Pre-made IntelliJ 6.0.5 project files can be found here. Before using these project files, you must configure IntelliJ with a JDK named "1.6". One way to do this is to create a new IntelliJ project and then add JDK 1.6. For example, walking through the first few steps to Create a new IntelliJ project will allow JDK 1.6 to be added, and then you can cancel the project creation.
This zip contains 3 files:
OpenIRIS.ipr and OpenIRIS.iws are the main module files.
OpenIRIS.iml is the project file.
settings.jar is a sample preference settings you can import into IntelliJ (From File->Import Settings..). Note that these settings contain XSD file paths in Resources that assume IRIS is checked out to c:\dev\openiris\iris. These paths can be changed by editing them in IntelliJ's Resource settings.
To use these files, they assume that IRIS is checked out to c:\dev\openiris\iris. Copy the file "OpenIRIS.iml" to the "iris" directory, and copy the files "OpenIRIS.ipr" and "OpenIRIS.iml" to the "openiris" directory. Then double-click "OpenIRIS.ipr" to launch IntelliJ.
Note that it is possible to change the root location of the IRIS directory by editing "OpenIRIS.ipr" in any text editor. Find the following lines and change both "fileurl" and "filepath" to be the location of OpenIRIS.iml. It is not necessary to edit the iml file.
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://C:/dev/openiris/iris/OpenIRIS.iml" filepath="C:/dev/openiris/OpenIRIS.iml" />
</modules>
</component>This default project file already sets up the correct source folders, libraries and also ommitts all output directories so IntelliJ will not synchronize with build output.
Note that we do not recommend building IRIS in IntelliJ because it is not necessary and our build process is precisely defined using Ant. IntelliJ has support for invoking Ant from the "Ant Build" margin button to the right of the IntelliJ frame. Once this frame is open, click the + button and select the "iris/src/build.xml" file. Then right click on "calo-lsi-iris" and select "Run Build" as shown in the following image:

It is also possible to add plugin-specific builds in a similar manner by clicking the + button and selecting the plugin's src/build.xml file. Building plugins independently saves a lot of time because the top-level IRIS build can take a while. The general idea is that a developer only needs to build IRIS once from the top-level and from then on build the plugin independently.
From IntelliJ choose "File->New Project...". This will bring up the following dialog:

Change the "Name" to "OpenIRIS". The project file location can be any location. The next dialog will ask for the compiler output path. In general, we don't recommend compiling the source in IntelliJ for reasons stated below in this document. So, just accept the default and click "Next".
Next IntelliJ will ask what JDK to use in a dialog as follows:

The first time running IntelliJ this dialog might have JDK 1.5 configured. To switch to JDK 1.6, click the "..." button next to the "JSDK Home Path" field and select the location for JDK 1.6. Then change the "Name" to be "1.6". Note that this will change IntelliJ's default setting to now use JDK 1.6 always. If you plan on using IntelliJ in other projects that use JDK 1.5, then alternatively you can cliek the "Add..." button to add a new JDK and configure IntelliJ to know about both JDK 1.5 and 1.6
In the next dialog, keep the default setting to create a single module project and click Next.
IntelliJ will then ask for the module content root. Point it to your root iris folder from the CVS checkout and then click Next:

At this point IntelliJ will automatically scan for all source folders. Keep the default settings and click "Finish":

Now the source is in IntelliJ and can be browsed. For example, you can type "Ctrl-n" and quick search for a class. However, when viewing source and debugging IntelliJ needs to know about the third-party libraries that IRIS uses. It is also recommended to tell IntelliJ to ignore output folders for IRIS. To configure these libraries, from the "Project" window (hit Alt-1), right click on "OpenIRIS" and choose "Module Settings...". In this dilaog you can add mofule libraries and exclude output directories.
We recommend the following preference settings and plugins for IntelliJ (Preferences can be set from File->Settings):
Under "General" settings, uncheck "Synchronize files on frame activation". This gives the developer direct control on synchronizing files and also saves time. To synchronize manually, press the button in the IntelliJ toolbar which has two arrows (third button in).
Under "Editor->Appearance Tab", set IntelliJ to show line numbers.
The "Copy as HTML" plugin is very useful when sending code fragments around. This can be loaded from the "Plugins" window under IntelliJ settings.
It is recommended to run IRIS in Debug mode and then attach IntelliJ as the debugger. It is not recommended to try and build IRIS inside IntelliJ and run from IntelliJ. To run IRIS in debug mode, execute "iris.bat -debug" from the iris/bin directory. This configures IRIS to run on debug port 5005 with suspend disabled. To change the port or suspend policy, edit iris.bat and change the following line:
set REMOTE_DEBUG=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
In IntelliJ, click the small drop-down list for debug configuration and choose "Edit Configurations...":

Next click the + button and select "Remote":

Change the Name to "IRIS" and hit the "Ok" button to exit the dialog. Next run "iris.bat -debug", then hit the green arrow button next to the drop-down list in IntelliJ:

This will connect IntelliJ to IRIS for debugging. For more information on ow to Debug using IntelliJ, see the IntelliJ help.