rapodaca: The GWTCompiler is simply what drives the myProject-compile
command; it does the same thing (translates a whole bunch of things
into a single JS file), so I doubt its what you're looking for.

What you want can't really be done. Java isn't javascript. Take your
example just to illustrate the problem here: How would that even
translate to javascript? Javascript doesn't have classes. It has
prototype based inheritance. Here are your fundamental problems:

 1. Javascript's namespacing and object model is so different, that
GWT internally generates completely different and unwieldy names for
objects and classes. These names are then mangled to unrecognizable
shortcodes to reduce the size of the output JS. So, your public void
hello method is either going to be called: "com.mypackage.Hello::talk
()" (yes, including closing parentheses to indicate that this version
takes no parameters; unlike javascript, in java two methods with the
same name but different parameter lists are completely separate, in
javascript you can't do that), or it's going to be called something
small and effectively random, so something like 'xYq' or some such.
There's no code to pick a sane name for interaction, so nothing there
that would even think to generate just a function called "hello".

 2. There's a base set of functions that all GWT projects start out
with. The GWT compiler assumes this basis is there.

 3. GWT does something called platform targeting. That's why it
generates a number of JS files - one for each target platform. Out of
the box, there are already multiple platforms (1 for each major
supported browser, so there's an Opera, an IE, a Gecko, and a Webkit).
I'm not entirely sure but I believe the base, talked about in #2, is
already written specifically for each target browser platform.


If you are in the market to build such a tool, The GWT sources are a
great place to start, but unless you're willing to dig in for a few
weeks and do a lot of dev work, I don't think GWT can do what you
want.

NB: I'm not an expert on the GWT internals so I might have made a few
mistakes, but I'm fairly sure the above is true. #1 is certainly true,
and already a big deal for you.


On Jan 7, 7:20 am, rapodaca <rich.apod...@gmail.com> wrote:
> On Jan 6, 5:58 pm, Ziyod <ziyod2...@gmail.com> wrote:
>
> > Use GWTCompiler it's part of the com.google.gwt.dev.GWTCompiler
> > package
> > Create a gwtCompiler.cmd file and insert this command:
> > @java -cp "%~dp0\gwt-user.jar;%~dp0\gwt-dev-windows.jar"
> > com.google.gwt.dev.GWTCompiler %*
>
> Hello Ziyod,
>
> Thanks for the information. I'm on Linux, but my best guess for
> translation is (creating file GWT_INSTALL/gwtCompiler):
>
> java -cp $HOMEDIR/gwt-user.jar:$HOMEDIR/gwt-dev-linux.jar
> com.google.gwt.dev.GWTCompiler "$@";
>
> This is based on the projectCreator script provided in the
> installation.
>
> I notice that HOMEDIR is not set so I go:
>
> $ export HOMEDIR=~/tmp/gwt-linux-1.5.3
>
> Then I try:
>
> $ ./gwtCompiler com.example.Test
> Loading module 'com.example.Test'
>    [ERROR] Unable to find 'com/example/Test.gwt.xml' on your
> classpath; could be a typo, or maybe you forgot to include a classpath
> entry for source?
> [ERROR] Build failed
>
> I'm not sure what happened or what the com/example/Test.gwt.xml file
> refers to. Any ideas of how to generate it and where to save it?
>
> > Find out more:http://www.screaming-penguin.com/GWTDocs
>
> That's a good command summary, but unfortunately, I don't see any
> example usage.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to