Several modules in project/package

7 views
Skip to first unread message

Konstantin Scheglov

unread,
Sep 30, 2006, 4:01:59 PM9/30/06
to Google Web Toolkit

Can anybody explain how can be useful approach with several modules
in same project or even in same package? I can understand that
splitting project on several modules can be used for sharing some
modules between different GWT applications. But keeping them in same
project causes problems with deployment.

For example, we have project with two modules com.company.module_1
and com.company.module_2, each has client/server/public sub-packages.
There is also just package with Java code used... in both parts of GWT
application, in client and in server.

Now we want deploy module_2 and it is not inherits module_1, they are
separate. What classes should be deployed? Should we just jar "bin"
project of our project without checking to which module belongs each
file? Or may be deploy only classes from module's "server"? But what
about separate package with utilities used from "server"?

Deployment is IMHO not easy even in case of single module in project,
but keeping several modules in single project makes it even harder.
Several modules in same package is IMHO just madness.

ash

unread,
Oct 4, 2006, 9:30:58 PM10/4/06
to Google Web Toolkit
sorry for the late reply,

> Can anybody explain how can be useful approach with several modules
in same project or even in same package?

i have an example of several non-entrypoint based modules within the
same project. i have organised it that way to reduce the overhead of
too many small projects.

the
http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.ProjectStructure.html

illustrates 3 modules in the same package. i have not had any
experience with test-case based module definitions, but the only
rationale that i think of for the motivation of Calendar.gwt.xml &
CalendarApp.gwt.xml would be is that the designer intends calendar to
be re-used in another project without the cal-app's entry point causing
a conflict.


> Deployment is IMHO not easy even in case of single module in project,

imho a module is a logical concept and i suspect the tension that you
describe is as a result of an unclear mapping to a physical target.

the source for the module defaults to be in the client path. but
modules support the external <source/> and <public/> definitions. it is
unclear whether you can have more than one source/public elements. in
any case two modules could potentially point to the same source. i
havent tried any of these odd sort of combinations.

in the calendar example, how could one know which assemblies (ie.
source/binaries & public) are part of the re-usable calendar component
as opposed to the cal-app when attempting to create binaries?

i think a tool such as yours needs to provide an editor over a
descriptor of the composition of each module and which binary target it
is assembled into.

konstantin, i have to admit, this is not a task that i associate doing
in your tool but rather a build script.

in my mind your tool helps me build gwt elements a little faster within
a hosted environment. with your line of questioning, i feel like your
getting gwt-designer to a address a deployment problem which is
non-trivial and subject to other influences.

rgds ash
http://www.gworks.com.au

Eric B

unread,
Oct 4, 2006, 11:23:39 PM10/4/06
to Google Web Toolkit
I have multiple modules in a single project and I'm developing with
eclipse.

The question I have for you using Eclipse and if so are you trying
compile or run in hosted mode?

If you are using Eclipse, then here's how I compile. I use an ant
target, like this:

<java classname="com.google.gwt.dev.GWTCompiler"
dir="C:/dev/bin/googlewebkit" fork="true">
<classpath>
<pathelement path="${basedir}/bin" />
<pathelement path="${basedir}/src/main/java" />
</classpath>
<classpath refid="project.class.path" />
<arg value="-logLevel" />
<arg value="WARN" />
<arg value="-style" />
<arg value="PRETTY" />
<arg value="-out" />
<arg value="${basedir}/${output.dir}" />
<arg value="package.path.of.my.module" />
</java>

Please note that the compiler class has to run in the directory where
you have your GWT jars, hence the dir="C:/dev/bin/googlewebkit"
attribute.

If you're using Eclipse and want to debug in hosted mode, then here are
the steps I use:

1. Goto Run < Debug ...
2. Select Java Application from the list on the left
3. Right-click on Java Application and choose New
4. Enter the following in the Main tab
Project: <your project>
Main Class: com.google.gwt.dev.GWTShell
5. Enter the following in the Arguments tab
Program Arguments: -port 8888 -out <output dir> -style PRETTY
package.path.to.your.module/module.html
(The following is not entirely necessary)
VM Arguments: -Xmx128M
6. In the Classpath tab, add your source and bin directories to the
User Entries node if not already added. Also add all the GWT jars and
any 3rd party jars you use.
7. Click Apply in the bottom left
8. Click Debug in the bottom left

Now all you have to do to debug your app is to hit F11, the debug icon
in your toolbar, or Run > Debug History > <Your debug config>

You'll have to create a java ant tag and a debug launch configuration
for each module in your project.

I hope this was helpfull,
Eric

Konstantin Scheglov

unread,
Oct 5, 2006, 5:15:32 PM10/5/06
to Google Web Toolkit

ash wrote:

> konstantin, i have to admit, this is not a task that i associate doing
> in your tool but rather a build script.

Well, and in reallity this is exactly how deployment is now
implemented in GWT Designer. ;-)

It will generate ANT build script and run in. I've just commited
initial deployment support, so next build will have it.


> in my mind your tool helps me build gwt elements a little faster within
> a hosted environment. with your line of questioning, i feel like your
> getting gwt-designer to a address a deployment problem which is
> non-trivial and subject to other influences.

Yes, but I feel that deployment is important thing at least to help
newbies to start, give them something to read/tweak and write better
scripts if they are not fully satistied by existing ones.

Reply all
Reply to author
Forward
0 new messages