Search This Blog

Create Reusable GWT module

Origin :
http://osdir.com/ml/GoogleWebToolkit/2009-08/msg00838.html



You can follow the steps below to package an existing module, say module A
defined in project A, that you want to reuse in another project, say project
B that defines module B which itself defines an entrypoint class.

1) Create / move all the GWT code that you want to reuse in project A.

2) Create / update the module XML file for module A in the normal way,
except you no longer need to define an entry point class.

3) Create a JAR for project A (project-a.jar), which should include a) GWT
source code that you want to reuse from the project, b) The module XML file,
c) Any other public resources referenced by the module XML file, d) The
binary .class files for any server-side code that you want to reuse

4) Add the project-a.jar file to the project B classpath, as well as any
other launch configurations related to project B (typically hosted mode and
compile configurations).

5) Reference the module A xml file from the module B xml file (e.g.
). Note that since the module
A xml file should already include the name="com.google.gwt.user.User" /> inherits tag, you shouldn't need to add
that reference again to the module B xml file.

You should be ready to go. Give those instructions a try and let us know if
you managed to package and reuse your module.

No comments:

Post a Comment