From Optflux
Revision as of 01:40, 3 December 2010 by Admin (talk | contribs) (Configuring the structure of your plug-in directory)
Jump to: navigation, search

Creating a new project for your plug-in

  1. Begin by Running Eclipse
  2. Having downloaded the release from the website, let's begin creating a New Java Project
    Release1.png
  3. Give a name to your project and:
    1. select the Create project from existing source;
    2. select the path to the directory where you extracted the OptFlux release.
    3. press next;
    Release2.png
  4. Press the Create new source folder link
    1. Add a name your plug_in, preferably under plugins_src folder
    Release3.png
  5. Switch to the Libraries tab
    1. Press the Add JARs... button
    2. Add any jar library under the lib[your_architecture] folder. In the example we are adding some extra libraries for MacOS X (darwin64)
    Release4.png
  6. Your Eclipse workspace should look something like:
    Release4 1.png

Configuring the structure of your plug-in directory

  1. Right-click the plug-in source folder (plugins_src/myplugin4optflux) and:
    1. Press Add -> New -> Package
      Release5.png
    2. Name it whatever you like. We like to use the same name for the first folder in the directory structure. In this case myplugin4optflux
      Release6.png
  2. Create the mandatory plugin.xml file:
  3. Right-click the plug-in source folder (plugins_src/myplugin4optflux) and:
    1. Press Add -> New -> File
      Release7.png
    2. Name it plugin.xml
      Release8.png
  4. To understand the structure and contents of the plugin.xml file, please refer to the Developers#Plugin.xml section.
    1. We Provide an almost empty sample here just for reference File:Plugin.xml
      Release9.png
  5. Filling the sub-directory structure with rational packages is the next step. Since AIBench/OptFlux development is based on 3 main artifacts we usually sub-divide our java classes by those 3 artifacts.
    1. This means that we should create 3 sub-packages, one for the OPERATIONS, one for the VIEWS and one for our DATATYPES.
    2. Please note that this is optional. AIBench/OptFlux are agnostic to this, we just find it easier and more structured this way.
    3. You should get something like this
    Release10.png