Hi all,

I am trying to get Gradle to play nicely with GWT (Google Web Toolkit).
I am following the GWT guidelines for source directory structure to be able to get their compiler to work (with a few slight alterations as to the location of the java code). This has left me some problems. Hence this mail. I am new to both GWT and Gradle, so bare with me if this problem has a simple solution - I haven't come across it.

My setup is as follows:

project-root
 |-build.gradle
 |-src
 | |-main
 | | |-java
 | | | |-myPackage/client/*.java
 | | | |-myPackage/server/*.java
 | | | |-myPackage/public/*.css/html/whatever

Now, my trouble is what is included in the war file. GWT is really annoying in that it happily mixes java code and everything else under the src java-package structure. I can't get GWT to work if I move the non-java stuff to somewhere else. Therefore my thought is to divide the waters, so to speak, when generating the war file.

So what should be included in the war file?
1) Everything in the server package.
2) Some of what is in the client package.
3) Whatever is in the public folder should go somewhere in the WEB-INF folder. I haven't begun to solve this part yet.

I would be the happiest if I didn't have to create a whole new zip- routine for zipping my war file (but it might be necessary). Therefore I was trying to exclude some files from the war file (trying to solve bullet 2 from the above). My take on it is in the below build-gradle file, which in my mind should exclude anything in the 'client' package. It doesn't however. Everything from src/main/java is included in the war file and the below completely ignored.

-------build.gradle------------
usePlugin('war')
sourceCompatibility = 1.5
targetCompatibility = 1.5

dependencies {
  addFlatDirResolver('lib', "/lib-repository")
  providedCompile ":servlet-api:2.5"
  providedCompile ":gwt-user:1.5.3"
}

archive_war {
  fileSet(dir: 'classesDir') {
    exclude('**/*.*')
  }
}
-----------------------------

Anyone has any idea of how to exclude some of the .class files from the war file? Or alternatively make GWT play nicely with the default directory layout of Gradle?


Thanks,
Eske


Reply via email to