Search code examples
javaeclipsegwtgroovy

Converting Groovy project to Java project for GWT


This question might sound similar to the one over here. My case is given below.

  1. I have written a project in groovy but now I want to use it as javascript in browser applications (web based GUIs). Went through Google Web Toolkit, and learned that it needs strongly typed Java code. Please let me know if I'm wrong about GWT.
  2. Assuming that I want to stick with GWT, is there any way to convert a groovy project to java project? Else, would it be possible to have the javascript version of my groovy project using GWT or any other framework?

Thanks.


Solution

  • The GWT compiler is really a Java source to JavaScript source translator; it is a specific compiler which consumes Java files (article is 2008, but this main concept probably didn't changed). A GWT Groovy-to-JS would be needed.

    You can try using Grooscript, which transcompiles Groovy to Javascript.

    A Groovy-to-Java transcompiler seems out of hand (thread is 2009, but it's concepts haven't changed).

    Also noteworthy: Groovy and GWT: Combining both paradigms