Giter VIP home page Giter VIP logo

gradlegwtsample's Introduction

Gradle Build Config for GWT

Requirement:

  • Gradle (version > 1.0)

Recommended to setup PATH and GRADLE_HOME environment variables. You should have gradle command visible in you executable PATH.

For Mac OS X and Linux developers, install gradle with gvm tool is recommended.

With GVM tool, gradle installation with latest version is very simple to enter:

gvm install gradle

Hint. GWT SDK manually installation is not required. This build file will download all depedencies with specified GWT version based on settings in build.gradle.

Getting Started

Prepare your gradle environment first.

Clone this project into your home using git.

git clone https://github.com/lyhcode/GradleGWTSample.git

Or just simply download zip file.

Change working directory into GradleGWTSample path.

Execute gradle devmode command and waiting for a "GWT Development Mode" window pop-up.

Browse the startup url.

http://localhost:8888/MyGWTApp.html?gwt.codesvr=127.0.0.1:9997

Done.

Configuration

First, customize GWT settings in build.gradle

def gwtVersion = '2.5.1'
def gwtModule = 'com.example.MyGWTApp'
def gwtStartupUrl = 'MyGWTApp.html'
def gwtWarPath = 'war'

The sample contains a GWT default directory structure. Please ensure the path related settings is fit your project needs.

/src    # Java Sources
/war    # WebContents

Command-line Usages

The build.gradle sample defined gwtc, devmode tasks. These tasks are equal to GWT official definition in webAppCreator generated build.xml (Ant).

GWT compile to JavaScript (production mode).

gradle gwtc

Run development mode.

gradle devmode

Run Jetty web server.

gradle jettyRun

Package war file.

gradle war

Compile Java sources only.

gradle compileJava

Speed up with --daemon parameter.

gradle --daemon compileJava

Use gradle with daemon feature, frequently re-run compileJava tasks will save a lot of time.

Conclusions

Build GWT project with Gradle is much better and more convience than Ant. Gradle build config specfied the GWT version to resolves all dependencies and download automatically. For future GWT version upgrade, just simply change the version settings. All the other depdencies for project needs are all configurable. No more fat JARs need to bundle with project sources.

gradlegwtsample's People

Contributors

lyhcode avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.