This document describes various project types that can be worked with gwt-gradle0-plugin.
Using gwt-gradle-plugin to configure a web application project is the most common use-case. Quickstart shows how to configure GWT based web application projects.
If you create your own GWT library (e.g. widget library) you will only need some of the funtionality provided by the plugin. What you need for this kind of project are basically the GWT dependencies. As such a project does not provide an entry point, there's nothing to compile or run.
To configure a library project, simply use the "gwt-base" plugin instead of applying "gwt" and "war" plugins. Additionally, you do not have to specify any GWT module.
buildscript {
[...]
}
apply plugin: 'gwt-base'
gwt {
gwtVersion='2.9.0'
}
This is the kind of project if you use GWT without deploying your application as a *.war file. In this case you typically don't use the "war" plugin but running the GWT compiler is needed. To configure this kind of project, you can use the "gwt-compiler" plugin:
buildscript {
[...]
}
apply plugin: 'gwt-compiler'
gwt {
gwtVersion='2.9.0'
modules '<YOUR-GWT-MODULE>'
}
As nobody but you knows what you want to do with the GWT compiler output, the plugin does nothing else than configuring the task "compileGwt". You are responsible the this task is called by setting appropriate task dependencies.
Typical use-cases for this are:
The first use-case can be configured the following way:
buildscript {
[...]
}
apply plugin: 'gwt-compiler'
apply plugin: 'maven-publish'
gwt {
gwtVersion='2.9.0'
modules '<YOUR-GWT-MODULE>'
}
task gwtZip(type: Zip) {
from tasks.compileGwt.outputs
}
group='<YOUR-GROUP-ID>'
version='<YOUR-VERSION>'
publishing {
publications {
mavenJava(MavenPublication) {
artifact gwtZip {
extension = 'zip'
classifier = 'gwt'
}
}
}
repositories {
maven {
url project.file('repo').toURI()
}
}
}
The second use-case can be set up in the following way if the consuming project is a web project:
apply plugin: 'war'
war {
from project(':compile-only').tasks.compileGwt.outputs
}
Here is the difference between 'gwt-base' and 'gwt-compiler':
gwtCompile
, gwtDraftCompile
and gwtCheck
gradle tasks. When gwt modules (with entry points) are configured, this plugin will actually compile the GWT modules. This plugin is useful when you want to compile the GWT modules but we don't want to use them in a web application. A typical example is when you want to develop JavaScript libraries using GWT.