The 'one-line' compile and shell-scripts look a little bit as if they
try to mock at heavyweight (xml-configured) build solutions.
Cheers,
- Mark
Well I can't speak for Google as a whole :) but speaking for myself
(and I think the other GWT engineers), we want people to easily use GWT
in every conceivable way. We've tried to balance providing some useful
tools (like Eclipse and Ant file generation) with being tool agnostic.
We want you to use whatever tools you like best, and have the power to
integrate with other tools as you see fit. The compiler and shell
scripts are a way of saying, "Here's the bare minimum you need to get
this to run; extrapolate from here to fit your own build environment."
We don't want to force you to use a particular technology.
By the way, Robert Cooper has a Maven plugin he talks about in this
article:
http://www.onjava.com/pub/a/onjava/2006/05/31/working-with-google-web-toolkit.html
It's linked off the last page of the article.
Scott Blum
GWT Engineer
Last few days I've spent on developing AJAX Developer Suite - suite
which integrates GWT, Maven 2 and Jetty 6. With it you can create
real-time AJAX applications. To create your own project you can simply
use Maven blank project (in the future it will have a goal to run
Google browser). Currently project is on planning stage. Any help
appreciated.
Currently project is hosted on:
http://rubynetwork.svnrepository.com/ajaxdevelopersuite
<build>
<plugins>
<plugin>
<groupId>org.shinobun.mojo</groupId>
<artifactId>maven-gwt-plugin</artifactId>
<configuration>
<className>org.shinobun.demo.gwt.GwtDemo</className>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
It assumes a different directory structure than the ones created by
GWT's create script. The GWT stuff are to be put under ./src/main/gwt.
The output goes to ./target/gwt/www.
I've also created a demo for it [2].
[1] https://ssl.shinobun.org/svn/repos/trunk/mojos/maven-gwt-plugin/
[2] https://ssl.shinobun.org/svn/repos/trunk/demo/demo-gwt/
These are hosted on my laptop, so only available when I'm online...
/**
* Location of the source files.
*
* @parameter
* @required
*/
private List sourceDirectories;
//added a loop to get all the source directories.
private ClassLoader getClassLoader() throws MojoExecutionException {
URLClassLoader myClassLoader = (URLClassLoader)
getClass().getClassLoader();
URL[] originalUrls = myClassLoader.getURLs();
URL[] urls = new URL[originalUrls.length + sourceDirectories.size()];
for (int index = 0; index < originalUrls.length; ++index) {
try {
String url = originalUrls[index].toExternalForm();
urls[index] = new
File(url.substring("file:".length())).toURI().toURL();
} catch (MalformedURLException e) {
throw new MojoExecutionException("MalformedURLException", e);
}
}
int count = 0;
for(Iterator itr = sourceDirectories.iterator(); itr.hasNext();
count++ ){
try {
File sourceDirectory = new File(itr.next().toString());
urls[originalUrls.length + count] = sourceDirectory.toURL();
} catch (MalformedURLException e) {
throw new MojoExecutionException("MalformedURLException", e);
}
}
return new URLClassLoader(urls, myClassLoader.getParent());
}
Thanks again.