在gwt兼容和不兼容源中混合的策略 [英] Strategies for mixing in the gwt compatible and non compatible source

查看:133
本文介绍了在gwt兼容和不兼容源中混合的策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我知道解决这个问题的另一种方法就是从原始创建两个源目录。因此,GWT编译器的类路径将被设置为仅查看兼容的源代码,而这两个代码将用于应用程序的服务器部分。



首先,我发现有点丑陋,因为这意味着我现在有两个源代码目录,可能会有类的双打。


  • IDE的重构和其他结构能力可能会有问题,因为它会令人困惑。 >有时候不可能将一些东西放在不同的包中:认为客户端和服务器包只是因为必须公开某些东西,而这些东西实际上应该是私有的,以限制范围的可访问性。

  • 是否有一个库允许类或方法标记为被GWT编译器忽略?



有没有更好的方法?

解决方案

您可以使用Ant-like includes / excludes从GWT的源路径中排除类(实际上是文件): http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuidePathFiltering
虽然不能排除方法或内部类,但它确实是文件b ASED。请参阅 http://code.google.com/p/ google-web-toolkit / issues / detail?id = 3769


Yes i know one alternative to solving this problem is simply to create two source directories from the original. The class path for the GWT compiler would thus be setup to simply only see the compatible source while both would be used for the server portion of your app.

Firstly i find this kind of ugly, because it means i now have two source directories with potential doubles of classes.

  • refactoring and other structural abilities of the IDE can potentially be problematic as it will get confused.
  • Sometimes its not possible to put some stuff in separate packages: think client and server packages simply because one would then have to make something public which should really be package private to limit scope accessibility.
  • is there a library that enables classes or methods to marked as ignored by the GWT compiler ?

Is there a better way ?

解决方案

You can exclude classes (files actually) from GWT's source path using Ant-like includes/excludes: http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuidePathFiltering You cannot exclude methods or inner classes though, it really is file-based. See http://code.google.com/p/google-web-toolkit/issues/detail?id=3769

这篇关于在gwt兼容和不兼容源中混合的策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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