Back to FOPProjectPages.


IDE Setup Guide

This page tells you how to setup FOP for development in an IDE.


Eclipse

Initial project setup

Setup CVS Repositories

Anonymous access

http://cvs.apache.org/~jeremias/eclipse-setup/AddAnonCVSRepository.png

Committer access

  • Host: cvs.apache.org
  • Path: /home/cvs
  • User: <uid>

  • Password: <pwd>

  • Connection type: ext

http://cvs.apache.org/~jeremias/eclipse-setup/AddCVSRepository.png You need a SSH executable for committer access. On Windows, there is Putty/plink (add link) and Cygwin SSH (get the setup.exe from http://www.cygwin.com). On Windows, you'll probably have to change the path to the SSH in the Preferences dialog under Team/CVS/Ext Connection Method:

http://cvs.apache.org/~jeremias/eclipse-setup/PLinkSetup.png As an alternative you can set up your SSH client to provide a tunnel as described here: http://jakarta.apache.org/site/cvsonwin32.html. This is usually a bit faster because the connection doesn't have to be built up each time you access CVS. It's just a matter of opening another channel over an open connection. In this case use the following setup:

Work on HEAD

Download the project files

Expand the newly created repository location, open "HEAD", right-click on "xml-fop" and select "Check Out As...". That's basically it.

http://cvs.apache.org/~jeremias/eclipse-setup/CheckOutHEAD.png

Setup source directories and libraries

In order to enjoy the automatic compilation feature of Eclipse, you have to define source directories and add libraries in the project preferences ("source" and "libraries" tabs). Because FOP uses Java code generated from XML in the src/codegen directory, you'll still have to run the "codegen" target in the buildfile. The generated code is written to the build/gensrc directory. See notes below on adding source directories before you do this. Add the following directories as source directories:

Libraries:


Work on the Maintenance Branch

Due to the current directory layout, setting FOP in Eclipse is a headache, you'll have to use exclude pathes because src/org and src/java-1.4/org overlap.

Download the project files

  • Open the CVS Repository Exploring Perspective
  • Create the repository location for "xml-fop" as shown above
  • Expand the new repository location: You see HEAD, Branches, Versions

    http://cvs.apache.org/~jeremias/eclipse-setup/CVSRepository.png 

  • Expand HEAD and select "xml-fop". Call the context menu and say "Configure Branches and Versions".

    http://cvs.apache.org/~jeremias/eclipse-setup/ConfigureBranches.png 

  • Dialog pops up: select "build.xml" and say "Add Selected Files"
  • Say "Deselect All" and select in the upper right box the tags you want to have remembered and say "Add Checked Tags".

    http://cvs.apache.org/~jeremias/eclipse-setup/ConfigureBranchesDialog.png 

  • Close the dialog.
  • Collapse the HEAD node again and expand the Branches node.
  • You'll now see the branches you made Eclipse remember.
  • You can expand one of them to call the context menu on the only child node: Say "Check Out As..." and setup your Eclipse project.

      http://cvs.apache.org/~jeremias/eclipse-setup/RememberedBranches.png 

Setup source directories and libraries

See the setup in the "work on HEAD" section, however, you have carefully set exclusion masks for

  • one of the src/java-1.3 or src/java-1.4 directory
  • all the directories in build/gensrc which contain copy-filtered source files which are already in the main source tree

You have to run an external Ant with both the targets of gensrc and prepare-compile, and clean out some of the superfluous generated files which Eclipse marks as conflicting.


General setup

Preferences

The following setup is required for smooth work on the project, both for committers and users provifing patches. Choose Windows->Preferences.

  • Java -> Code Generation, "Code and Comments" tab

    • Code -> New Java Files: Press Edit and Copy&Paste from an source file the comment with the license. Look for dollar signs in the RCS "$Id: $" tag: replace them with two dollar signs, also kill the content behind the "Id:".

    • Comments -> Types: Press Edit, kill the old content and add a line with "$(todo) add Javadoc". Add an appropriate "@autor" tag if you wish. Further ideas about customizations are welcome.

  • Java -> Code Generation, "Names" tab: no prefixes or suffixes.

  • Java -> Code Formatter, "Style" tab: you must uncheck the third option ("Insert tabs for indentation, not spaces"), we dont accept tabs in our Java source files. Also, the number of spaces representing an indentation level is 4. Uncheck the "Compact assignment" and "insert space after a cast" options too.

  • Java -> Code Formatter, "New Lines" tab: uncheck the first, second and forth options ("Insert a blank line before an opening brace": we don't want this, "Insert new lines in control statements": we don't want this either, "Insert new line between 'else if': not our style). It is recommended to leave the third option ("Clear all blank lines") unchecked.

  • Java -> Appearance -> Members sort order: this is only relevant if you intent to use the "Sort Members" functionality. We use the default order (Types, Static initializers, Static Fields, Static Methods, Initializers, Fields, Constructors, Methods)

  • Java -> Organize Imports: We use the default order (java, javax, org, com). Inquiries for additions are welcome.

  • Java -> Task tags: we use a TODO with normal priority (default), and occasionally a FIXME with a high priority (you have to add this if you want to see them in the task list)

Ant support

Seems to be working now.

Checkstyle support

Download the Eclipse Checkstyle plug-in from http://sourceforge.net/projects/eclipse-cs/ .

After installing the plug-in go to the Preferences dialog and to the Checkstyle section. Import the checkstyle config file from FOP's root directory. Adjust the path of the checkstyle.header.file entry.

Tip: Set a file filter (".*/gensrc/.*") in the Checkstyle section of the project's Properties page. This avoids a lot of unavoidable style violations due to code generation.

PMD support

PMD is similar to CheckStyle. It allows more powerful rules but configuring them is more difficult. It also comes with a nifty copy'n'paste detector.

  • Get the PMD plugin from http://pmd.sf.net

  • Unpack the binary into your Eclipse plugin directory, as usual.
  • Select your preferred rules in the preference window.
  • Enable PMD checking for the project in the project properties.


JBuilder

Details of JBuilder setup to come.

Checkstyle setup (for JBuilder)

Download jbCheckstyle, an Open Tool for JBuilder that provides integration of JBuilder and Checkstyle, from: http://jbcheckstyle.sourceforge.net/jbcheckstyle. After unzipping the contents, the README.html file contains complete instructions for installation and configuration.

Be sure to adjust the path of the checkstyle.header.file entry, and use forward slashes for directory delimiters (even if you are running on a Windows platform). Failure to correctly configure this will cause jbCheckstyle to not provide any output.

FOPIDESetupGuide (last edited 2009-09-20 23:33:02 by localhost)