-
Notifications
You must be signed in to change notification settings - Fork 45
Adding a sources jar to gwt {} for compileGWT #39
Comments
This should work:
|
Thanks a lot for the quick reply. sources.jar actually originates from dependencies, so I get the error below. Any suggestions? dependencies {
} ... FAILURE: Build failed with an exception.
If I exclude the gwt entry from the dependencies stanza and then compileGWT I get |
This should work:
|
That doesn't work for me either. In your examples I don't see any gwt entries within a dependencies stanza but I do see "src +=" adding source files in the gwt stanzas, so I'm fundamentally not understanding where sources should be added for the compileGWT task. Could you take a few minutes and add an example to the repo that uses 3rd party sources in a jar? I sincerely appreciate the time you've already spent helping me. |
Both things (dependencies and source) are ultimately added to the classpath when invoking GWT compiler. So technically it doesn't matter how source files are getting referenced. There are two sources where stuff can come from:
src is only thought to be used to define which source folders should be used by GWT. Referencing anything that is not in the scope of the same Gradle build is not the intention of this. Everything that comes from the outside of the project should cleanly declared as dependency. Stuff that should only be seen by the Java compiler and GWT compiler but should not be part of the resulting *.war file, can be added using the "gwt" configuration. Two counter questions:
|
A stanza is a block of text, eg dependencies { or repositories { Anyway, it seems like I had something else wrong in my build.gradle file because when I tried a minimal example then dependencies { worked. Prior to this dialogue I didn't know that I could use dependencies { gwt ... }, so it was not a waste of time. Thank-you very much! |
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
}
The text was updated successfully, but these errors were encountered: