GWT编译器 - 只有一个渗透正在构建

时间:2016-09-27 13:12:58

标签: gwt

我正在运行gwt-2.8.0-SNAPSHOT并且已经运行了一段时间。我不记得它什么时候开始发生或者是什么引起了它,但我的编译只是构建了一个单一的排列。它不是为每个浏览器编译排列。我确实有一段时间后配置了用户代理标志,但早已被删除。我已经检查了我的pom.xml以查找可能导致这种情况发生的任何特定标志,我已经检查了其他继承模块的user.agent标志,但似乎找不到任何东西。我还启用了编译所有日志记录,但没有找到问题。我假设gwt-2.8.0-SNAPSHOT没有将此选项配置为仅构建单个排列。

更新1

我只编译生产模块。亚当明智地指出,我在开发模块中使用的全部属性崩溃将构建一个单独的编译。生产模块没有采用这种方法,并且为了确保这一点,我对其进行了评论。我有一个想法,在生产模块中添加所有可能的user.agents。当我这样做时,我得到的错误是我无法重新定义user.agent。我有一种感觉,其中一个继承的模块正在设置此属性。我尝试将loglevel设置为ALL以查看我是否可以确定哪个模块正在设置属性但没有运气。我将继续挖掘,直到找出导致此问题的模块。

<define-property name="user.agent" values="ie8,gecko1_8,safari,ie9,ie10"></define-property>

更新2

我通过对生产模块中的所有user.agents使用set-property找到了一个临时工作。我仍然不知道这个属性将被设置在哪里。我浏览了一些继承的模块,但无法找到罪魁祸首。

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

通用模块

公共模块在开发和生产模块之间共享。它具有所有继承和通用定义。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module>

    <inherits name="com.google.gwt.user.User" />
    <inherits name="com.google.gwt.place.Place" />
    <inherits name="com.google.gwt.activity.Activity" />
    <inherits name="com.google.gwt.logging.Logging" />
    <inherits name='com.google.gwt.inject.Inject' />


    <inherits name="gwt.material.design.GwtMaterialWithJQuery" />
    <inherits name="gwt.material.design.GwtMaterialTableDebug" />
    <inherits name="gwt.material.design.GwtMaterialDesignBasic" />
    <inherits name="gwt.material.design.addins.GwtMaterialAddins" />
    <inherits name="gwt.material.design.themes.GwtMaterialThemeBlue" />

    <inherits name="com.googlecode.gwt.charts.Charts" />

    <!-- Maps -->
    <inherits name='com.google.gwt.maps.Maps' />

    <!-- Maybe remove -->

    <inherits name='com.google.common.base.Base' />
    <inherits name="com.google.common.collect.Collect" />
    <inherits name="com.google.common.util.concurrent.Concurrent" />
    <inherits name="com.google.common.cache.Cache" />

    <inherits name='com.googlecode.gflot.GFlotJQueryNoConflict' />
    <inherits name="org.fusesource.restygwt.RestyGWT" />

    <!-- Adding temporal support -->
    <replace-with class="com.upsnap.dsp.web.client.temporal.ChronoUnit">
        <when-type-is class="java.time.temporal.ChronoUnit" />
    </replace-with>

    <public path='view/resource'>
        <include name='css/*.css' />
        <include name='js/*.js' />
    </public>

    <set-property name="restygwt.autodetect.plainText" value="true" />

    <!-- This is so gflot doesn't fail This should almost assuredly be disabled 
        for production -->
    <set-configuration-property name='xsiframe.failIfScriptTag'
        value='false' />


    <!-- May be dangerous, do some more investigation 8-2016 -->
    <!-- <set-configuration-property name="compiler.enum.obfuscate.names" value="true" 
        /> -->

    <!-- Enabling GSS will tell the GWT compiler to use GSS for all CssResource 
        interfaces. This flag can either be “false” (default) or “true”. -->
    <set-configuration-property name="CssResource.enableGss"
        value="true" />

    <!-- If GSS is enabled and the GWT compiler finds a .css file, it will first 
        convert this file to gss and then feed it into GSS on the fly. Gradual GSS 
        migration -->
    <set-configuration-property name="CssResource.conversionMode"
        value="strict" />

    <source path='client' />
</module>

制作模块

is是生产模块。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='dsp'>

    <inherits name="com.upsnap.dsp.web.DspCommon" />

    <set-property name="gwt.logging.enabled" value="TRUE" />
    <set-property name="gwt.logging.logLevel" value="INFO" />

    <set-property name="compiler.stackMode" value="strip" />

    <!-- Form Factor support -->
    <replace-with class="com.upsnap.dsp.web.client.DesktopInjectorProvider">
        <when-type-is class="com.upsnap.dsp.web.client.InjectorProvider" />
    </replace-with>

</module>

开发模块

这是用于调试等的开发模块。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='dsp'>

    <inherits name="com.upsnap.dsp.web.DspCommon" />

    <set-property name="gwt.logging.enabled" value="TRUE" />
    <set-property name="gwt.logging.logLevel" value="FINE" />

    <set-property name="compiler.stackMode" value="emulated" />
    <set-configuration-property name="compiler.emulatedStack.recordFileNames"
        value="true" />
    <set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
        value="true" />

    <collapse-all-properties />

    <!-- Form Factor support -->
    <replace-with class="com.upsnap.dsp.web.client.DesktopInjectorProvider">
        <when-type-is class="com.upsnap.dsp.web.client.InjectorProvider" />
    </replace-with>

</module>

POM

pom.xml摘录gwt插件。

<configuration>
    <disableCastChecking>true</disableCastChecking>
    <disableClassMetadata>true</disableClassMetadata>
    <style>PRETTY</style>
    <logLevel>INFO</logLevel>
    <runTarget>dsp.html</runTarget>
    <hostedWebapp>${war.directory}</hostedWebapp>
    <webappDirectory>${war.directory}</webappDirectory>
    <copyWebapp>true</copyWebapp>
    <localWorkers>4</localWorkers>
    <modules><module>com.upsnap.dsp.web.DevelopmentDesktop</module>
    </modules>
    <extraJvmArgs>-Xms1024M -Xmx2048M -Dgwt.compiler.enableClosureCompiler=true</extraJvmArgs>
</configuration>

输出

这是编译声明的输出,即只构建了1个排列。

[INFO] --- gwt-maven-plugin:2.8.0-SNAPSHOT:compile (default) @ dsp-web ---
[INFO] Loading inherited module 'com.upsnap.dsp.web.DevelopmentDesktop'
[INFO]    Loading inherited module 'com.upsnap.dsp.web.DspCommon'
[INFO]       Loading inherited module 'gwt.material.design.GwtMaterialWithJQuery'
[INFO]          Loading inherited module 'gwt.material.design.GwtMaterialDesignBase'
[INFO]             [WARN] Line 45: Setting configuration property named 'CssResource.legacy' in module 'gwt.material.design.GwtMaterialDesignBase' that has not been previously defined
[INFO] Compiling module com.upsnap.dsp.web.DevelopmentDesktop
[INFO]    Ignored 9 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]    Computing all possible rebind results for 'com.upsnap.dsp.web.client.rest.ExtraCodecs.ErrorResponseCodec'
[INFO]       Rebinding com.upsnap.dsp.web.client.rest.ExtraCodecs.ErrorResponseCodec
[INFO]          Invoking generator org.fusesource.restygwt.rebind.JsonEncoderDecoderGenerator
[INFO]             Generating: com.upsnap.dsp.web.client.rest.ExtraCodecs_ErrorResponseCodec_Generated_ExtendedJsonEncoderDecoder_
[INFO]                checking: org.fusesource.restygwt.client.JsonEncoderDecoder, type: class com.google.gwt.dev.javac.typemodel.JParameterizedType
[INFO]    Compiling 1 permutation
[INFO]       Compiling permutation 0...
[INFO]    Compile of permutations succeeded
[INFO]    Compilation succeeded -- 33.295s
[INFO] Linking into /Users/chinshaw/devel/workspace/upsnap/dsp/modules/web/target/dsp-web-0.0.1-SNAPSHOT/dsp
[INFO]    Invoking Linker Cross-Site-Iframe
[INFO]       Ignoring the following script tags in the gwt.xml file
[INFO] jquery-1.8.3.min.js
[INFO] jquery-noconflict.js
[INFO] 
[INFO]    Link succeeded
[INFO]    Linking succeeded -- 0.174s
[INFO] 

1 个答案:

答案 0 :(得分:2)

这是因为您使用的是<collapse-all-properties />。这意味着,它不是为每个用户代理生成排列,而是为所有用户代理生成一个排列。