Code Monkey home page Code Monkey logo

gwt-gradle-plugin's People

Contributors

sothmann avatar steffenschaefer avatar turbo87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gwt-gradle-plugin's Issues

MultiModule client-shared-server project

Can someone help me with configuration for classic 3-module project (client, shared, server)?

The sample project for configuration with gradle

mvn archetype:generate \
   -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ \
   -DarchetypeGroupId=net.ltgt.gwt.archetypes \
   -DarchetypeArtifactId=modular-requestfactory \
   -DarchetypeVersion=1.0-SNAPSHOT

https://github.com/tbroyer/gwt-maven-archetypes

Thanks.

Error thrown when eclipse plugin applied before gwt plugin

I tested this on master (486087b).
From a fresh clone, I ran gradlew publish. No problems.

Then I went into the war-using-library sample project's build.gradle file, moving the apply plugin: 'eclipse' line before the gwt plugin apply.
After executing a gradlew tasks, I receive the following error:

> Cannot add extension with name 'gwt', as there is an extension already registered with that name.

This seems to only happen with the eclipse plugin, because I tried unsuccessfully to reproduce this error with the war plugin.

I didn't see anything obvious in the code, but I plan to dive a little deeper later on.

Selective compilation

Hi,
I have a single project (Gradle war) with the following Java sources:
src/main/java/com/project/client
src/main/java/com/project/shared
src/main/java/com/project/server

where I want to launch Gwt compilation in the client and share packages ONLY and javac compile for the server package. How do I tell this plugin to ignore changes in the server package (or at least do only javac compilation there)?

gwt + eclipse plugin

Hi,

When using the gwt plugin together with the eclipse plugin, the "gradle eclipse" task messes up the webAppDir contents: file contents in the webAppDir were zeroed out, and all dependencies were copied to WEB-INF/lib. This is because the warTemplate task was executed, but in this scenario it does not seem appropriate...

Any suggestions?

Thanks,
Viktor

How to add own assets to generated war?

Hi,

I wonder how one would add his own assets to the war file generated by this plugin?

I already have an HTML entry point (a .html and a .css file) in the war subdirectory of my project, but these are not added to the .war file generated by the gwt-gradle-plugin. should I specify something explicitly so that they are added?

best regards,

Akos

Option indicating the use of RequestFactory?

If RequestFactory is used in a GWT project then an option needs to be set so that the ValidationTool is run. See https://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation#Eclipse for details; they are not tricky. This issue is a feature request to include a plugin option that gets integrated into the Eclipse project file generated by the eclipse task.

A hack might be to check if requestfactory-apt.jar is a dependency, which indicates that the RequestFactory is being used and the ValidationTool should be run. Otherwise, if the RequestFactory option is set then the requestfactory-apt.jar must be a dependency.

compileGwt when build.gradle is located in a different project

I have 2 projects org.sample.project and org.sample.project.client.

The build.gradle file sits in org.sample.project and the gwtModule is org.sample.project.client

How do i update the classpath to declare the source of the the other project.
When i use:
modules 'org.sample.project.client.ProjectWebApp'
the gwt.xml file is not found.

When i try to to use it this way:
modules '../org.sample.project.client/src/org.sample.project.client.ProjectWebApp'
it says invalid module name.

What else can i do? Btw. i want to migrate an old project so i do not have a maven like structure.

Change Compile to JavaCompile

In build.gradle,

@@ -51,7 +51,7 @@ subprojects {
testCompile group: 'junit', name: 'junit', version: '[4.11,5.0['
}

  • tasks.withType(Compile) {
  • tasks.withType(JavaCompile) {
    options.encoding = rootProject.encoding
    }

Reason: Java org.gradle.api.tasks.compile.Compile deprecated in Gradle 1.2 and removed in Gradle 2.0.

gwtCompile fails with custom java srcDir location

if the java source is in a custom location (eg. src/main/java2 instead of src/main/java)
the gwtCompile target fails, being unable to find the .gwt.xml module file.
Apparently it is still the default source location that is added to the classpath of the gwt compile command, instead of the configured path.

I tried these small changes to the super-dev-mode example on master, which made it fail:

  1. renamed src/main/java to src/main/java2
  2. made sure the build.gradle file reflected the change:
sourceSets {
    main {
        java {
            srcDir 'src/main/java2'
        }
    }
}

And then the build fails.

However, adding this line made it work again:

gwt {
    src = project.files(project.sourceSets.main.java.srcDirs)
}

It just doesn't seem like this should be necessary.

I tried debugging the plugin, and concluded that it seems like the gwt plugin tries to read the correct source location, but that

project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME)

seems to contain the default location.

By then my missing understanding of gradle internals caught up with me, and i had to give up.

Gradle 2.0 will deprecated dynamic properties

Steffen,
I can not thank you enough for this awesome, wonderful GWT plug-in! As a "tank you" though, I will just keep on filing issues and complaining :-)

Here is something I noticed in Gradle 1.12 - you may have to take some action before they release Gradle 2.0:
...
Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information on the replacement for dynamic properties.
Deprecated dynamic property: "noServer" on "de.richsource.gradle.plugins.gwt.GwtPluginExtension_Decorated@5a622fe8", value: "true".
Deprecated dynamic property: "startUrl" on "de.richsource.gradle.plugins.gwt.GwtPluginExtension_Decorated@5a622fe8", value: "index.jsp".

Eclipse workspace getting stuck on validating compiler

I am using the plugin with gradle 1.9 and gwt 2.51. I am now noticing that my eclipse workspace is getting stuck for about 15-20 minutes on validating the following file: target/gwt/work/com.db.test.testModule/compiler. Any actions on the project folders activates this validation process which blocks me from doing any further work.

I followed the steps given here: https://github.com/steffenschaefer/gwt-gradle-plugin in configuring the plugin.

I did not notice this issue earlier before using this plugin. I am not completely sure if this is an issue with the plugin, or because I am using gwt 2.5.1 and gradle 1.9. I apologize if I am posting in the wrong space but I could not find any other online portal to ask about this issue.

Error with Gradle nightly 1.12

When using the latest nightly build of Gradle 1.12 gwt-gradle-plugin runs into an incompatibility problem with use of the internal copy root spec class.

Caused by: java.lang.NoSuchMethodError: org.gradle.api.internal.file.copy.DestinationRootCopySpec.addFirst()Lorg/gradle/api/internal/file/copy/DefaultCopySpec;
        at de.richsource.gradle.plugins.gwt.ExplodedWar.<init>(ExplodedWar.java:42)
        at de.richsource.gradle.plugins.gwt.ExplodedWar_Decorated.<init>(Unknown Source)
        at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:62)
        at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
        at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:124)
        ... 86 more

if gwt plugin can work with eclipse and eclipse-wtp togerther,it will be powerful.

apply plugin: 'war'
apply plugin: 'gwt'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'

if this plugin could work with eclipse-wtp,the project will be a web project,so it can run a eclipse server container(right click the project,and run as -> run a server) because the jettyDraftWar can not be terminated by eclipse...this may be good solution now...

Creating a GWT library JAR

Thanks, Steffen, for the plugin. It's given me the push I needed to start exploring Gradle (that and a comment from Thomas Broyer last month that GWT will be moving from Ant to Gradle).

Question: I've a GWT library of UI widgets that I'm building with Gradle 1.12 and your plugin. When I run gradle clean jar, the build/libs/*jar file does not include the *.java files nor the .ui.xml files. Other files--.png, *.gwt.xml, *.class, *.css, and *.properties--are present. To get the *.java and *.ui.xml files (and the others I need) I must add the target:

jar {
  manifest {
    attributes 'Implementation-Title': 'GWT Widgets', 'Implementation-Version': version
  }
  from project.sourceSets.main.allJava
  from project.sourceSets.main.output
  from('src/main/java') {
    include '**/*.xml'
    include '**/*.css'
    include '**/*.png'
    include '**/*.properties'
    exclude '**JUnit**'
  }
}

Am I missing something?

Push artifacts to maven central

Could you please push to maven central instead of/as well as the Github repo?

We use this plugin in our project setup, and a lot of users are experiencing intermittent connection problems when trying to resolve your plugin from your github maven repository, causing their whole build to fail.

Thanks for your work on this plugin!

gwtCompile with sources across projects?

This might be an easy one, but I just can't figure out...

I try to compileGwt project A, which has compile dependencies to project B. Now, because project B contains code needed for compileGwt, by build fails with

No source code is available for type XYZ; did you forget to inherit a required module?

My question: How can I configure project A to make the gwt plugin see the sources of project B?

Debug options

Steffen,
In your excellent plugin&docs you suggest that one could run dev mode with the below options but has to wait until the IDE attaches to the dev process on the debug port:
./gradlew -DgwtDev.debug=true ....

How can one, however, run in debug mode with these JVM setting instead:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

The difference is that with this dev mode will launch and not wait, the developer is free to attach /detach debugger to it at will. Also, how can one specify different port than 5005?

Thanks.

Exclude source files from gwt build that are located inside a jar file

I read #23, #33 and #39 to find out how I can add dependent sources which are located inside a jar file. But unfortunately, this is not a pure gwt-based library, i.e. there are classes which have various other (binary) dependencies.

Of course, my project only relies on the source files inside the library which do not need anything besides gwt and Eclipse seems to be able to figure that out at build time and compiles only what's needed. Using gradle and your plugin (thanks a lot!), it seems that all source files available in the class path are compiled, which of course leads to errors like

[ERROR] Line xxx: No source code is available for type xxx.xxxx.XXXXX; did you forget to inherit a required module?

Is it possible to exclude some of the files contained in the jar from the gwt build? I fiddled around with http://forums.gradle.org/gradle/topics/how_can_i_configure_certain_java_files_not_to_be_compiled, but since the problem is not related to one of my source files but to a file inside a dependency, I couldn't get it to work.

Chenge the behavior of the gwtDev task

Right now the gwtDev task will launch and wait for the IDE to connect to the debug port . After the IDE attaches to the debug port, the gradle process for the gwtDev task will still not finish - I guess the intention is that one can stop gwtDev by killing the blocked gradle process. However this is unnecessary and only wastes memory (for the blocked gradle process). Instead:

  1. Launch the gwtDev by spawning a separate JVM and do not make it wait for an incoming debug connection
  2. Let the gradle process finish as usual. If one needs to kill Dev Mode, s/he can easily do it as it is just an UI with close window button, usually at the top-right corner. No need to hold the gradle process.

Below is a an example of implementing this behavior without the plug-in. (Note the use of Ant's java task with spawn and fork attributes, as there is a long-standing bug in Gradle that does not allow you to spawn processes independent of the Gradle process).

//This would start the GWT code server and immediately finish .. which is OK since Dev Mode can be killed easily
task startGwt << {
description = "Launch GWT DevMode for all gwt modules"
ant.java( spawn:true, fork:true, classname:"com.google.gwt.dev.DevMode"){
jvmarg(value: "-Djava.util.logging.config.file=${project.webInfDir}/logging.properties") //RestEasy logging
jvmarg(value: "-Xmx1024m")
jvmarg(value: "-Xss1024k")
jvmarg(value: "-XX:PermSize=1024m")
jvmarg(value: "-XX:MaxPermSize=1024m")
jvmarg(value: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005")
arg(value: "com.bla.WebApp")
//arg(line: "-startupUrl index.jsp")
arg(line: "-startupUrl s4g-web/index.jsp")
arg(line: "-war "+project.warDir)
arg(line: "-noserver")
arg(line: "-port 8080")
arg(line: "-codeServerPort 9997")
arg(line: "-extra "+ project.gwtExtraDir)
arg(line: "-logLevel INFO")
classpath {
pathElement(location: "src/main/java")
pathElement(location: "src/main/resources")
pathElement(location: "${project.webClassesDir}")
pathElement(path: configurations.gwt.asPath)
pathElement(path: configurations.compile.asPath)
pathElement(path: configurations.providedCompile.asPath)
}
}
}

sourceSets support?

Hi,

Steffen, I really appreciate all the effort you've put into creating a GWT gradle plugin.

I'm trying to apply this plugin to the following project: https://github.com/glob3mobile/g3m , particularly at first to the GWT SDK that these guys have: https://github.com/glob3mobile/g3m/tree/purgatory/WebGL/G3MWebGLSDK

as you will see, this library project has an unusual directory structure, as all source file is located in 'src' instead of 'src/main' or something similar. with your plugin, I tried the following build.gradle file:

buildscript {
    repositories {
        maven {
            url 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/'
        }
        mavenCentral()
    }
    dependencies {
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.4'
    }   
}           

apply plugin: 'java'
apply plugin: 'gwt-base'
apply plugin: 'eclipse'

gwt {
    gwtVersion='2.6.0'

    sourceSets {
        main {
            java {
                srcDir 'src'
            }
        }
    }
}

with the hope that the sources would be picked up from src. unfortunately I'm getting the following output as a result:

$ gradle build
:WebGL:G3MWebGLSDK:compileJava

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':WebGL:G3MWebGLSDK:gwt'.
> Could not find com.google.gwt:gwt-codeserver:2.6.0.
  Required by:
      g3m.WebGL:G3MWebGLSDK:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.276 secs

I wonder what I'm doing wrong

jettyDraftWar,can not stop jetty.

Hi

this plugin is really very powerful,but i do not know how to stop jetty after running jettDraftWar and the gradle build stop at 8%(cannot stop it).I can only close eclipse to stop everything..

DevModules definition

The devModules are not properly setted in the GwtPluginExtension (I think it is a simple typo). So everytime the module property is used (instead of devModules when the task is a dev task).

How to define where gwt compile`s result is put in war?

I would like to change where the result of a gwt compile placed in my war archive. By default after compile files are under the /gwt/out and content of this goes into the war archive later.

I want either to have my files generated under 'out' but in 'VAADIN/widgetset' or place what is by default generated under 'out' into the above dir in war (avoiding files to be put in the war`s root, of course).

Any idea appreciated!

Better support for up-to-date checks

Setup

Gradle 1.10
Plugin 0.3
OS Windows 7

Scenario

Running gradle assemble multiple times in a row without changing any of the files.

Expected

The gwt tasks are executed on the first run but on the following runs the gwt tasks are skipped as UP-TO-DATE.

Observed

The gwt tasks are executed on each and every run although no source files have been changed. This is very tiring considering that the compileGwt task might take quite some time to generate the javascript.

GWT SuperDev issues

Steffen,
I posted an issue with using the SuperDev mode from you plug-in to the Errai forum, but it feels like the issue is with the this Gwt plug-in - missing something on the classpath when ruuning superDev task (not seeing an HTML template in the source tree?), I suspect:

https://community.jboss.org/message/874528#874528

Here is my build file:

//This Errai Gradle build file uses the following excellent Gradle plug-ins:
// 1. CARGO:
// https://github.com/bmuschko/gradle-cargo-plugin
//
// 2. GWT:
// https://github.com/steffenschaefer/gwt-gradle-plugin

project.description = 's4g web app'

project.ext {
erraiVersion = '3.0.0.CR1'
cargoVersion='1.5'
gwtVersion= '2.6.1'
}

apply plugin: 'war'
apply plugin: 'gwt'
apply plugin: 'cargo'

buildscript {

repositories {
    jcenter()
    maven {
        url 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/'
    }

    mavenCentral()
}

dependencies {
    classpath "org.gradle.api.plugins:gradle-cargo-plugin:1.5"
    classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.4'
}

}

gwt {
gwtVersion=project.gwtVersion
modules 'com.peruncs.s4g.web.gwt.S4GWebApp'
devModules 'com.peruncs.s4g.web.gwt.S4GWebAppDev'
minHeapSize = "512M";
maxHeapSize = "1024M";

compiler {
    strict = true;
    enableClosureCompiler = true;

    //Does not work fro Errai: https://community.jboss.org/thread/241064
    //disableClassMetadata = true;

    disableCastChecking = true;
    ea = true;
    localWorkers = 2;
}

gwtDev {
    jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
    noserver = true;
    port = 8080;
    startupUrl = "s4g-web-1.0/index.jsp";
    codeServerPort = 9997;
}

// dev {
// noserver = true;
// port = 8080;
// startupUrl = "s4g-web-1.0/index.jsp";
// codeServerPort = 9997;
//
// //OLD SETTINGS
//// jvmarg(value: "-DDEBUG") //Jetty debugging
//// jvmarg(value: "-Djava.util.logging.config.file=${project.webInfDir}/logging.properties") //RestEasy logging
//// jvmarg(value: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005")
//// arg(value: "com.peruncs.s4g.web.gwt.S4GWebApp")
//// arg(line: "-startupUrl index.jsp")
//// arg(line: "-war "+project.warDir)
//// arg(line: "-noserver")
//// arg(line: "-port 8080")
//// arg(line: "-codeServerPort 9997")
//// arg(line: "-extra "+ project.gwtExtraDir)
//
//
// }
}

cargo {
containerId = 'wildfly8x'
remote {
hostname = 'localhost'
username = 'admin'
password = 'admin'
}
local {
jvmArgs = '-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n'
homeDir = file("${wildfly_root}")
}
deployable {
file = tasks.draftWar.archivePath
context = 'draft'
}
}

dependencies {

//We exclude some modules, which should have never been referrenced in Errai to begin with!
//Also see http://stackoverflow.com/questions/23508612/gradle-multiple-compile-dependencies-syntax
def compileExcludes = {
    exclude group: 'com.google.gwt' 
    exclude group: 'com.google.guava'
    exclude group: 'javax.enterprise'
    exclude group: 'javax.annotation'
}

//Cargo dependencies. You should only need the uberjar module, but see this discussion:
//https://github.com/bmuschko/gradle-cargo-plugin/issues/78
cargo  'org.codehaus.cargo:cargo-core-uberjar:1.4.8',
       'org.codehaus.cargo:cargo-ant:1.4.8',
       'org.wildfly:wildfly-controller-client:8.1.0.CR1'

compile project(":stocks4grab:s4g-common")

//Java EE
providedCompile "javax:javaee-api:7.0"

//Other compile dependencies
compile 'com.google.guava:guava:17.0'
gwt 'com.google.guava:guava-gwt:17.0'

compile 'commons-lang:commons-lang:2.6'

//Errai dependencies
compile "org.jboss.errai:errai-bus:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-ioc:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-cdi-client:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-weld-integration:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-data-binding:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-jpa-client:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-jpa-datasync:"+project.erraiVersion, compileExcludes

//Cordova is only used for GWT compilation
gwt "org.jboss.errai:errai-cordova:"+project.erraiVersion, compileExcludes
//compile "org.jboss.errai:errai-cordova:"+project.erraiVersion, compileExcludes

compile "org.jboss.errai:errai-jaxrs-client:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-jaxrs-provider:"+project.erraiVersion, compileExcludes

//Uncomment if you will use Errai 3 Security
//compile "org.jboss.errai:errai-security-server:"+project.erraiVersion, compileExcludes
//compile "org.jboss.errai:errai-security-client:"+project.erraiVersion, compileExcludes

// These are documented in Errai 3 as needed only for gwt compile, which is not true - they are needed at runtime as well.
//gwt "org.jboss.errai:errai-ui:"+project.erraiVersion, compileExcludes
//gwt "org.jboss.errai:errai-navigation:"+project.erraiVersion, compileExcludes


compile "org.jboss.errai:errai-ui:"+project.erraiVersion, compileExcludes
compile "org.jboss.errai:errai-navigation:"+project.erraiVersion, compileExcludes

compile "org.jboss.errai:errai-jboss-as-support:"+project.erraiVersion, compileExcludes

//This seems to be a Errai 3 mistake, which includes dependence on com.google.gwt.junit.server.JUnitHostImpl
//Remove when the Errai team fixes the issue, also remove the JUnit servlet in web.xml
runtime  "com.google.gwt:gwt-user:"+project.gwtVersion

}

during GWT compile: NoSuchFieldError: reportUnusedDeclaredThrownExceptionIncludeDocCommentReference

had that using GWT 2.4.0, seems to be due to classpath order.
Workaround:

configurations {
   gwtLibs
}

dependencies {
   gwtLibs (
      'com.google.gwt:gwt-user:2.4.0',
      'com.google.gwt:gwt-dev:2.4.0',
      'com.google.gwt:gwt-servlet:2.4.0'
   )
}

compileGwt {
   classpath = configurations.gwtLibs + classpath
}

ps: within gwt task I tried with and without gwtVersion='2.4.0', but that did not change the behavior!

Include support for GWT Code Generators

We use a lot of GWT Code Generators here that need to be compiled prior to the compileGwt task. This classes have to be included into gwt tasks classpath. Is there any common way to do this?

I did the following (but I am still a gradle newbe):

  compileGwt.dependsOn { gwtCodeGeneratorsClasses }

and

gwt (
         files("$buildDir/classes/gwtCodeGenerators") {
            builtBy { gwtCodeGeneratorsClasses }
         }
      )
``

Error with Gradle 1.7

No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.classpath() is applicable for argument types: (java.lang.String) values: [de.richsource.gradle.plugins:gwt-gradle-plugin:0.1]

Incremental Build With Multiple GWT Modules

Hi,

First I have to say I was really happy to find this addon and its pretty much working perfectly for my setup. But I have an issue that I don't know if it is possible to solve with the current implementation of the plugin.

For projects that only contains one GWT module the flagging of out-of-date files work flawlessly but I have a project with multiple GWT modules and I can't get the incremental feature to work for individual modules. The entire task will be flagged as out of date on changes which will cause all GWT modules to rebuild even though just one of the modules actually have changed.

Example Multiple Modules:

gwt {
    gwtVersion = '2.6.1'
    modules('com.test.moduleOne.ModuleOne',
             com.test.moduleTwo.ModuleTwo')
}

If I make a change to a file in ModuleOne both ModuleOne and ModuleTwo will be rebuilt since the compileGwt task will be flagged as out-of-date.

Is it possible to make it so that each module will be flagged independently if they have no dependencies between them?

Thanks!

Adding a sources jar to gwt {} for compileGWT

Thanks for your work on gwt-gradle-plugin. I am a newbie with gradle. How do I add a 3rd party source jar to the gwt {} stanza in build.gradle? I'd like to do something like below, but I can't figure out how to make it work.

gwt {
// this works...
// gwt-gradle-plugin/examples/war-using-library
src += files(project(':example-library').sourceSets.main.allJava.srcDirs) + files(project(':example-library').sourceSets.main.output.resourcesDir)

// ...this does not
// sources.jar contains 3rd party java source files
src += sources.jar
}

gwt compiler running out of memory

when compiling a larger project, I'm encountering an out of memory error:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2367)
    at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
    at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
    at java.lang.StringBuffer.append(StringBuffer.java:237)
    at java.io.StringWriter.write(StringWriter.java:112)
    at java.io.PrintWriter.write(PrintWriter.java:456)
    at com.google.gwt.user.rebind.ClassSourceFileComposer.print(ClassSourceFileComposer.java:163)
    at com.google.gwt.user.rebind.ClassSourceFileComposer.println(ClassSourceFileComposer.java:179)
    at com.google.gwt.user.rebind.ClassSourceFileComposer.indentln(ClassSourceFileComposer.java:125)
    at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.createFieldsAndAssignments(AbstractClientBundleGenerator.java:769)
    at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.createFieldsAndAssignments(AbstractClientBundleGenerator.java:819)
    at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.generateIncrementally(AbstractClientBundleGenerator.java:467)
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:670)
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)
    at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
    at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleGwtCreate(UnifyAst.java:387)
    at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:465)
    at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:255)
    at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:244)
    at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
    at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
    at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
    at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:117)
    at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:65)
    at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
    at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
    at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
    at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:117)

this is despite I'm trying to set -Xmx4g via GRADLE_OPTS, JVM_OPTS and DEFAULT_JVM_OPTS as well.

interetingly the above setting has an effect on the gradle java process, but not on the actual process doing the GWT compilation:

$ ps aux | grep java | grep Xmx
akos     27425  157  3.7 5914832 461296 pts/30 Sl+  16:54   0:48 java -Xmx4g -Dorg.gradle.appname=gradle -classpath /usr/local/share/gradle-1.10/lib/gradle-launcher-1.10.jar org.gradle.launcher.GradleMain build
akos     27461  129  2.7 1563512 338440 pts/30 Sl+  16:55   0:20 /usr/lib/jvm/java-7-oracle/bin/java -Dgwt.persistentunitcachedir=/home/akos/src/glass.aero/src/aeroglass-gradle/aeroGwt/build/gwt/cache -Xms256M -Xmx256M -Dfile.encoding=UTF-8 ...

see -Xmx4g in the first line but -Xmx256M in the second line

wonder how one can increase the max allocated memory for the GWT compilation process

'gradle draftCompileGwt warTemplate' seems broken?

When you run:
'gradle draftCompileGwt warTemplate'
The warTemplate task does not copy the content of 'build/draftOut', resulting in a bad exploded war file. Is this expected, or is this a bug? ... Since warTemplate does pick up the results of compileGwt from the 'build/out' folder, maybe you need a separate draftWarTemplate task just like the other draft* tasks?

documentation on configuring the plugin?

I would like to now what configuration option are available. Looked at the examples and the sources, but I can only find some I have been looking for. An essential part of this would be to know how to add dependencies just to gwt (and not to the java plugin's) compile classpath. If I add them to the latter they end up in the war giving a way too huge file. Trying 'classpath' element in gwt or in its compiler section does not work.

This documentation would be of great help for users.
I am going to discard my home-made scriptlet in favour of this nice plugin. Thank you!

Support Legacy SuperDevMode

Please support -superDevMode switch for GWT 2.7-SNAPSHOT
About:

It allows to start the Super Dev Mode codeserver and
the application webserver at the same time, so as
it can be run from any IDE or any launcher just adding
the flag -superDevMode

It also provides a .nocache.js script able to load
Super Dev Mode stuff when the app is run in any server
without needing to install bookmarklets.

Added: https://gwt-review.googlesource.com/#/c/8150/
HowTo: http://docs.sencha.com/gxt/3.1/getting_started/sdm/SuperDevMode_Eclipse.html

working with pure java project dependencies?

Hi,

I'm trying to use your plugin to build the GWT portion of this project: https://github.com/glob3mobile/g3m

I'm using a single build.gradle and settings.gradle file in the top dir of the project. it seems that I can't make the project dependency work. the GWT project I'm trying to build is in g3m/WebGL/G3MWebGLSDK, which depends on the pure java project g3m/Commons/G3MSharedSDK. I'm trying to do this using the following gradle files, situated in the g3m root directory:

settings.gradle:

include 'Commons:G3MSharedSDK', 'WebGL:G3MWebGLSDK'

build.gradle:

apply plugin: 'eclipse'

buildscript {
    repositories {
        maven {
            url 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/'
        }
        mavenCentral()
    }

    dependencies {
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.4'
    }   
}


project(':Commons:G3MSharedSDK') {
    apply plugin: 'java'

    sourceCompatibility = 1.6
    version = '1.0'

    sourceSets {
        main {
            java {
                srcDir 'src'
            }
        }
    }
}

project(':WebGL:G3MWebGLSDK') {
    repositories {
        maven {
            url 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/'
        }
        mavenCentral()
    }

    dependencies {
        compile project(':Commons:G3MSharedSDK')
    }

    apply plugin: 'java'
    apply plugin: 'gwt-base'
    apply plugin: 'eclipse'

    gwt {
        gwtVersion='2.6.0'

        sourceSets {
            main {
                java {
                    srcDir 'src'
                }
            }
        }
    }
}

and I get the following:

$ gradle build

FAILURE: Build failed with an exception.

* Where:
Build file '/home/akos/src/glass.aero/src/g3m/build.gradle' line: 41

* What went wrong:
A problem occurred evaluating root project 'g3m'.
> No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.compile() is applicable for argument types: (org.gradle.api.internal.project.DefaultProject_Decorated) values: [project ':Commons:G3MSharedSDK']
  Possible solutions: module(java.lang.Object)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.124 secs

if I omit the dependency for :Commons:G3MSharedSDK above, then it starts to compile, but of course it will fail as the dependent libraries are not there:

$ gradle build
:Commons:G3MSharedSDK:compileJava UP-TO-DATE
:Commons:G3MSharedSDK:processResources UP-TO-DATE
:Commons:G3MSharedSDK:classes UP-TO-DATE
:Commons:G3MSharedSDK:jar UP-TO-DATE
:Commons:G3MSharedSDK:assemble UP-TO-DATE
:Commons:G3MSharedSDK:compileTestJava UP-TO-DATE
:Commons:G3MSharedSDK:processTestResources UP-TO-DATE
:Commons:G3MSharedSDK:testClasses UP-TO-DATE
:Commons:G3MSharedSDK:test UP-TO-DATE
:Commons:G3MSharedSDK:check UP-TO-DATE
:Commons:G3MSharedSDK:build UP-TO-DATE
:WebGL:G3MWebGLSDK:compileJava
/home/akos/src/glass.aero/src/g3m/WebGL/G3MWebGLSDK/src/org/glob3/mobile/specific/IntBuffer_WebGL.java:5: error: package org.glob3.mobile.generated does not exist
import org.glob3.mobile.generated.IIntBuffer;
                                 ^

...

I wonder how this should be done properly

gwt-gradle-plugin 0.4 dependency and repo url

Steffen: thanks for the plugin, but here are some issues I bumped into that could prevent people from seamlessly adopting it:
In examples/build.gradle you list version 0.4 of your plugin in buildscript.dependencies. Even if I compile gradle plugin on local machine, I won't get that version. I changed plugin version to 0.3 but still got gradle complaining simply because buildscript.repositories.maven is pointing to rootProject.projectDir.parentFile.

So second change I had to add to build scripts is to change maven url to https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/

I might be missing something, but I think it would be easier for beginners if you have stable version (in that case 0.3) listed in build.gradle as well as your maven repo configured there by default.

Thanks for your hard work though! Plugin is really handy!

DevMode remote debug port should be enabled by default

Right now one needs to define the debug port as a (global?) Gradle system property in order for the IDE to attach to it and debug a GWT app. As it is hard to imagine a situation where DevMode would run without debugging port, I suggest that this is the how it starts by default. The default debug port could be something like 5500 (or whatever), but can also be configured like this:
gwt {
gwtVersion='2.5.1'
gwtDevDebugPort=5601
modules 'โ€™
}

Experimental flags

Hi.

Sorry for newbie question:
I would like to try out GWTs JsInterop, but I can't figure out where to add this flag to the build file. Is it possible at all?

Thanks,
Michael

gwtSuperDev don't stop

I run the gwtSuperDev in Eclipse as 'External tool'. When I stop it, the java process with the gwtSuperDev is stil running in the background. After I have to stop it with the Taskmanager.

Provide mechanism to use a locally installed GWT distribution

Right now, this plug-in downloads GWT artifacts from a Maven repository. However, sometimes one needs to run a GWT app against a local or custom (unofficial) GWT distribution. Therefore, it would be nice if one can specify a local folder with GWT distribution, rather then the default mechanism, Example of what this fix might look like:
gwt {
gwtHome='/usr/java/my-local-gwt-2.6'
modules 'โ€™
}

java.io.FileNotFoundException when running "eclipse" task

After freshly cloning the project, running ./gradlew eclipse produces a java.io.FileNotFoundException. Here is the error

* What went wrong:
Execution failed for task ':eclipse'.
> java.io.FileNotFoundException: .../gwt-gradle-plugin/.settings/org.eclipse.core.resources.prefs (No such file or directory)

compileGwt on jar projects

When applying 'gwt' or 'gwt-base' on a jar project, I would expect the plugin to perform a compileGwt task just like it does for war projects. Even when building the example project, I cannot find any effect for the examples/library subproject.

Is this behaviour a bug or can you explain how to make the plugin work for jar projects?

IntelliJ integration

Would be nice if the plugin automatically puts gwt / gwtSdk configurations on classpath in IntelliJ.

For a multi-module GWT library project I currently do:

allprojects {
  apply plugin: 'idea'
}

subprojects {
  apply plugin: 'java'
  apply plugin: 'gwt-base'

  // put GWT SDK and GWT client libraries on class path using provided scope
  idea {
    module {
      scopes.PROVIDED.plus += configurations.gwtSdk
      scopes.PROVIDED.plus += configurations.gwt
    }
  }
}

Should be easy enough to include in this plugin.

I have also created an issue at Jetbrains that the GWT facet should be detected by IntelliJ and GWT SDK libraries should be taken from Gradle dependencies, see (and maybe vote ;-) ): http://youtrack.jetbrains.com/issue/IDEA-124723

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.