Compiler output change

8 views
Skip to first unread message

Ciciban

unread,
Aug 5, 2008, 9:44:03 PM8/5/08
to Google Web Toolkit
fairly new to GWT, but I'm stuck on this one:
When GWTCompiler creates output is there a way to change module name:
e.g: module is com.mycompany.package which generates output of
"out_path\com.mycompany.package\generated_files"

Is there any way to instruct GWTCompiler to create something like
"out_path\out_folder\generated_files" ?

walden

unread,
Aug 6, 2008, 1:54:31 PM8/6/08
to Google Web Toolkit
I don't believe so, but that's a feature not a bug. Generally, you
let the GWT compiler generate its output in a scratch location (where,
by the way, the fully qualified package name helps prevent you from
stepping on yourself), and then copy what you need wherever you need
it, including changing the folder name, if that's what you want.

Walden

Thomas Broyer

unread,
Aug 6, 2008, 6:20:32 PM8/6/08
to Google Web Toolkit
<module> has a rename-to attribute:

<module rename-to="out_folder">

Ciciban

unread,
Aug 6, 2008, 11:03:04 PM8/6/08
to Google Web Toolkit
After changing <module> to <module rename-to="out_folder"> compiler
did output files into "out_path\out_folder\generated_files"
However, ModuleName.html has following:
<script type="text/javascript" language="javascript"
src="com.mycompany.package.nocache.js"></script>

Problem is that com.mycompany.package.Hello.nocache.js is never
generated by the compiler.
Compiler actually generates out_folder.nocache.js when rename-to is
used, so ModuleName.html should have
<script type="text/javascript" language="javascript"
src="out_folder.nocache.js "></script>

Not sure if this is Compiler bug or I'm just missing another setting.
I'm using 1.5 RC1

Sumit Chandel

unread,
Aug 11, 2008, 8:06:49 PM8/11/08
to Google-We...@googlegroups.com
Hi Ciciban,

What you've discovered is actually a feature rather than a bug. The <module rename-to="something"> attribute is made to have a drop-in module so that it's easy to switch between different compilation or other module settings for your GWT project.

A typical use case for using a drop-in module is if you only want to generate one specific version of your application (say, for Firefox) when compiling your module for web mode testing. It would be a bit of a pain to toggle the configurations on / off in your main module XML file because you want to compile for Firefox only during your testing cycles and compile for all browsers during release testing. By allowing you to use a <module rename-to="something"> attribute, you can have a second module XML file that you can use in parallel to your main module XML that can generate specific application files per your alternate configuration settings in a separate directory.

For your specific case of wanting to generate the default output in a path that excludes the com.mycompany.package subdirectory, you'll want to follow Walden's advice in adding a copy task to your build or release process to have the generated contents moved over from the output directory to the directory where you want to deploy your GWT application files.

Hope that helps,
-Sumit Chandel
Reply all
Reply to author
Forward
0 new messages