gwt - 如何找到 GWT 排列的根本原因

标签 gwt

我有相当大的 GWT 项目,它依赖于许多第三方库。在编译应用程序的 GWT 部分时,我看到 GWT 编译器经历了 10 次排列。但我只为 5 种不同的浏览器和一种语言环境进行编译。我怎样才能弄清楚是什么导致了每个排列?是否有一些设置我可以启用,打印出每个排列在编译时的用途。一些会给我输出的东西:

Compiling Permutation 0 - Browser ie8 and Locale En  ....
Compiling Permutation 1 - Browser ie9 and Locale En  ....

我的 gwt.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  When updating your version of GWT, you should also update this DTD reference,
  so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.0//EN"
   "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='LibraryPlace'>

   <inherits name="com.github.gwtbootstrap.BootstrapNoResources"/>
   <inherits name='com.biglibrary.libraryplace.model.LibraryModel'/>
   <inherits name="com.biglibrary.common.LiCommon"/>
   <inherits name="org.atmosphere.gwt20.AtmosphereGwt20"/>
   <inherits name='com.google.web.bindery.event.EventBinder'/>
   <inherits name="com.google.gwt.logging.Logging"/>

   <stylesheet src="/css/datepicker.css"/>

   <!-- LATO font -->
   <!--<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic">-->
   <!-- Bootstrap CSS -->
   <stylesheet src="http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic"/>
   <!--<stylesheet src="/css/bootstrap.css"/>
   <stylesheet src="/css/bootstrap-responsive.css"/>-->

   <stylesheet src="/css/toastr.css"/>
   <stylesheet src="/css/fullcalendar.css"/>
   <!-- Library Place New Custom CSS based on MyAdmin Theme Custom CSS -->
   <stylesheet src="/css/style.css"/>

   <stylesheet src="/css/clock/clock-style.css"/>


   <source path='resources'/>
   <replace-with class="com.biglibrary.libraryplace.resources.LibraryConfigurator">
      <when-type-is class="com.github.gwtbootstrap.client.ui.config.Configurator"/>
   </replace-with>
   <public path="resources">
      <exclude name="** /*.java"/>
      <exclude name="** /*.class"/>
   </public>


   <!-- Other module inherits-->
   <inherits name="de.devbliss.gwt.xdm.XDM"/>
   <inherits name="com.watopi.chosen.Chosen"/>

   <!-- enable @CORS annotations in restygwt -->
   <extend-configuration-property
      name="org.fusesource.restygwt.annotationresolver"
      value="org.fusesource.restygwt.rebind.CORSAnnotationResolver"/>

   <replace-with class="de.devbliss.gwt.xdm.client.impl.CORSTransportLayer">
      <when-type-is class="com.biglibrary.libraryplace.client.xdr.XDRTransportLayer"/>
      <any>
         <when-property-is name="user.agent"
                           value="gecko1_8"/>
         <when-property-is name="user.agent"
                           value="safari"/>
      </any>
   </replace-with>

   <inherits name="com.google.gwt.logging.Logging"/>

   <!-- gwt logging properties -->
   <set-property name="gwt.logging.logLevel"
                 value="FINE"/>

   <set-property name="gwt.logging.popupHandler"
                 value="ENABLED">
      <any>
         <when-property-is name="user.agent"
                           value="ie8"/>
         <when-property-is name="user.agent"
                           value="ie9"/>
      </any>
   </set-property>

   <!--Gives java like stack trace for errors that come up in js-->
   <set-property name="compiler.emulatedStack"
                 value="true"/>
   <set-configuration-property
      name="compiler.emulatedStack.recordFileNames"
      value="true"/>


   <!-- Specify the app entry point class.                         -->
   <entry-point class='com.biglibrary.libraryplace.client.LibraryPlace'/>

   <!--Chrome or Safari-->

   <set-property name="user.agent" value="opera,ie8, gecko1_8, safari, ie9"/>

   <!-- Specify the paths for translatable code                    -->
   <source path='client'/>

   <define-configuration-property name="gin.ginjector"
                                  is-multi-valued="false"/>
   <set-configuration-property name="gin.ginjector"
                               value="com.biglibrary.libraryplace.client.gin.AppGinjector"/>
   <!--
   Ensure Ui Binder files are using Safe HTML to prevent XSS.
   -->
   <set-configuration-property name="UiBinder.useSafeHtmlTemplates"
                               value="true"/>
   <!-- English language, independent of country. -->
   <extend-property name="locale"
                    values="en"/>

   <!-- Default language (English) -->
   <set-property-fallback name="locale"
                          value="en"/>

   <add-linker name="xsiframe"/>
   <set-configuration-property name="gwt.superdevmode"
                               value="on"/>
   <set-configuration-property name="devModeRedirectEnabled"
                               value="true"/>
   <set-property name="compiler.useSourceMaps"
                 value="true"/>
</module>

最佳答案

当您使用 xsiframe 编译项目时链接器你将有一个 compilation-mappings.txt文件在您的 javascript 文件夹中。

它包含一个非常有用的列表,其中包含所有排列和触发每个排列的属性。

 F7437BC8947642CC76A8E491E7E52DB4.cache.js
 mgwt.os desktop
 user.agent safari 

 F7437BC8947642CC76A8E491E7E52DB4.cache.js
 mgwt.os desktop
 user.agent gecko1_8
 [...]

一旦您知道哪些属性会产生每个排列,您就可以深入了解 *.gwt.xml文件以了解哪些属性正在增加排列数。

就您而言,如果您只使用 en语言,最好不要设置它,因为gwt只会编译default , 否则就是编译 defaulten语言。

另一个减少排列的有用选项是使用 collapse-property特征。
 <collapse-property name="language" values="*" />

关于gwt - 如何找到 GWT 排列的根本原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21267009/

相关文章:

ruby-on-rails - JRuby on Rails Production 响应 200 OK 即使 Controller 代码设置状态 :unauthorized

gwt - SimplePager 行计数工作不正常

java - 启用 GZIP 是 GWT 应用程序

tomcat - 在浏览器崩溃时处理 session 的默认方式是什么

gwt - POJO 编码器/解码器 : JAX-RS JSON matched with GWT client JSON

java - 如何确定我的服务器可以支持特定应用程序的用户数量

GWT 在页面/面板之间滑动

gwt - IntelliJ IDEA 10 社区版和 GWT 插件

css - 在 GWT 中将 css 与自己的类一起使用

gwt - 使用 GXT 时存在大量 GWT 排列