Add the ability to write plugins using jruby or groovy.

From Eclipsepedia

Jump to: navigation, search

This project is part of Google Summer of Code 2007, project link is here.

Student: Anton Arhipov

Blog: http://arhipov.blogspot.com

test

SVN repo at SF.net: at eclipse-incub

Contents

About

Scripting language like Groovy (or JRuby) is an ideal choice for Java developer to do quick prototyping. The biggest benefit of Eclipse support for Groovy plug-in development is that while changing the plug-in on-the-fly there's no need to start a separate Eclipse instance or restart the IDE when something was changed in the code. This would rapidly improve the speed of lightweight plug-in development.

This project aims to add ability to write plugins in JVM-based scripting language, like Groovy and JRuby. But it could be a starting point for any other JVM scripting language, like BeanShell or Jython.

Legend

Image:Glass.gif Needs some investigation
Image:Progress.gif Patch in progress
Image:Ok_green.gif Bug fixed / Feature added


Repository

SVN repo at SF.net at eclipse-incub contains two plug-ins:

I will also provide a set of unit tests as a separate plug-in and feature/site projects for the installation.

Status/Timeline

Image:Ok_green.gif Implementation of runtime engine to run the scripts. javax.scripting API is in use for this purpose: ScriptExecutor does the job.


Image:Ok_green.gif Proxy class. A proxy solution is implemented for delegating the method calls to the scripting world: ScriptExtensionProxy


Image:Progress.gif Implementing extensions using scripts

  • Image:Ok_green.gif org.eclipse.ui.actionSets: script
  • Image:Progress.gif org.eclipse.ui.views: script


Image:Ok_green.gif Plug-in activation Image:Ok_green.gif ScriptBundleActivator can be used for any activation procedures. It will look for an activator.groovy and call the start() method to from the script.


Image:Ok_green.gif Referencing to the script item in plugin.xml.

A reference to a script file is done using a syntax hack that is provided by the org.eclipse.core.runtime.IExecutableExtension interface. Script file name is referenced in the same text value where the class name is specified:

 org.eclipse.soc.yummy.core.ScriptExtensionProxy:org.eclipse.ui.IWorkbenchWindowActionDelegate/action.groovy

See the demostration plug-in for more: plugin.xml


Image:Progress.gifImage:Glass.gif Exposing the workbench to the script. This should be very much like in Eclipse Monkey. For smooth scripting there should be a set of predefined variables that a script contributor could use out of the box: e.g a reference to workbench, windows, views, etc.


Image:Ok_green.gif The dependencies for any specific language PDE implementation are:

  • <language>.jar, e.g. groovy-all.jar
  • <language>-engine.jar, e.g. groovy-engine.jar
  • yummy-plugin.jar, i.e. the plug-in for any specific language will use the engine to run the scripts executed by <language>-engine.jar at the end. The brand new scripted plug-in will have to use yummy to enable scripting support.
  • Image:Glass.gif Licencing issues for 3rd-party libraries, e.g. groovy-all.jar, groovy-engine.jar


Image:Progress.gif Demo plug-in

  • Image:Progress.gif JUnit runner
  • Image:Progress.gif Modelling framework example
  • Image:Progress.gif Simple search


Image:Progress.gif Usability enhancements

  • Image:Progress.gif Find the deployed script bundle by its ID
  • Image:Progress.gif Browse the scripts in the bundle
  • Image:Progress.gif Open any script in an editor and allow to modify it
  • Image:Progress.gif Save the modified script in the bundle
  • Image:Progress.gif Redeploy the bundle


Image:Glass.gif Executing the new script plug-in in the same workbench.

  • Create a a bundle programmaticaly and register it via Equinox?

Deliverables

The goal to be reached is an Eclipse extension/plug-in that could be used to write the new plug-ins in a scripting language, e.g. Groovy.

Copyright © 2008 The Eclipse Foundation. All Rights Reserved

Personal tools