2016-09-27 35 views
0

我正在運行gwt-2.8.0-SNAPSHOT,並且已經運行了一段時間。我不記得它何時開始發生或者是什麼原因造成的,但是我的彙編只是建立一個單一的排列。它不會編譯每個瀏覽器的排列。我確實已經配置了一段時間的用戶代理標誌,但很久以前就被刪除了。我檢查了我的pom.xml中是否有可能導致這種情況發生的特定標誌,我檢查了其他繼承的user.agent標誌模塊,但似乎無法找到任何東西。我也啓用了編譯ALL日誌記錄,但沒有看到發現問題。我假設gwt-2.8.0-SNAPSHOT沒有配置這個選項來構建一個單一的排列。GWT編譯器 - 只有一個滲透正在建設

更新1

我只編譯只生產模塊。 Adam明智地指出,我在開發模塊中使用的全部屬性將構建一個單一的編譯。這並沒有被生產模塊所接受,並且爲了好的措施,我評論說明了這一點。我有一個想法,在生產模塊中添加所有可能的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 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> 

生產模塊

的是是生產模塊。

<?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

更新後,在編譯模塊中檢查文件'compilation-mappings.txt'。它應該包含映射到用戶代理值的已編譯的* .js文件名。 – Adam

回答

2

這是因爲您正在使用<collapse-all-properties />。這意味着,它不會爲每個用戶代理生成排列,而只會爲所有用戶代理生成一個排列。

+0

我需要將此添加到描述中。我正在編譯僅包含不包含collapse-all-properties的生產模塊。我也試過評論這件事,看它是否會有所作爲,但事實並非如此。我嘗試在生產模塊中添加\t 以嘗試強制編譯所有的模塊,但這給了我錯誤,我不能重新定義user.agent。這使我相信其中一個繼承的模塊正在定義這種配置。 –

+0

你正在顯示的日誌是關於開發模塊。 –