2017-06-09 4 views
1

GWT 2.7まで正常に動作していたマニフェストファイルを生成するカスタムリンカーがあります。 GWT 2.8に変更したとき、myapp.manifestファイルの生成が止まったことに気付きました。 module.gwt.xmlでGWT 2.8がカスタムリンカーを取得できない

私はこれは私がtbroyer gwt maven archetype modular-webappを使用していますGWT 2.8で2.7

[INFO] --- gwt-maven-plugin:2.7.0:compile (default) @ universo-bootstrap --- 
    [INFO] auto discovered modules [br.com.universo.core.appCore, br.com.universo.app] 
    [INFO] br.com.universo.core.appCore has no EntryPoint - compilation skipped 
    [INFO] Compiling module br.com.universo.app 
    [INFO] Ignored 7 units with compilation errors in first pass. 
    [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. 
    [INFO] Compiling 6 permutations 
    [INFO]  Compiling permutation 0... 
    [INFO]  Process output 
    [INFO]   Compiling 
    [INFO]    Compiling permutation 1... 
    [INFO]  Compiling permutation 2... 
    [INFO]   Compiling 
    [INFO]    Compiling permutation 3... 
    [INFO]  Compiling permutation 4... 
    [INFO]  Compiling permutation 5... 
    [INFO] Compile of permutations succeeded 
    [INFO] Compilation succeeded -- 165.867s 
    [INFO] MyApp OffLine Linker started 
    [INFO] MyApp OffLine Linker ended 
    [INFO] Linking into /universo/universo-bootstrap/target/universo-bootstrap-1.0-SNAPSHOT/app 
    [INFO] Link succeeded 
    [INFO] Linking succeeded -- 1.239s 

にコンパイルログです

<?xml version="1.0" encoding="UTF-8"?> 
<module> 
    <inherits name="com.google.gwt.user.User" /> 
    <inherits name="com.google.gwt.core.Core" /> 

    <source path="client" /> 
    <source path="shared" /> 
    <source path="constants" /> 

    <entry-point class="br.com.universo.client.AppStart" /> 

    <extend-property name="locale" values="pt" /> 
    <extend-property name="locale" values="en" /> 
    <set-property-fallback name="locale" value="en" /> 

    <define-linker class="br.com.universo.AppManifest" 
     name="manifest" /> 
    <add-linker name="manifest" /> 


</module> 

を持っています。リンカクラスは、クライアントモジュールの下で定義されていたが、

<source path="client" /> 

外とコンパイルログのパッケージに私がライン表示されていない:私はそれが呼び出されていないことを示したと

[INFO] MyApp OffLine Linker started 
[INFO] MyApp OffLine Linker ended 

を?

[INFO] --- gwt-maven-plugin:1.0-rc-7:compile (default-compile) @ universo-client --- 
[INFO] Compiling module br.com.universo.app 
[INFO] Compiling 9 permutations 
[INFO]  Compiling permutation 0... 
[INFO]  [WARN] Namespace option is not compatible with CodeSplitter, turning it off. 
[INFO]  Compiling permutation 1... 
[INFO]  Compiling permutation 2... 
[INFO]  Compiling permutation 3... 
[INFO]  Compiling permutation 4... 
[INFO]  Compiling permutation 5... 
[INFO]  Compiling permutation 6... 
[INFO]  Compiling permutation 7... 
[INFO]  Compiling permutation 8... 
[INFO] Compile of permutations succeeded 
[INFO] Compilation succeeded -- 104.171s 
[INFO] Linking into /universo/universo-client/target/universo-client-1.0-SNAPSHOT/app 
[INFO] Link succeeded 
[INFO] Linking succeeded -- 1.818s 

リンカクラスAppManifest.java

package br.com.universo; 

import java.util.Date; 

import com.google.gwt.core.ext.LinkerContext; 
import com.google.gwt.core.ext.TreeLogger; 
import com.google.gwt.core.ext.UnableToCompleteException; 
import com.google.gwt.core.ext.linker.AbstractLinker; 
import com.google.gwt.core.ext.linker.ArtifactSet; 
import com.google.gwt.core.ext.linker.EmittedArtifact; 
import com.google.gwt.core.ext.linker.LinkerOrder; 
import com.google.gwt.core.ext.linker.LinkerOrder.Order; 
import com.google.gwt.core.ext.linker.Shardable; 

@Shardable 
@LinkerOrder(Order.POST) 
public class AppManifest extends AbstractLinker { 

    static final String[] cache = new String[] { 
     "# Css" 
     , "/css/base.css" 
     , "/css/feedback.css" 
     , "/css/layout.css" 
     , "/css/prettyPhoto.css" 
     , "/css/shortcodes.css" 
     , "/css/slideshow.css" 
     , "/css/style.css" 
    }; 

    static final String[] network = new String[] { 
     "*" 
    }; 


    @Override 
    public String getDescription() { 
     return "MyApp OffLine Linker"; 
    } 

    @Override 
     public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts) throws UnableToCompleteException { 
     System.out.println("MyApp OffLine Linker started"); 
     ArtifactSet artifactset = new ArtifactSet(artifacts); 

     StringBuilder builder= new StringBuilder("CACHE MANIFEST\n"); 
     builder.append("# Cache Version " + new Date() + "\n\n"); 
     builder.append("CACHE:\n"); 

     for (String line : cache) { 
      builder.append(line + "\n");    
     } 
     builder.append("\n\n"); 

     for(EmittedArtifact emitted: artifacts.find(EmittedArtifact.class)) 
     { 
      if(emitted.getPartialPath().endsWith(".symbolMap"))continue; 
      if(emitted.getPartialPath().endsWith(".txt"))continue; 
      builder.append(emitted.getPartialPath()).append("\n"); 
     } 
     builder.append("\n\n"); 

     builder.append("NETWORK:\n"); 
     for (String line : network) { 
      builder.append(line + "\n");    
     } 
     builder.append("\n\n"); 

     builder.append("FALLBACK:\n"); 

     EmittedArtifact manifest = emitString(logger, builder.toString(), "myapp.manifest"); 
     artifactset.add(manifest); 
     System.out.println("MyApp OffLine Linker ended"); 
     return artifactset; 
     } 

} 

すべてのヘルプはよく歓迎です!

+0

gwt-maven-pluginのpom.xmlにどのようなオプションを設定しましたか?また、pom.xmlはスイッチのバージョンを除いて全く変更されましたか?私はこのような壊れた他のリンカーを経験していません... –

+0

コリンは、APIが変更されたように見え、私は正しい注意を払っていませんでした。しかし、以前のバージョンやArtifactSetリンク(TreeLoggerロガー、LinkerContextコンテキスト、ArtifactSetアーティファクト)では持っていなかったメソッドリンク、ArtifactSetリンク(TreeLoggerロガー、LinkerContextコンテキスト、ArtifactSetアーティファクト、ブール値1Permutation)の両方のシグニチャをオーバーライドするようにしました。 ) –

答えて

0

私はついにAppManifast.javaを変更していました。私は@Shardable注釈を使用しているときに他のリンクメソッドシグネチャを上書きする必要があること、現在のドキュメントに気づいたので、私はクラスに以下の行を追加しました:

@Override 
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean onePermutation) throws UnableToCompleteException { 
    return link(logger, context, artifacts); 
} 

それは見つけるために永遠に連れて行ってくれた...

関連する問題