It basically means that every time I make a
change to the server-side code and want to test it, there is a 60
second delay when I have to wait for the GWT client code to be
compiled, even though it'll never be called and hasn't changed since
the last compile.
I like IntelliJ, for the most part. It's really got a lot of great
features, including the built-in GWT support. But it was just slower
to develop in than eclipse. Plus, I'm using Django on the server and
there is basically no Python support in IntelliJ (I know there is a
plugin, but it hasn't been touched in years and it doesn't provide
much more help than TextWrangler for editing Python files) when
compared to PyDev for eclipse.
Maybe when IntelliJ releases their new version of IDEA, which is
supposed to include lots of great features like what I already have in
eclipse, I might try it again.
Thanks!
Jon Brisibn
http://jbrisbin.com
----- Receiving the following content -----From: waldenReceiver: Google Web ToolkitTime: 2008-07-24, 19:38:41
Subject: Re: GWT4NB compiling even when nothing changed
Jon,
What version of IntelliJ do you have? I'm on version 6.0, which is
fairly old now. In the settings->Google Web Toolkit, there is a "Run
GWT Compiler for Java modules on make" checkbox. I leave it
unchecked.
Walden
----- Receiving the following content -----
From: MNReceiver: Google Web ToolkitTime: 2008-07-24, 16:16:43
Subject: Re: GWT4NB compiling even when nothing changed
Groovy Gant http://gant.codehaus.org/
To get the Gant script and the corresponding build.properties file for
easy GWT deployment to Tomcat, download sample code.
http://www.javaworld.com/resources/jw-04-gwt.zip
</quote>
maybe there some changes possible in the ant scripts of GWT4NB to
avoid a recompile?
on the other hand: why is a full compile needed to start the debug
mode in GWTShell? i ask this because i can change the sourcecode of
the client side without the need to recompile it - i need only refresh
at the GWTShell and i see the changes.
> Please note that there is no dynamic linking in GWT (unlike with Java
> JAR files, Linux shared libs and Windows DLLs). The whole project is
> compiled into one big self-contained blob of JavaScript. Consequently,
> a change in one class may decide how other class which depends on it
> will be compiled. You cannot compile the class which changed without
> recompiling the rest of the classes.
I understand the constraints of the way GWT goes about doing its
business. There are always trade-offs. But I haven't seen much in GWT
that couldn't be massaged into an incremental compile. It probably
*won't* go in that direction (path of least resistance and
all...Google has to balance developer time with net gains as well),
but it *could*. It's also not completely accurate to say that
everything needs to be recompiled for every change. Maybe it does at
the moment because all the results of all that work the compiler does
is just forgotten at the end of the compile run. But dependency maps
could be kept around ("pickled" if you will...I use Python too :) and
used in the compilation process if that was important to the compiler
writers. I'm not naive enough to think it would be easy. But it seems
strategically possible.
> The reason for all of this is
> that GWT concentrates on the end-user experience and less on developer
> convenience.
My comments weren't about my own convenience, they were a reflection
on what my superiors think about things that take me longer to do than
by getting the same results using another technology. Maybe with an
external audience of customers we are begging to drop coin for us
things might be different. But the "customers" of my apps are the
employees of our company. We have to balance how long things will take
to develop against user experience.
Our current portal is hundreds of units of business logic with dozens
upon dozens of very complicated UIs (a mix of plain forms and Ajax)
that are mission-critical. Judging from what I've seen so far with my
smaller projects, if I were to launch into writing one of our
important applications in GWT, the compile time alone would make it
extremely difficult to justify to my superiors that the benefits of
GWT outweigh the increased development time. We have to turn out new
applications all the time at a pretty quick rate. They're all non-
trivial as well. It's not about convenience, but about $$$ and time
(or the lack thereof). GWT cuts my overall forward productivity just
about in half. For a large project that, for example, impacts our SOX
compliance and reporting, I'm just not willing to stick my neck out
there yet. Sorry.
> To facilitate the development process the hosted browser
> seems like your best option.
Not in its current configuration. Out-of-process hosted mode would
integrate very well with our development process, but the current
hosted mode browser paradigm is too different and too difficult to
work with compared to our current workflows. Our developers are not
Web 2.0 gurus. They're doing good just to keep up with traditional
Ajax. If it's more complicated than "edit a file and hit Alt-R to see
changes" they're going to be resistant to it. In eclipse, more than a
minor change in the Java code (while debugging hosted mode) causes you
to have to exit the hosted mode browser (eclipse complains about out-
of-date class files). Every time I have to close the hosted mode
browser and re-start it, I have to go through the login process and
get back to where I was. Unlike Firefox, the hosted mode browser
doesn't save my login information. Besides being annoying, those
little time-consuming speed bumps just plain suck. I'm sure some
developers are masochists enough (there have to be plenty like that
out there...vi is still alive! ;) that they can keep plugging away
telling themselves they're getting a better experience for their end
users so it's okay that I'm beating my head against this wall.
> You may also consider splitting the
> project into two projects, {project.name}-server and {project.name}-
> client and let the server project depend on the client. Then you can
> deploy the JSP pieces independently from the GWT pieces.
I have enough pieces as it is. :) We use a custom MVC-style XML
portal, so we already have quite a few pieces to every application. I
can just imagine what the other developers would say if I showed them
the results of the compile for the small project I'm working on now.
Those compiled files also wreak utter havoc with my Subversion-
controlled stuff. Subversion keeps wanting to replace old copies of
things. I end up with a mess of cache.html files, half of which are
out-of-date. Our automated staging and deployment process is based on
Subversion. It updates things on all the application servers in the
farm automagically. I can't deploy things cleanly any other way.
While I don't like everything about how GWT works at the moment, I
really like the concept of using Java to write Ajax apps. The layout
stuff is great and very solid. But there's no way I can just plug GWT
into our enterprise. There are too many distractions and caveats. If
all you're doing is an app that can be contained in one module and
deploy those files through something like FTP, etc...then I can see
where these small problems can be overcome. But the problems with
hosted mode, the round trip of compilation, and the mess of module
inheritance/dependencies mean we won't be using GWT in any significant
way for a while.
I'll keep using it in my own, smaller projects, though, because I
don't have the same problems of the enterprise here at work.
Thanks!
Jon Brisbin
http://jbrisbin.com
<target name="-post-compile">
<property name="output.js"
location="${build.web.dir}/${gwt.module}/${gwt.module}.nocache.js" />
</target>
<target name="-pre-dist">
<condition property="gwt.compile.needed">
<or>
<not><available file="${output.js}" /></not>
<not>
<uptodate>
<srcfiles dir="${src.dir}" includes="**/client/**/*.java" />
<mergemapper to="${output.js}" />
</uptodate>
</not>
</or>
</condition>
<antcall target="do-gwt-compile" />
</target>
<target name="do-gwt-compile" if="gwt.compile.needed">
<!-- You can override this property in the 'gwt.properties' file -->
<property name="gwt.compiler.output.style" value="OBFUSCATED"/>
<property name="gwt.compiler.logLevel" value="WARN"/>
<java classpath="${javac.classpath}:${src.dir}" failonerror="true"
classname="com.google.gwt.dev.GWTCompiler" fork="true" maxmemory="512m">
<arg value="-out"/>
<arg path="${build.web.dir}/"/>
<arg value="-style"/>
<arg value="${gwt.compiler.output.style}"/>
<arg value="-logLevel"/>
<arg value="${gwt.compiler.logLevel}"/>
<arg value="${gwt.module}"/>
</java>
<property name="gwt.output.dir" value="${gwt.module}"/>
<move todir="${build.web.dir}/${gwt.output.dir}">
<fileset dir="${build.web.dir}/${gwt.module}"/>
</move>
</target>
As you can see, we also move the GWT compilation to pre-dist instead of
post-compile. I've also got the maxmemory set for the compile.
Hope this helps!
<?xml version="1.0" encoding="UTF-8"?>
<project name="etude" default="default" basedir=".">
<description>Builds, tests, and runs the project etude.</description>
<import file="nbproject/build-gwt.xml"/>
<import file="nbproject/build-impl.xml"/>
<target name="-post-compile">
<property name="output.js"
location="${build.web.dir}/${gwt.module}/${gwt.module}.nocache.js" />
</target>
<target name="-pre-dist">
<condition property="gwt.compile.needed">
<or>
<not>
<available file="${output.js}" />
</not>
<not>
<uptodate>
<srcfiles dir="${src.dir}"
</project>
This target depends on the updating of the <module>.nocache.js file in your web
directory, so it'll be up-to-date until you change your client source code ;)
Have fun!