I wish to write a shared library to be used in various GWT applications. The shared library will leverage GWT APIs and should not be able to use non-emulated Java classes.
Two questions:
- Is there a plugin for Eclipse that will let me use GWT APIs and flag if I use a non-emulated class (but will simply build a compliant jar rather than a war)? (I know that the standard plugin does this when working in the 'client' area, I just want the same behaviour for the entire source tree)
- If not, is there a Maven/Ant plugin that will help?
For a GWT library, you have to include a GWT module (
*.gwt.xml
file) and the*.java
files in your*.jar
(or in a distinct JAR if you prefer).AFAIK, the Google Plugin for Eclipse uses the information from the
*.gwt.xml
files, theclient
subpackage is not hard-coded; so you should be able to use it the same way as with a GWT application.Finally, you can call the GWT compiler with the argument
-validateOnly
to check that your GWT module uses only translatable classes.