Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Add the ability to write plugins using jruby or groovy."

(Deliverables)
m (Deliverables: cat)
 
(7 intermediate revisions by one other user not shown)
Line 24: Line 24:
  
 
'''SVN repo at SF.net''' at [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/ eclipse-incub] contains two plug-ins:  
 
'''SVN repo at SF.net''' at [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/ eclipse-incub] contains two plug-ins:  
* [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-plugin/ yummy-plugin] - this is the plug-in that should provide the ability to write the new plug-ins in a scripting language, e.g. Groovy.
+
* [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.plugin/ org.eclipse.soc.scripting.plugin] - this is the plug-in that should provide the ability to write the new plug-ins in a scripting language, e.g. Groovy.
* [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-script-contributor/ yummy-script-contributor] - a demonstration plug-in that contributes the components written in a scripting language.
+
* [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.contributor/ org.eclipse.soc.scripting.contributor] - a demonstration plug-in that contributes the components written in a scripting language.
  
 
I will also provide a set of unit tests as a separate plug-in and feature/site projects for the installation.
 
I will also provide a set of unit tests as a separate plug-in and feature/site projects for the installation.
Line 32: Line 32:
  
 
[[Image:Ok_green.gif]] ''Implementation of runtime engine to run the scripts.'' javax.scripting API is in use for this purpose:
 
[[Image:Ok_green.gif]] ''Implementation of runtime engine to run the scripts.'' javax.scripting API is in use for this purpose:
[http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-plugin/src/org/eclipse/soc/yummy/core/ScriptExecutor.java?view=markup org.eclipse.soc.yummy.core.ScriptExecutor] does the job.
+
[http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.plugin/src/org/eclipse/soc/scripting/core/ScriptExecutor.java?view=log ScriptExecutor] does the job.
  
  
[[Image:Ok_green.gif]] ''How to attach an action, that is implemented using a scripting language (Groovy or JRuby), to an eclipse button or menu.''  All the extensions will be described just if it would be a normal eclipse plug-in, instead, the implementing class will be specified using using custom syntax line referring to a script location.
+
[[Image:Ok_green.gif]] ''Proxy class''. A proxy solution is implemented for delegating the method calls to the scripting world: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.plugin/src/org/eclipse/soc/scripting/core/ScriptExtensionProxy.java?view=log ScriptExtensionProxy]
  
  
[[Image:Progress.gif]] ''Implementing a set of facades to the scripting objects that should implement extensions.''
+
[[Image:Progress.gif]] ''Implementing extensions using scripts''
* [[Image:Ok_green.gif]] org.eclipse.ui.actionSets: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-plugin/src/org/eclipse/soc/yummy/facade/actions/ScriptAction.java?view=markup facade], [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-script-contributor/action.groovy?revision=27&view=markup script]  
+
* [[Image:Ok_green.gif]] org.eclipse.ui.actionSets: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.contributor/action.groovy?view=log script]  
* [[Image:Progress.gif]] org.eclipse.ui.views: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-plugin/src/org/eclipse/soc/yummy/facade/views/ScriptView.java?view=markup facade], [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-script-contributor/view.groovy?view=markup script]
+
* [[Image:Progress.gif]] org.eclipse.ui.views: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.contributor/view.groovy?view=log script]
* [[Image:Progress.gif]] org.eclipse.ui.perspectives: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-plugin/src/org/eclipse/soc/yummy/facade/perspectives/ScriptPerspective.java?view=markup facade], [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-script-contributor/perspective.groovy?view=log script]
+
 
 +
 
 +
[[Image:Ok_green.gif]] ''Plug-in activation''
 +
[[Image:Ok_green.gif]] [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.plugin/src/org/eclipse/soc/scripting/core/ScriptBundleActivator.java?view=markup ScriptBundleActivator] can be used for any activation procedures. It will look for an [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.contributor/activator.groovy?view=markup activator.groovy] and call the start() method to from the script.
  
  
 
[[Image:Ok_green.gif]] ''Referencing to the script item in plugin.xml.''
 
[[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, delimited with ':' character:
+
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.facade.views.ScriptView:view.groovy
+
   org.eclipse.soc.yummy.core.ScriptExtensionProxy:org.eclipse.ui.IWorkbenchWindowActionDelegate/action.groovy
  
See the demostration plug-in for more: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/yummy-script-contributor/plugin.xml?view=markup plugin.xml]
+
See the demostration plug-in for more: [http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/scripting_plugins/org.eclipse.soc.scripting.contributor/plugin.xml?view=log plugin.xml]
  
  
Line 60: Line 63:
 
* <language>-engine.jar, e.g. groovy-engine.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.
 
* 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.
+
* [[Image:Glass.gif]] Licencing issues for 3rd-party libraries, e.g. groovy-all.jar, groovy-engine.jar
  
  
[[Image:Glass.gif]] ''Executing the new script plug-in in the same workbench''.  
+
[[Image:Progress.gif]] ''Demo plug-in''
 +
* [[Image:Progress.gif]] ''JUnit runner''
 +
* [[Image:Progress.gif]] ''Modelling framework example''
 +
* [[Image:Progress.gif]] ''Simple search''
  
Options:
 
* [http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html Plug-In Architecture Notes]. When starting the "scriptable" plug-in, the extensions defined in ''plugin.xml'' should be processed by a custom handler, that will override the standardized extension processing.
 
* Create a a bundle programmaticaly and register it via Equinox.
 
  
== Deliverables ==
+
[[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''
  
The main results to be reached:
 
  
'''Major'''
+
[[Image:Glass.gif]] ''Executing the new script plug-in in the same workbench''.
 +
* Create a a bundle programmaticaly and register it via Equinox?
  
''- An Eclipse extension/plug-in'' to provide the ability to write the new plug-ins in a scripting language, e.g. Groovy
+
== 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.
 
+
 
+
'''Minor'''
+
 
+
''- An Eclipse extension/plug-in'' to (re)load (Groovy/JRuby) scripts on the fly.
+
  
''- Command line console support'' to modify and change the program behavior interactively. Probably this could look like in case Apache Derby ij plug-in
+
[[Category:SOC]]

Latest revision as of 17:42, 14 October 2007

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

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

Glass.gif Needs some investigation
Progress.gif Patch in progress
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

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


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


Progress.gif Implementing extensions using scripts

  • Ok green.gif org.eclipse.ui.actionSets: script
  • Progress.gif org.eclipse.ui.views: script


Ok green.gif Plug-in activation 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.


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


Progress.gifGlass.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.


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.
  • Glass.gif Licencing issues for 3rd-party libraries, e.g. groovy-all.jar, groovy-engine.jar


Progress.gif Demo plug-in

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


Progress.gif Usability enhancements

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


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.

Back to the top