Contributing to the RobotFramework EclipseIDE project

ZeroOne3010 edited this page Mar 28, 2013 · 1 revision

What do you need to develop the plugin?

  • JDK 6+
  • Eclipse Classic
    • Other variants don't have the Help and eclipse source files, and you really need them. It's not worth the effort of manually installing them.
    • At least versions 3.7, 3.8 and 4.x should work fine
  • EGit (available in Indigo and Juno P2 Repositories which can be found as pre-populated from the Install New Software -dialog drop down menu.)
  • Account in GitHub
  • Robot Framework 2.6.3 https://code.google.com/p/robotframework/downloads/list

Cloning git

  • Fork this project
  • Open Git Repository Exploring perspective in Eclipse
  • Choose Clone a Git repository
  • URI: git@github.com:<your GitHub account name>/RobotFramework-EclipseIDE.git
  • Protocol: ssh
  • User: git
  • Next, Next
  • Directory: <your workspace location>/RobotFramework-EclipseIDE
  • Finish
  • Open Plug-in Development perspective (and use it instead of the Java perspective for development)
  • Import existing project into workspace
  • Select root directory (<your workspace location>/RobotFramework-EclipseIDE)
  • Finish
  • Select all imported projects, right-click one of them, choose Team - Disconnect [If the Disconnect option is not available, skip this step.]
    • The reason for disconnecting is that as of 2013-01-21 / Eclipse EGit 2.2.0.20121219 it seems that the projects are automatically shared, but somehow in a way that breaks the building of the update site. Disconnecting and re-sharing works around this problem.
  • Select all imported projects, right-click one of them, choose Team - Share project...
  • Git - Next
  • Make sure "Use or create repository in parent folder of project" is checked - Finish
  • If you are using a unix-based system with perl installed, please install the pre-commit hook (it keeps file copyright statements up-to-date):
    • Open a terminal
    • Go to <your workspace location>/RobotFramework-EclipseIDE
    • ln -s ../../.githooks/pre-commit .git/hooks/

Trying out the editor

  • Open plugin.xml
  • In the right column, there is a link "Launch an Eclipse application", click it. It starts a second Eclipse.
  • When the second eclipse opens with an empty workspace, create a new Java project in it.
  • Import the robo.txt from the root of the Robot project folder of the first eclipse into the second eclipse.
  • Right-click the robo.txt file in the second eclipse and choose Open With -> Robot ...

Building and deploying snapshot

  • Select "Export..." from the project's context menu in package explorer
  • Select "Plug-in Development - Deployable plug-ins and fragments" and click next
  • Check "com.nitorcreations.robotframework.eclipseide" in "Available Plug-ins and Fragments" (uncheck others if any)
  • On "Destination" tab, select "Directory" and insert destination folder to which plugin is built. Click Finish.
  • After build is over, copy the jar (don't rename it or it won't work) from <destination folder>/plugins into your eclipse distro's plugin directory
  • Restart the eclipse into which deploy was made

Getting started with the code

  • plugin.xml defines the entry points
    • The Overview tab (tabs at the bottom) declares that Activator.java starts the plugin providing the editor etc
    • The Extensions tab declares the rest of the entry/integration points
    • most importantly the editor extension (org.eclipse.ui.editors).
    • the "builder" extension gets notified whenever a file in the project is changed
    • the "markers" extension allows the editor to declare errors and warnings that show up both in the editor left margin and in the Problems view
  • Help -> Help Contents
    • -> Platform Plugin Developer Guide -> Programmer's guide