开发者

Debug/view source of GWT generated java code

What are my options for being able to view the generated code from my custom GWT generator (com.google.gwt.core.ext.Generator).

I have been compleplating creating my own source writer that prints out the source in system.out etc, which开发者_开发问答 I have managed to do but it all seems very hard and not very easy to use.

Sometimes I just break the generated code on purpose so that the broken file is printed out in the temp folder, works quite well.

There must be a better way...I'm sure I'm missing something.


To write the generated Java source (i.e. not the generated JavaScript) into a directory when you run the GWT-Compiler, simply add the gwtc compiler option "-gen", with a target directory.


Alternate option is to debug the GWT compilation process which actually calls your generator's generate() method. You can setup a breakpoint at the beginning of your generate() method, and then step through it and inspect what's going on.

For further information on how to do it, you can look into the following:

http://lazyrhino.blogspot.de/2013/10/gwt-generator-part-3-debugging-generation.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜