Rifidi:Source Code

From RifidiWiki

Jump to: navigation, search

This page explains how to download and run the source code for Rifidi Edge, Protptyper, Tagstreamer and Workbench (Edge Server steps can be found here - http://wiki.rifidi.net/index.php?title=Edge_Server_Development_Environment). However, please keep in mind that the code in this repository is not guaranteed to be stable. If you are interested in our latest stable release, visit our sourceforge page: http://sourceforge.net/projects/rifidi/.

Quick Instructions

The following are the basic steps needed to begin running Rifidi from source. If you have trouble or need more explanation, please see the more detailed instructions on this page.

  1. Download the Eclipse for plugin developers (3.5 is what we are using)
  2. Install the subclipse plugin
  3. Add this github to the list of repositories: emulator, prototyper - https://github.com/mattrifidi/emulator, edge, workbench - https://github.com/mattrifidi/rifidi
  4. Check out the following projects from rifidi/trunk: org.rifidi.binary, org.rifidi.emulator.target, org.rifidi.ui.ide
  5. Open up the target file in org.rifidi.emulator.target and click the button that says "set as target platform"
  6. Open up the .product file in org.rifidi.ui.ide and click "launch an eclipse application"

Rifidi Source Code

For those who need to see the source code for the Rifidi products, you will have to check out the code from Github. This section explains how to check out and run the code from source.

Organization

In general the code for Rifidi is organized into Eclipse plugins or bundles. Eclipse handles the loading and execution of the plugins. For more detailed information about how our source code is organized, please see Development and Release Process#Concepts.

  • Github Structure - There are three main folders in the Rifidi directory on rep-external (the main Guthub repository for Rifidi). The trunk folder contains the code that is being developed. It is not guaranteed to be stable. The tags folder contains tagged versions of the source for each of the plugins. The source in these plugins should be relatively stable. The branches folder contains plugins that have been branched so that larger changes can be made on plugins without holding up other developers. These changes can then later be merged back in. For more details about our Github, see Development and Release Process#SVN Structure
  • Target Platform - A target platform is the base set of plugins that an Eclipse application needs to run. In order to provide a more stable environment and to ensure a clean separation between the base plugins that Rifidi needs and the base plugins that your Eclipse IDE needs, we provide a target platform for each of the Rifidi products. You can find these in the trunk. They will be named something like org.rifidi.emulator.target. For more information see Development and Release Process#Target Platforms.
  • org.rifidi.binary - As the source code for Rifidi gets larger it begins to get harder to maintain a stable set of plugins. In order to simplify things, there is a folder in the Github into which stable binaries of each of the plugins used in the rifidi project will be placed. This folder is used in conjunction with the target platform.
  • Product File - In Eclipse, a product file is used to define the needed eclipse plugins. Running this file will create a new Eclipse 'Run Configuration' in your IDE. You can then tweak this run configuration as needed.
  • Source Code Plugins - A stable binary version of each of the plugins is contained in the org.rifidi.binary folder. However, if you wish to view the source of a particular plugin or run a plugin from source, you must download the code from either the version in the trunk or a tagged version in the tags directory.

Downloading the Code

Our code is hosted at https://github.com/mattrifidi/rifidi and https://github.com/mattrifidi/emulator. The Github repository allows anonymous read access. Because the Github repository is the same one that developers submit to, it contains the latest Rifidi code.

The following steps explain how to check out and run Rifidi Emulator. The other products in the Rifidi Suite follow similar steps. If you need help with them, you can ask questions on IRC or our forums.

Prerequisites

The Rifidi Emulator is written in java and consists of Eclipse plugins. At this point it is easiest to compile and build it inside of the eclipse environment.

Install Eclipse

Note that you need the "Eclipse for RCP/Plug-in Developers" version of eclipse. Rifidi will not run on other versions.

  • If you do not already have eclipse, or if you have a different version, you will need to get this version
    • Go to http://www.eclipse.org/downloads/ and download the "Eclipse for RCP/Plug-in Developers" version of Eclipse to a convenient location.
    • Unzip the package.
    • Double click on the execution file to get it started
      Double click on the executable to open up eclipse
  • If you have not used eclipse before, you will be required to select a workspace when eclipse is opening.
    • After eclipse opens go to the workbench
      Open up the workbench
  • If you have an existing workspace, you will need to create a new one.
    • Go to file -> switch workspace -> other
      Open up the workbench
    • Select a new directory for your Rifidi workspace.

Install Subclipse

Subclipse is an eclipse plugin that manages svn commands.

Add Repository

  • Open the 'SVN Repository Exploring' perspective
    • Window -> Open Perspective -> Other
      Open up the perspective picker
    • SVN Repository Exploring
      Open up the SVN Repository Explorer
  • Add the rifidi repository

Check Out Code

  • Check out all the projects in the rifidi/trunk folder of the repository
    • Highlight the folders you would like to check out. For Emulator you will need
      • org.rifidi.binary
      • org.rifidi.emulator.taget3.5.2
      • org.rifidi.ui.ide
    • Right click them and select checkout
      Select the projects
    • Select Finish.
      Checkout projects

Set The Target Platform

  • Open up the .target file in org.rifidi.emulator.target
  • Click the button that says "set as target platform"

Running Rifidi

The last step to get Rifidi running is to create a run configuration.

A run configuration is the set of plugins that will be loaded when you run the application. Plugins can come from one of two places:

  1. Workspace - these are the plugins that you have in the source tree on the left
  2. Target Environment - These are the plugins defined by the target environment that you are using that the time.

Because there is a product file for emulator defined in the org.rifidi.ui.ide plugin, the easiest way to create a new run configuration is by running the product file. This will automatically create a new run configuration

To Create a new Run Configuration:

  • Switch to the Java perspective in the same way that you switched to the repository exploring view
    Run Rifidi
  • Right click on Rifidi.product in the org.rifidi.ui.ide project
  • Click on "Run as eclipse application"
    Run Rifidi
  • From now on, you can start Rifidi via the green triangle button at the top of eclipse

If there was an error when starting the application, follow the step below to edit the run configuration:

To Edit a Run Configuration:

  • Run -> Open Run Dialog -> Eclipse Application -> Rifidi.product. This is the run configuration.
  • Go to the Tab Plug-ins. The selected plugins are the ones that will be run. Notice that there are two sections: "workspace" and "target platform"
  • click the Button "Add Required Plug-ins"
    Add required plugins
  • check any plugins specifically required for the application to run (for example, the emulator requires the readers to be included). Make sure that the plugin is coming from the place deals singapore that you intended (i.e. workspace or target platform).
  • click the Button "Validate Plug-ins" to make sure everything is set up correctly
  • click the Button "Apply"
  • click the Button "Run" and start the Project

Updating the code

Now that you have downloaded the code into an eclipse workspace, it is easy to get changes to the code as soon as we add them to the svn.

To update the code:

  • Open up the Team Synchronizing Perspective in eclipse
  • Click the button that says "Synchronize".
  • Select all projects.
  • Install any updates by selecting all the updates show, right clicking and choosing 'update'

Now that you have the new code, just hit the green run button on the toolbar at the top (Eclipse automatically compiles the code for you, so you don't have to worry about that).

Switching Branches

If you need to run code from another branch or tag, please see Switching Branches.

Viewing Source and Running From Trunk

By default all of the rifidi plugins you are running in eclipse are pre-compiled, binary plugins contained in the org.rifidi.binary folder. If you want to view or edit the source for a particular plugin, you will need to check out the plugin from the trunk. Once it is checked out make sure to edit your run configuration so that the application will use the plugin from the workspace and not from the target platform.

For example, suppose I want to view the source for the Alien reader plugin. I need to follow the steps above to check out and run rifidi emulator. In addition, I need to check out the org.rifidi.emulator.readers.alien plugin. This is the code for the alien reader. In addition, I need to edit the run configuration to make sure that my workspace alien reader plugin is being used instead of the target platform alien reader plugin.

Reporting Bugs

To report bugs, please use the forum at

http://forums.rifidi.net

or drop by our IRC channel:

#rifidi on irc.freenode.org.

You can also visit us online at http://www.rifidi.net

Personal tools