GWT编译器忽略方法的注释 [英] Annotation for GWT compiler to ignore method

查看:135
本文介绍了GWT编译器忽略方法的注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建注释(或其他方式)来强制GWT编译器不编译方法?我有一个我也在应用程序引擎上使用的类(在一个共享文件夹中),其中的一个方法需要服务器端唯一的函数,导致GWT不能编译。我想让GWT忽略这个方法(而appengine不会)。



我想出了一个注释,或者是一个预编译脚本,在编译之前擦除该方法。这两种方法都适用于我,如果我仍然可以通过eclipse IDE进行编译,那将是最好的选择。



其他人想到这个或尝试过吗? b $ b

解决方案

直到现在。最近,这样的注释添加了 @ com.google.gwt.core.shared.GwtIncompatible(Description why ...)。它适用于类或方法。



但修补后的代码还没有发布!官方身份是 FixedNotReased 。我可以亲自确认,它不在当前的GWT 2.5.1版本中。我对即将到来的2.5.2抱有希望。



见:

http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/core/shared/GwtIncompatible.java?spec=svn11570&r= 11570



http://code.google.com/p/google-web-toolkit/issues/detail?id=3769



https://gwt-review.googlesource.com/#/c/2320/



请注意,已经有类似的注释 com.google.gwt.thirdparty.guava.common.annotations.GwtIncompatible gwt-dev.jar ,但是
不起作用,编译器仍然希望编译共享中的不兼容方法类。


Is it possible to create an annotation (or some other way) to force the GWT compiler to not compile a method? I have a class that I also use on app-engine (in a shared folder) and one method in it requires a server side only function which causes GWT to not compile. I would like GWT to just ignore the method (while appengine does not).

I figured either an annotation, or a pre-compile script that erases the method prior to compilation. Both methods would work for me, it would be best if I could still compile through the eclipse IDE.

Anyone else thought of this or tried it?

解决方案

Not until now. Very recently such annotation was added @com.google.gwt.core.shared.GwtIncompatible("Description why..."). It is applicable on classes or methods.

But the patched code was not released yet! Official status is FixedNotReleased. And i can personally confirm, it is not in current GWT 2.5.1 version. I am hopeful for upcoming 2.5.2.

See:

http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/core/shared/GwtIncompatible.java?spec=svn11570&r=11570

http://code.google.com/p/google-web-toolkit/issues/detail?id=3769

https://gwt-review.googlesource.com/#/c/2320/

Note, there is already similar annotation com.google.gwt.thirdparty.guava.common.annotations.GwtIncompatible in gwt-dev.jar, however it does not work, compiler still wants to compile my incompatible method in shared class.

这篇关于GWT编译器忽略方法的注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆