source path and different source folders

78 views
Skip to first unread message

tm

unread,
Jul 31, 2006, 11:14:44 AM7/31/06
to Google Web Toolkit
Hi,

my gwt.xml has the 2 source pathes <source path="client" /> and <source
path="common" />. This works fine as long as as both packages are in
the same source folder, eg. /src/foo/client and /src/foo/common where
/src is the source folder.
But if I want to use different source folders, such as
/src/client/foo/client and /src/common/foo/common where /src/client
respectively /src/common are the source folders it doesn't work. (Both
folders are in classpath)

Here is the output of my ant task (it's better to copy & paste, but
it's the same in hosted mode)

gwtcompile:
[java] Analyzing source in module foo.bar'
[java] [ERROR] Errors in '/home/tobias/..
.../src/client/foo/client/bar.java'
[java] [ERROR] Line 16: The import foo.common cannot be resolved
[java] [ERROR] Line 43: FooDto cannot be resolved to a type
[java] [ERROR] Line 43: FooDto cannot be resolved to a type
[java] [ERROR] Errors
...
[java] [ERROR] Build failed


Is there a problem with my configuration or doesn't GWTCompiler take
multipe source folders into consideration?

Thanks,
Tobias

Slava

unread,
Jul 31, 2006, 11:56:52 AM7/31/06
to Google Web Toolkit
+1. I wanted to create project with multiple gwt modules placed in
different packages.I wished they to use common source from outer
package, but compiler can't find them.

Mat Gessel

unread,
Jul 31, 2006, 12:52:06 PM7/31/06
to Google-We...@googlegroups.com
AFAIK, the GWT compiler first looks for module descriptors on the
classpath, then finds source in directories *relative* to the xml
file. This is different than what we're used to in Java, so it can be
confusing at first.

What you need to do is create a module for your common code and
inherit it also.

-= Mat

--
Mat Gessel
http://www.asquare.net

tm

unread,
Jul 31, 2006, 1:19:08 PM7/31/06
to Google Web Toolkit
Thanks Mat, it works!

For people with the same problem, here is what I did in detail:
added common.gwt.xml:
<module>
<source path="common" />
</module>
to the common source folder (in package foo) and added the line
<inherits name="foo.common"/>
to my old gwt.xml conf file.

That's all.


Tobias

marsh...@gmail.com

unread,
Aug 29, 2006, 10:39:51 AM8/29/06
to Google Web Toolkit
I've had the same problem as above except that the code I'd like use
lives in a completely different directory structure on another drive.
The above had it all under the same source tree.

So we've resolved that the common code needs to have a module defined
for it in its src folder

and we know we need to inherit the module in the app.gwt.xml file

but how does the GWT compiler find this common module if it lives
somewhere else?

Don't we need to define a path to this other module somewhere?
If my common code lives in C:\gwtcommon\src, how would I set up my app
to pull in the common module?

thanks, dm

marsh...@gmail.com

unread,
Aug 29, 2006, 12:03:44 PM8/29/06
to Google Web Toolkit
Answer:
The path to the common module needs to be put in the classpath (for me
that is the XXX-compile.cmd and XXX-shell.cmd ) files that run the GWT
compiler.

Reply all
Reply to author
Forward
0 new messages