开发者

GWT compilation on the fly

Is there a way to run Google Web Toolkit compiler directly from Java code to compile th开发者_JS百科e source code made on the fly? In the same manner as javax.tools for example.


GWT compiles all sources at once, because it compiles the result in one file and performs a lot of optimizations, like leaving out methods not used and inline methods to minimize the total size of the JavaScript file generated. A compilation step is therefor takes some time, so compilation on the fly would not be a workable solution.


I think so: com.google.gwt.dev.Compiler has a main method. Either call that method directly, or look into its code, and you should be able to build the CompilerOptions etc. yourself.

When you create a GWT project using webAppCreator, you get a build.xml with a gwtc target. This should help you with the classpath and the arguments you need to run the compiler.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜