如何找到GWT排列的根本原因
我有一个相当大的GWT项目,它依赖于许多第三方库。在编译应用程序的GWT部分时,我看到GWT编译器经历了10次排列。但我只针对5种不同的浏览器和一种语言环境进行编译。我怎样才能找出每次排列的原因?我是否可以启用一些设置,以便在编译时打印出每个排列的用途。一些可以给我输出的东西,比如:如何找到GWT排列的根本原因,gwt,Gwt,我有一个相当大的GWT项目,它依赖于许多第三方库。在编译应用程序的GWT部分时,我看到GWT编译器经历了10次排列。但我只针对5种不同的浏览器和一种语言环境进行编译。我怎样才能找出每次排列的原因?我是否可以启用一些设置,以便在编译时打印出每个排列的用途。一些可以给我输出的东西,比如: Compiling Permutation 0 - Browser ie8 and Locale En .... Compiling Permutation 1 - Browser ie9 and Locale
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>
我的猜测是,它正在为英语编译5x,为默认语言环境编译5x(碰巧也是英语)。托马斯·布罗耶的评论让我发现GWT可以制作编译报告:
它给了我一个很好的打印出为什么每个排列被创建。谢谢 当您使用
xsiframe
链接器编译项目时,javascript文件夹中将有一个compilation mappings.txt
文件
它包含一个非常有用的列表,其中包含所有排列以及触发每个排列的属性
F7437BC8947642CC76A8E491E7E52DB4.cache.js
mgwt.os desktop
user.agent safari
F7437BC8947642CC76A8E491E7E52DB4.cache.js
mgwt.os desktop
user.agent gecko1_8
[...]
一旦知道哪些属性会产生每个置换,就可以深入到*.gwt.xml
文件中,了解哪些属性会增加置换数
在您的情况下,如果只使用en
语言,最好不要设置它,因为gwt将只编译default
,否则它将编译default
和en
语言
减少排列的另一个有用选项是使用折叠属性
功能
<collapse-property name="language" values="*" />
我也这么认为,所以我尝试删除默认区域设置。但我还是得到了10个排列。我继承的某个类是否可以添加其他区域设置?您是如何尝试删除默认区域设置的?无论如何,在-extra dir IIRC中应该有一个带有映射的文本文件。