Building Photon

Prerequisites

In order to build Marketcetera Photon from the source you must have the following software installed:

  • Java JDK version 1.5 (Java 5) or greater
  • Ant version 1.6.5 is known to work, others may work
  • Eclipse version 3.3.2

Due to a bug in the Eclipse Platform Build, the fully automated build is only available on non-Windows platforms. Please see the section Eclipse IDE Build on how to build and run Photon from inside the Eclipse IDE on all platforms. Make sure that your path is set up such that you can run ant from the command line.

Environment

There are a few variables that will be referenced below that you should set in your command-line environment:

  • ECLIPSE_HOME -- The main Eclipse IDE installation directory, the one that contains eclipse.exe
  • RCP_TARGET_HOME -- Set this after competing the section Set up the Target Platform below. This is the "eclipse" directory that holds the plugins that you compile against.
  • PHOTON_SVN_DIR -- Set this once you have checked out the Photon source as described below in Get the Source to the top level directory checked out from subversion (contains directories named plugins and features)

Get the Source

Change to the directory into which you would like to checkout the source. Then use SVN to get the source from the public Marketcetera repository. The following command will check out the HEAD revision from the Subversion repository into a directory called photon:

svn co http://svn.marketcetera.org/client/photon/trunk/ photon

Set up the Target Platform

You should first set up a separate target platform for Eclipse. Instructions for doing this can be found here. Be sure to install the "delta pack" as described in those instructions. Photon is currently built on version 3.3.0 of the Eclipse RCP and it is unlikely to work with any other version.

Some additional plugins are needed. Currently these are the plugins needed to build Photon:

org.eclipse.jdt.debug_3.3.0.v20070530a
org.eclipse.jdt.source_3.3.0.v20070606-0010-7o7jCHEFpPoqQYvnXqejeR
org.eclipse.platform.source_3.3.0.v20070612-_19UEkLEzwsdF9jSqQ-G
org.eclipse.rcp.source_3.3.0.v20070607-8y8eE8NEbsN3X_fjWS8HPNG
org.eclipse.sdk_3.3.0.v20070613
org.epic.regexp_0.1.4
org.jruby_1.0.0
org.junit_3.8.2.v200706111738
org.junit4_4.3.1
org.kxml2_2.1.4
org.rubypeople.rdt.core_0.8.1.609062100PRD
org.rubypeople.rdt.debug.core_0.8.1.609062100PRD
org.rubypeople.rdt.debug.ui_0.8.1.609062100PRD
org.rubypeople.rdt.launching_0.8.1.609062100PRD
org.rubypeople.rdt.source_0.8.1.609062100PRD
org.rubypeople.rdt.testunit_0.8.1.609062100PRD
org.rubypeople.rdt.ui_0.8.1.609062100PRD
org.rubypeople.rdt_0.8.1.609062100PRD
javax.servlet_2.4.0.v200706111738.jar
org.apache.commons.logging_1.0.4.v200706111724.jar
org.apache.lucene.analysis_1.9.1.v200706181610.jar
org.apache.lucene_1.9.1.v200706111724.jar
org.eclipse.ant.core_3.1.200.v20070522.jar
org.eclipse.compare_3.3.0.I20070606.jar
org.eclipse.core.filebuffers_3.3.0.v20070606-0010.jar
org.eclipse.core.filesystem_1.1.0.v20070606.jar
org.eclipse.core.net_1.0.0.I20070531.jar
org.eclipse.core.resources_3.3.0.v20070604.jar
org.eclipse.core.runtime.compatibility_3.1.200.v20070502.jar
org.eclipse.core.variables_3.2.0.v20070426.jar
org.eclipse.debug.core_3.3.0.v20070607-1800.jar
org.eclipse.debug.ui_3.3.0.v20070607-1800.jar
org.eclipse.equinox.http.jetty_1.0.0.v20070607.jar
org.eclipse.equinox.http.servlet_1.0.0.v20070606.jar
org.eclipse.help.appserver_3.1.200.v20070510.jar
org.eclipse.help.base_3.3.0.v20070606.jar
org.eclipse.help.ui_3.3.0.v20070530.jar
org.eclipse.jdt.core.manipulation_1.1.0.v20070606-0010.jar
org.eclipse.jdt.core_3.3.0.v_771.jar
org.eclipse.jdt.debug.ui_3.2.100.v20070531-1800.jar
org.eclipse.jdt.launching_3.3.0.v20070510.jar
org.eclipse.jdt.ui_3.3.0.v20070607-0010.jar
org.eclipse.jface.text_3.3.0.v20070606-0010.jar
org.eclipse.ltk.core.refactoring_3.3.0.v20070606-0010.jar
org.eclipse.ltk.ui.refactoring_3.3.0.v20070606-0010.jar
org.eclipse.osgi.services_3.1.200.v20070605.jar
org.eclipse.search_3.3.0.v20070606-0010.jar
org.eclipse.team.core_3.3.0.I20070607.jar
org.eclipse.team.ui_3.3.0.I20070607.jar
org.eclipse.text_3.3.0.v20070606-0010.jar
org.eclipse.ui.cheatsheets_3.3.0.v20070507.jar
org.eclipse.ui.console_3.2.0.v20070530.jar
org.eclipse.ui.editors_3.3.0.v20070606-0010.jar
org.eclipse.ui.forms_3.3.0.v20070511.jar
org.eclipse.ui.ide.application_1.0.0.I20070530-0100.jar
org.eclipse.ui.ide_3.3.0.I20070620.jar
org.eclipse.ui.intro_3.2.100.v20070530.jar
org.eclipse.ui.navigator.resources_3.3.0.I20070605-0010.jar
org.eclipse.ui.navigator_3.3.0.I20070605-0010.jar
org.eclipse.ui.net_1.0.0.I20070516.jar
org.eclipse.ui.views.properties.tabbed_3.3.0.I20070605-0010.jar
org.eclipse.ui.views_3.2.100.I20070319-0010.jar
org.eclipse.ui.workbench.texteditor_3.3.0.v20070606-0010.jar
org.eclipse.update.core_3.2.100.v20070615.jar
org.eclipse.update.ui_3.2.100.v20070615.jar
org.mortbay.jetty_5.1.11.v200706111724.jar
org.rubypeople.rdt.doc.user_0.8.1.609062100PRD.jar

However you may download all of these plugins, in a single zip file from our repo. Simply download photon-eclipse-plugins-0.4.0.zip, and expand it in the same directory as your target platform. That is, the zip file will put files into an eclipse/plugins directory.

Remove "-consoleLog" from the default MacOS configuration

Strangely the Info.plist files in the org.eclipse.platform.launchers features contain the "consoleLog" command line switch for the Eclipse-based executables. This switch which is useful in debugging, causes many unneccesary messages to be printed to the console in Photon. To remove this switch edit the following two files in your target platform directory:

  • features/org.eclipse.equinox.executable_3.3.0.v20070606-7C--E9IgKLWLDUE/bin/carbon/macosx/x86/Eclipse.app/Contents/Info.plist
  • features/org.eclipse.equinox.executable_3.3.0.v20070606-7C--E9IgKLWLDUE/bin/carbon/macosx/ppc/Eclipse.app/Contents/Info.plist

and remove the line:

                      <string>-consoleLog</string>

Command-line PDE build

Edit the file $PHOTON_SVN_DIR/plugins/org.marketcetera.photon.build/build.properties and change the values of two properties:

  • buildDirectory -- set this to be the value of $PHOTON_SVN_DIR
  • baseLocation -- set this to be the value of $RCP_TARGET_DIR

Then, to run the build from the command line:

%> cd $PHOTON_SVN_DIR
%> java -jar $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.0.0.v20070606.jar \
  -application org.eclipse.ant.core.antRunner \
  -buildfile $ECLIPSE_HOME/plugins/org.eclipse.pde.build_3.3.0.v20070612/scripts/productBuild/productBuild.xml \
  -Dbuilder=$PHOTON_SVN_DIR/plugins/org.marketcetera.photon.build/

When it finishes there should be a directory named I.<versionnum> containing Photon builds for several plaftorms.

Eclipse IDE Build

Building and running Photon in Eclipse is fairly straightforward.

Import plugin projects

Under the File menu in Eclipse, choose Import..., and on the resulting dialog, choose "Existing Projects into Workspace".

http://repo.marketcetera.org/images/screenshots/import-screenshot.png

In the resulting dialog, make sure "Select root directory:" is checked, and click "Browse...", then navigate to the $PHOTON_SVN_DIR directory created above, and click "OK". In the "Projects" area, there now should be a number of plugin projects listed. Make sure they are all checked, and click "Finish". This should import all of the Photon plugins into your workspace, each as its own project.

Configure the target platform

If you haven't already you need to show the Eclipse IDE where your target platform resides. To do this, from the Window menu choose Preferences. In the preferences dialog, navigate to Target Platform under Plug-in Development.

http://repo.marketcetera.org/images/screenshots/target-platform-screenshot.png

Near the top of this dialog, make sure that the Location: points to your RCP target platform as specified above as $RCP_TARGET_HOME. Now click Reload next to the list of plugins and close the dialog by clicking OK.

Your workspace should now rebuild itself, but if it does not, from the Project menu, choose Clean... to clean all of the projects in your workspace.

Run Photon from inside Eclipse

The simplest way to run Photon from inside Eclipse is to right-click on org.marketcetera.photon in the Package Explorer, and choose Run As, and then choose Eclipse Application from the sub-menu.

This will run Photon and add a run configuration called "Eclipse Application" that you can rename or customize by choosing Run... from the 'Run' menu.