GWT Open Source Project
Java Python CSS JavaScript C++ XSLT Other
Latest commit d987899 Jun 17, 2017 @gkdn gkdn Update ConsoleLogger native types to better reflect DOM spec.
Change-Id: I78780fc7f4e20897d78f53c8f5a2d3adb236e614
Failed to load latest commit information.
.github Add Github Issue/Pull request templates and Jan 22, 2017
build_tools Update emul-ezt's output for the new website Feb 10, 2017
dev-ext Merging releases/1.6@4385:4459 into trunk. Jan 16, 2009
dev Removes most of the remaining JSNI in JRE Jun 7, 2017
distro-source Update release notes to link to the correct page instead of the one s… Sep 20, 2016
doc Disable doclint when generating javadoc with Java 8 Feb 10, 2017
eclipse Adding rule for checkstyle line lenght. Jul 11, 2016
elemental Explicitly throw JsonException for unparseable input + some tests Apr 18, 2017
jni Merge BUILD files from google/pu. May 10, 2013
maven Allow deploy maven artifacts with HEAD-SNAPSHOT version May 5, 2017
reference Update HistoryImpl to use modern browser standards Jan 8, 2014
requestfactory Adding missing Ant properties when disabling tests Feb 17, 2016
samples Update snapshot dependency in maven sample projects Apr 22, 2017
servlet Fix packaging and Maven dependencies after sourcemaps update Jun 28, 2016
tools Compile using Error Prone (when using Java 8) May 9, 2017
user Update ConsoleLogger native types to better reflect DOM spec. Jun 19, 2017
.gitignore Add note about global gitignore in our .gitignore files. Oct 12, 2014 Add Github Issue/Pull request templates and Jan 22, 2017 README - fix ant target order for example of building with a specific… Sep 20, 2016
build.xml Moves some gwt-user super-sources to correct locations. Feb 3, 2015
common.ant.xml Compile using Error Prone (when using Java 8) May 9, 2017
platforms.ant.xml Checkstyle update to 5.7 and style fixes. Mar 19, 2014

## GWT

nightly-java7 nightly-java8 gitter irc

GWT is the official open source project for GWT releases 2.5 and onwards.

In this document you have some quick instructions to build the SDK from source code and to run its tests.

For a more detailed documentation visit our web site. If you are interested in contributing with the project, please read the Making GWT better section.

Building the GWT SDK:

  • In order to build GWT, java and ant are required in your system.

  • Optional: if you want to compile elemental you need python and g++ installed.

  • You need the GWT tools repository checked out and up-to-date. By default it is expected to be found at ../tools. You can override the default location using the GWT_TOOLS environment variable or passing argument to ant.

  • To create the SDK distribution files run:

    $ ant clean elemental dist-dev

    or if you don't have python and g++ just run

    $ ant clean dist-dev

    Then you will get all .jar files in the folder build/lib and the redistributable file will be: build/dist/

    if you want to specify a different version number run:

    $ ant clean elemental dist-dev -Dgwt.version=x.x.x

  • To compile everything including examples you have to run

    $ ant clean elemental dist

How to verify GWT code conventions:

  • In GWT we have some conventions so as all code written by contributors look similar being easier to review.

  • After you make any modification, run this command to compile everything including tests, to check APIs, and to verify code style. It shouldn't take longer than 3-4 minutes.

    $ ant compile.tests apicheck checkstyle -Dprecompile.disable=true

How to run GWT tests

  • Previously to run any test you have to set some environment variables to guarantee that they are run in the same conditions for all developers.

    In a Unix like platform you can use the export command:

    $ export TZ=America/Los_Angeles ANT_OPTS=-Dfile.encoding=UTF-8

    But in Windows™ you have to set the time-zone in your control panel, and the environment variables using the command set.

  • Finally you can run all test suites with the following command, but be prepared because it could take hours, and probably it would fail because of timeouts, etc.

    $ ant test

  • Thus, you might want to run only certain tests so as you can focus on checking the modifications you are working on.

    GWT build scripts use specific ant tasks and a bunch of system properties listed in the following table to specify which tests to run and how.

    For instance to run the task test in the module user you have to change to the user folder and run ant with the task as argument, adding any other property with the -D flag:

    $ ( cd user && ant test -Dtest.emma.htmlunit.disable=true ; cd .. )

    Module Task Property to skip Description
    dev test GWT compiler & dev libraries
    codeserver test test.codeserver.disable SuperDevMode server
    user test test.user.disable GWT user API and JRE emulation
    user test.nongwt test.nongwt.disable Run tests that not require GWTTestCase
    user Run dev-mode tests with HtmlUnit
    user test.web.htmlunit test.web.htmlunit.disable Run web-mode tests with HtmlUnit
    user test.draft.htmlunit test.draft.htmlunit.disable Run draft compiled HtmlUnit tests
    user test.nometa.htmlunit test.nometa.htmlunit.disable Run -XdisableClassMetadata tests with HtmlUnit
    user test.emma.htmlunit test.emma.htmlunit.disable Run emma tests with HtmlUnit
    user test.coverage.htmlunit test.coverage.htmlunit.disable Run tests for coverage support
    user Run dev-mode tests using Selenium RC servers
    user test.web.selenium test.web.selenium.disable Run web tests using Selenium RC servers
    user test.draft.selenium test.draft.selenium.disable Run draft compiled tests using Selenium RC servers
    user test.nometa.selenium test.nometa.selenium.disable Run -XdisableClassMetadata tests using Selenium RC servers
    user test.emma.selenium test.emma.selenium.disable Run emma tests with Selenium RC servers
    requestfactory test test.requestfactory.disable Request Factory library
    elemental test test.elemental.disable Elemental library
    elemental test.nongwt test.nongwt.disable Run elemental tests that not require GWTTestCase
    elemental Run elemental dev-mode tests with HtmlUnit
    elemental test.web.htmlunit test.web.htmlunit.disable Run elemental web-mode tests with HtmlUnit
    tools test Some tools used in GWT development

    Additionally you can utilize some variables to filter which test to run in each task:

    Module Task Properties Default
    dev/core test **/com/google/**/*Test.class
                |                                       | |

    user | test | gwt.junit.testcase.includes | **/*Suite.class user | test.nongwt | gwt.nongwt.testcase.includes | **/*JreSuite.class | | gwt.nongwt.testcase.excludes | user | test.web.* test.draft.* test.nometa.* | gwt.junit.testcase.web.includes | **/*Suite.class | | gwt.junit.testcase.web.excludes | **/*JsInteropSuite.class,**/*JreSuite.class,***/OptimizedOnly* user |* test.emma.* | | **/*Suite.class | | | **/*JsInteropSuite.class,**/*JreSuite.class,***/OptimizedOnly*


  • Run all tests in dev

    $ ( cd dev && ant test ; cd .. )

    Note: that the last `cd ..' is only needed in Windows.

  • There is another option to do the same but without changing to the module folder. We have to specify the module as the ant task, and the task as a target argument.

    $ ant dev -Dtarget=test

  • Run all tests in codeserver

    $ ( cd dev/codeserver && ant test )


    $ ant codeserver -Dtarget=test

    Note: that we disable dev tests because code server depends on dev and we don`t want to run its tests.

  • Run all tests in elemental:

    $ ( cd elemental && ant test.nongwt )


    $ ant elemental -Dtarget=test -Dtest.user.disable=true

    Note: that we have to disable dev and user tests because elemental depends on both.

  • Run all tests in tools

    $ ant tools -Dtarget=test -Dtest.user.disable=true

  • Run only the JsniRefTest in dev

    $ ant dev -Dtarget=test \"**/JsniRefTest.class"
  • Run a couple of tests in dev

    $ ant dev -Dtarget=test \"**/JsniRefTest.class,**/JsParserTest.class"

    Note: that you have to use regular expressions separated by comma to select the test classes to execute.

  • Run all Jre tests in user, they should take not longer than 3min. We have two ways to run them. Although the second case is more complex it is here to know how disable properties work.

    $ ( cd user && ant test.nongwt )


    $ ant user -Dtarget=test
           -Dtest.codeserver.disable=true \
           -Dtest.requestfactory.disable=true \
           -Dtest.elemental.disable=true \
           -Dtest.web.htmlunit.disable=true \
           -Dtest.coverage.htmlunit.disable=true \
           -Dtest.draft.htmlunit.disable=true \
           -Dtest.draft.selenium.disable=true \
           -Dtest.emma.htmlunit.disable=true \
           -Dtest.emma.selenium.disable=true \
           -Dtest.nometa.htmlunit.disable=true \
           -Dtest.nometa.selenium.disable=true \

    Note: that we have to set all disable variables but test.nongwt.disable

  • Run certain Jre tests in the user module.

    $ ( cd user && ant test.nongwt -Dgwt.nongwt.testcase.includes="**/I18NJreSuite.class" )

  • Run all GWT tests in user using htmlunit in dev mode.

    $ ( cd user && ant )