Groovy-Eclipse at Eclipsecon2010

920 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
920
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
18
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Groovy-Eclipse at Eclipsecon2010

  1. 1. Getting Groovy with Eclipse: Next generation tool support for dynamic languages Andrew Eisenberg SpringSource a division of VMWare 1 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  2. 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 2 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  3. 3. What is Groovy? This is Java: public class Main { public static void main(String[] args) { System.out.println(“Hello, EclipseCon.”); } } 3 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  4. 4. What is Groovy? This is Groovy: public class Main { public static void main(String[] args) { System.out.println(“Hello, EclipseCon.”); } } 4 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  5. 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, … 5 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  6. 6. Groovy-Eclipse • Deep integration with JDT – JDT compiler integration (Demo 1) – Debug support (Demo 2) • Editing support for Groovy's dynamicism – Groovy type inferencing (Demo 3) 6 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  7. 7. 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 7 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  8. 8. 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 8 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  9. 9. Demo 1 • JDT – Groovy Compiler integration 9 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  10. 10. 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 10 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  11. 11. Demo 2 • Debugging – integration with JDT 11 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  12. 12. IDE support for Groovy's dynamicism Inferencing engine • guess type information statically def x x = (-1).abs() x instanceof Integer x = “foo” x instanceof String x.abs() MissingPropertyException!!! 12 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  13. 13. 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 13 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  14. 14. Demo 3 • Type inferencing provides IDE support for groovy dynamicism 14 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  15. 15. Groovy-Eclipse • Deep integration with JDT – Editor – Compiler – Debugger • Support for Groovy's dynamicism – Type inferencing 15 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  16. 16. Eclipse is now Groovy! Groovy-Eclipse: http://groovy.codehaus.org/Eclipse+Plu gin Andrew Eisenberg aeisenberg@springsource.com Thank you! Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 16

×