Hi Here,
I have been given the task in researching getting our Ant based GWT project int Gradle and so far, everything I have seen about gradle, I have loved however I’m struggling with the “correct” approach as opposed to a “it works” approach and want to achieve a nice rich decoupled set of projects.
The problem we have (as will most GWT projects) are that we use a GWT Compiler that reads the byte & source code to build the javascript output files that are published to the ROOT of the Web-App application
As we use shared byte code for the GWT-RPC calls (rich DTO), these are a dependency for the GWT-Compiler but also need to be web-application for the server. this is currently located with the GWT client java files.
So far; simple I would say - we need 2 distinct projects,
:1 - :Client with no dependencies. I can get the Gwt-Js-Files to be outputted which was quite trivial when following http://goo.gl/INbkj :2 - :Server; project responsible for compiling the server code and build the web application; as with the Client DTO Objects, this has a dependency on :Client & this uses the WAR Plugin
We believe this is the best structure at this time (there was talk about exploding the Shared but this introduces a whole new set of issues).
I can get close but each I fail based on a few key but important issues requirements.
-
As :Client is a dependency on :Server, the GWT Byte code & the GWT-Compiler external libraries are getting included in the artefact, this is not correct as we don’t need the the compiler dependencies or the client byte code but we do need the shared DTO byte code and the JS Code - so for example, we only need all the byte code from com.example.gwt.shared.** included in the web-application…
-
As the compileGWT is a dependency that needs to run after the compileJava task - i need to “Tag” on the post process of calling the compileGWT task when the process has finished…
Sorry for the essay - my questions are;
1: From the output of :client, can i only take a subset of the byte code elements (the com.example.gwt.shared.*) and put them in the web-app from the :server build script?
2: Can I stop the WAR plugin in :server for taking the :client GWT-Compiler dependency and putting it as a dependency of the web-app?
3: Can I get the WAR plugin to copy the :client JS output, e.g. something like
from :client/$gwtOutputDirectory
?
4: Can I get the :Client to execute the gwtCompile task when the javaCompile process finished and for the gwtCompile to get a handle on the output bytecode directories?
At this stage - i’m cautious to suggest we take the “Jump” at this time but know what i’m looking is feasible and know gradle is what we need but don’t want to land myself with a “dirty” gradle build script which going forward is a nightmare to maintain (like out build.xml script today )
Any advice, no matter how short or simple would help me greatly in this.
Many Thanks and thanks for reading,
Ian…