Getting Groovy with Eclipse:  Next generation tool support for dynamic languages  Andrew Eisenberg SpringSource a division of VMWare
What is Groovy-Eclipse? Eclipse tool support for the Groovy programming language Recent release of Groovy-Eclipse 2.0.1 Two Goals: Deep integration with Java Development Tools (JDT) Editing support for Groovy's dynamicism
What is Groovy? This is Java: public   class  Main {   public static  void main(String[] args) {   System.out.println( “Hello, EclipseCon.” );  } }
What is Groovy? This is Groovy: public   class  Main {   public static  void main(String[] args) {   System.out.println( “Hello, EclipseCon.” );  } }
What is Groovy? This is  really  Groovy: print   “Hello, EclipseCon.” Groovy is a dynamically typed JVM language Builds upon the strengths of Java syntax, libraries, runtime, ... Supports extra features scripting, meta-programming, DSLs, …
Deep integration with JDT Editing support for Groovy's dynamicism Groovy-Eclipse JDT compiler integration  (Demo 1) Debug support  (Demo 2) Groovy type inferencing  (Demo 3)
What is deep integration with JDT? Optimize Edit / Save / Compile / Test Same level of quality: Java <-> Groovy Similar feature set where makes sense Seamless Cross-referencing
How to achieve Deep integration  Extended JDT compiler Compiles both Java and Groovy No need for stub generation Compiler output not just class files Abstract Syntax Tree (AST) Java model
Demo 1 JDT – Groovy Compiler integration
Debug support Much like as in Java: launching applications, tests breakpoints stepping variables view hot swap (new!) display view (work in progress) But, also: launching scripts closure support filter uninteresting stack frames
Demo 2 Debugging – integration with JDT
Inferencing engine guess type information statically def x x = (-1).abs() x = “foo”  x.abs() IDE support for Groovy's dynamicism x  instanceof  String x  instanceof  Integer MissingPropertyException!!!
Inferencing Engine is extensible Custom DSLs can plug in (e.g., Grails) Used for many parts of the UI: Content Assist Navigation Search Underlining unknown references
Demo 3 Type inferencing provides IDE support for groovy dynamicism
Groovy-Eclipse Deep integration with JDT Editor Compiler Debugger Support for Groovy's dynamicism Type inferencing
Eclipse is now Groovy! Groovy-Eclipse: http://groovy.codehaus.org/Eclipse+Plugin Andrew Eisenberg [email_address] Thank you!
JDT Compiler integration .groovy/.java sources Generate .class files or Java model Generate .class files or Java model Generate Select  parser Eclipse parser .java files Groovy parser .groovy files Parse Write .class files or  cache Java model Resolve references across all files Resolve For IDE operations (Search, content assist...)

Groovy-Eclipse at Eclipsecon2010

  • 1.
    Getting Groovy withEclipse: Next generation tool support for dynamic languages Andrew Eisenberg SpringSource a division of VMWare
  • 2.
    What is Groovy-Eclipse?Eclipse tool support for the Groovy programming language Recent release of Groovy-Eclipse 2.0.1 Two Goals: Deep integration with Java Development Tools (JDT) Editing support for Groovy's dynamicism
  • 3.
    What is Groovy?This is Java: public class Main { public static void main(String[] args) { System.out.println( “Hello, EclipseCon.” ); } }
  • 4.
    What is Groovy?This is Groovy: public class Main { public static void main(String[] args) { System.out.println( “Hello, EclipseCon.” ); } }
  • 5.
    What is Groovy?This is really Groovy: print “Hello, EclipseCon.” Groovy is a dynamically typed JVM language Builds upon the strengths of Java syntax, libraries, runtime, ... Supports extra features scripting, meta-programming, DSLs, …
  • 6.
    Deep integration withJDT Editing support for Groovy's dynamicism Groovy-Eclipse JDT compiler integration (Demo 1) Debug support (Demo 2) Groovy type inferencing (Demo 3)
  • 7.
    What is deepintegration with JDT? Optimize Edit / Save / Compile / Test Same level of quality: Java <-> Groovy Similar feature set where makes sense Seamless Cross-referencing
  • 8.
    How to achieveDeep integration Extended JDT compiler Compiles both Java and Groovy No need for stub generation Compiler output not just class files Abstract Syntax Tree (AST) Java model
  • 9.
    Demo 1 JDT– Groovy Compiler integration
  • 10.
    Debug support Muchlike as in Java: launching applications, tests breakpoints stepping variables view hot swap (new!) display view (work in progress) But, also: launching scripts closure support filter uninteresting stack frames
  • 11.
    Demo 2 Debugging– integration with JDT
  • 12.
    Inferencing engine guesstype information statically def x x = (-1).abs() x = “foo” x.abs() IDE support for Groovy's dynamicism x instanceof String x instanceof Integer MissingPropertyException!!!
  • 13.
    Inferencing Engine isextensible Custom DSLs can plug in (e.g., Grails) Used for many parts of the UI: Content Assist Navigation Search Underlining unknown references
  • 14.
    Demo 3 Typeinferencing provides IDE support for groovy dynamicism
  • 15.
    Groovy-Eclipse Deep integrationwith JDT Editor Compiler Debugger Support for Groovy's dynamicism Type inferencing
  • 16.
    Eclipse is nowGroovy! Groovy-Eclipse: http://groovy.codehaus.org/Eclipse+Plugin Andrew Eisenberg [email_address] Thank you!
  • 17.
    JDT Compiler integration.groovy/.java sources Generate .class files or Java model Generate .class files or Java model Generate Select parser Eclipse parser .java files Groovy parser .groovy files Parse Write .class files or cache Java model Resolve references across all files Resolve For IDE operations (Search, content assist...)