GWT plugin 0.6 development

109 views
Skip to first unread message

David Dawson

unread,
Nov 4, 2011, 12:23:54 PM11/4/11
to grail...@googlegroups.com
Hi guys.  

Rob and I have been threatening to make a 0.6 release of the GWT plugin soon.   We forked off from Peters git repository (with his blessing) and have been doing some development at https://github.com/dawsonsystems/grails-gwt

We would now like to ask for feedback on the changes that have gone in there so far.  Also if anyone would care to test this with their setup so we can get an idea if anything has been broken.

Notable changes :-
  • More ways to set the GWT home.
  • Ivy based dependency downloading for GWT core libraries, gin and GWT module libraries, controlled in BuildConfig.
  • Extra GWT test types and support for compiling the GWT code with a different java version (thanks to Predrag)
  • Additional mode for parallelising the compilation (running multiple compilations in parallel, not the GWT workers)
There are still a few changes planned (the ones Ben has filed in JIRA recently), however this represents the major features going into 0.6.  

Grails 2 has not been fully tested with this, or previous releases.   We are intending to test fully with grails 2 and apply any fixes to make a 0.6.1 release.

GWT home resolution

With the GWT home you now have some additional options.
  • Set the GWT_HOME environment variable.
  • Set the gwt.home system property
  • Set the gwt.home Grails settings property (eg, in BuildConfig or your user wide settings.
  • Set gwt.home="ivy" - this states that you want to manage all the dependencies in Ivy yourself (this essentially disables all checks)
  • Lastly you can set gwt.version and allow the required dependencies to be downloaded via Ivy (see below).  I'm hoping that this becomes the preferred approach.
Ivy dependency downloading

gwt {
    version="2.3.0"
    gin.version="1.5.0"
    dependencies=['com.extjs:gxt:2.2.0']
}

The gwt.version property will resolved to the required gwt-dev/ servlet jars (including validation where appropriate) and place them onto the classpath.

The gwt.gin.version property is for convenience, it will interpret 1.0 and 1.5.0 to give the appropriate gin jar and the required dependencies (guice etc)

The gwt.dependencies property takes a list of strings that are in the same format as the regular grails dependencies.  Transitive dependencies are not resolved and included.  If there are transitive dependencies you require, explicitly add them to the list.


Parallel Compilation

GWT has support for compiling the different permutations of a module in parallel using worker threads for each.  

Using this approach still leaves significant portions of the compilation running single threaded.  Each module in turn is run through the compiler, and the initial phases are single threaded, only the final stage of writing out the JS benefits from parallelisation.

An additional approach has been included that will run multiple GWT compiler instances in parallel.  This means that the entire CPU capacity you have available can be used all the time.

How much, if any, benefit you will get from this you will have to test for yourself.  

The plugin is currently set up to automatically select the approach used based on the number of available cpu cores and the number of modules to compile.  

You can force which approach to use by setting the 

gwt.parallel=true   //use full parallel
gwt.parallel=false //use gwt workers (as now)

Leaving this option out will allow the plugin to choose.

So, thats all I've got for now.  The next big item is to improve the documentation of the plugin and bring it up to date to go with the new release.

Thanks,

David

-- 
David Dawson

Dawson Systems Ltd

Email    : da...@dawsonsystems.com
Mobile : 07866011256
Jabber : da...@dawsonsystems.com
Skype   : davidadawson
Twitter : @davidthecoder

http://davidadawson.wordpress.com

Predrag Knežević

unread,
Nov 7, 2011, 4:55:35 AM11/7/11
to grail...@googlegroups.com
> Rob and I have been threatening to make a 0.6 release of the GWT plugin
> soon.   We forked off from Peters git repository (with his blessing) and
> have been doing some development
> at https://github.com/dawsonsystems/grails-gwt
> Notable changes :-
> More ways to set the GWT home.
> Ivy based dependency downloading for GWT core libraries, gin and GWT module
> libraries, controlled in BuildConfig.
> Extra GWT test types and support for compiling the GWT code with a different
> java version (thanks to Predrag)
> Additional mode for parallelising the compilation (running multiple
> compilations in parallel, not the GWT workers)

Hi,

Small addition to the list of changes: this version enables
developers to specify the bind address of the hosted mode
(--bindAddress by run-gwt-client). By default the hosted mode listens
on 127.0.0.1 only. If you need to test and debug with a browser that
you do not have locally (i.e. running under Linux, but testing with
IE), this is the option for you: starting the hosted mode with
--bindAddress=0.0.0.0 allows browser access from an another machine.

Cheers,

Predrag

Reply all
Reply to author
Forward
0 new messages