This page contains reference information about how to build and debug the Ibator feature from source.
The Ibator feature is structured as five different Eclipse projects - a feature project and
four plugin projects. The feature project groups the four plugins together for easy
installation. The Ibator feature project is org.apache.ibatis.ibator
.
This project references the four plugin projects. The plugin projects are structured as
follows:
Plug-in Project | Description |
---|---|
org.apache.ibatis.ibator.core |
This plugin is an Eclipse library plugin for the standard Ibator JAR file. The purpose of this plug-in is to package the standard JAR and make it available to the other plugins. There is a build file in this plug-in (buildIbator.xml) that will compile the core Ibator JAR file and update the wrapped JAR files. This makes it easy to keep the plugin up to date as the core functionality is developed. |
org.apache.ibatis.ibator.eclipse.core |
This plugin holds Java support classes for the other plugins. This plugin does not contribute to the Eclipse user interface. Currently, this plugin includes classes for Java file merging, and Eclipse implementations of the Ibator callback interfaces. |
org.apache.ibatis.ibator.eclipse.doc |
This plug-in holds the documentation for Ibator. There is a build file in this plug-in (buildDoc.xml) that will build the documentation and package it for inclusion into the Eclipse help system. |
org.apache.ibatis.ibator.eclipse.ui |
This plug-in holds the Java code for the Eclipse user interface for Ibator. If you are experiencing trouble with the plugin specific features (like the integrated Ant task), then the code for those features will be found in this plugin. |
The following instructions show how to build the Ibator feature and plug-ins from the latest source in the Subversion repository. We assume that you are somewhat familiar with Subversion and the Eclipse plug-in development environment (PDE). These instructions also assume you are using Eclipse version 3.4.1. The plug-in code is not supported in versions of Eclipse prior to version 3.4.1.
At this point the projects should be successfully compiled in Eclipse. If you want to debug something in the plug-in, you will need to start another instance of Eclipse in debug mode. The following instructions explain how to do this.
Once you have the other instance of Eclipse started you should create a new Java project in the new workspace, create and fill out an Ibator configuration file, and then run Ibator. Ibator should eventually hit your breakpoint, and then you step through the code.
The following classes will likely be of the most interest in debugging:
Class | Description |
---|---|
org.apache.ibatis.ibator.eclipse.ui.actions.RunIbatorThread |
This class is a thread that runs Ibator on the selected configuration file.
You can set a breakpoint in the run method of this class to follow
the Ibator code generation process from the beginning.
|
org.apache.ibatis.ibator.eclipse.core.merge.JavaFileMerger |
This class implements the Java file merge function. You can set a breakpoint
in the getMergedSource method to follow the merging process.
|
The documentation for Ibator is integrated into the Eclipse help system.
The documentation is partially generated (Javadocs), partially copied in from the
core Ibator source tree, and partially maintained in the plugin itself.
This full documentation set is not in Subversion because it is partially generated. If you would
like to rebuild the documentation, simply execute the buildDoc.xml
file
in the org.apache.ibatis.ibator.eclipse.doc
project (an Ant build file).
The core Ibator JAR file has it's source code attached in the plugin, so you should be able to step into core Ibator methods for debug. If you have found a bug in Ibator, or would like to test an enhancement, you should modify the Ibator source code, and then rebuild the JAR for inclusion in the plugin.
If you would like to modify/enhance the Ibator core JAR, then you can create a Java project for the core JAR by following these steps:
Note that Ibator is compiled with JDK 5.0 for distribution.
If you make a change in the Ibator core files, you can use the buildIbator.xml
Ant build file in the org.apache.ibatis.ibator.core
project to update the
JAR in the plug-in. Note that this build file does not run the entire Ibator build (i.e. it
does not run the tests).