weixin_39567943
weixin_39567943
2020-12-09 12:15

Incremental compilation

Hi how can we make the plugin do an incremental compilation?

该提问来源于开源项目:tbroyer/gwt-maven-plugin

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

10条回答

  • weixin_39567943 weixin_39567943 5月前

    i got it working by adding this to the client module pom inside the configuration tag of the plugin <systemProperties> <incremental>true</incremental> </systemProperties>

    点赞 评论 复制链接分享
  • weixin_39677027 weixin_39677027 5月前

    What makes you think this is not already the case?

    点赞 评论 复制链接分享
  • weixin_39567943 weixin_39567943 5月前

    oh sorry, i was asking for instructions and not stating that it does not.

    点赞 评论 复制链接分享
  • weixin_39677027 weixin_39677027 5月前

    Grrr, and I did not mean to post that comment (drafted it, then erratic Wi-Fi, switching apps on mobile and possibly GitHub trying to be smart did the rest).

    There's no such incremental system property; the GWT compiler works incrementally by default.

    点赞 评论 复制链接分享
  • weixin_39567943 weixin_39567943 5月前

    you are 100% right, i got the same incremental behaviour even after i removed the system property. i wonder if this is something related to gwt 2.8, maybe i need to take a look at the release notes again.

    点赞 评论 复制链接分享
  • weixin_39677027 weixin_39677027 5月前

    Maybe let's first discuss what exactly you mean by "incremental compilation", how you determines whether it works or not, and what exact Maven commands you're executing.

    点赞 评论 复制链接分享
  • weixin_39567943 weixin_39567943 5月前

    it means when the code server compile only the changes you made to the client code instead of compiling the whole thing. this is how i used to do it with the codehaus plugin where i had to tell the code server to compile the changes incrementally, so when you made the change then you refresh the page the coder server will recompile very quickly as it is only recompiling the changed files only. but this was while using gwt 2.7 and i had to run gwt in debug mode to make it work mvn gwt:debug and you can tell its working or not when you do a small change to the client code and when you refresh code server runs a full compilation and takes a long time then its not working, but if the code server runs a quick compilation then its working, this saves a lot of time since the difference is so huge. now here is the old plugin configuration:

     xml
    <plugin>
        <groupid>org.codehaus.mojo</groupid>
        <artifactid>gwt-maven-plugin</artifactid>
        <version>${gwtVersion}</version>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <modules>
                <module>some.module</module>
            </modules>
            <runtarget>local.html</runtarget>
            <draftcompile>true</draftcompile>
            <superdevmode>true</superdevmode>
            <style>detailed</style>
            <incremental>true</incremental>
        </configuration>
    </plugin>
    

    but now with your plugin i simply execute only the commands from the read me page of this plugin.

    点赞 评论 复制链接分享
  • weixin_39567943 weixin_39567943 5月前

    here is the documentation of the mojo plugin https://gwt-maven-plugin.github.io/gwt-maven-plugin/debug-mojo.html#incremental it have been available since 2.7.0-rc1

    点赞 评论 复制链接分享
  • weixin_39677027 weixin_39677027 5月前

    Then you'd pass -incremental as a compiler argument:

     xml
    <compilerargs>
      <arg>-incremental</arg>
    </compilerargs>
    

    Disclaimer: for some reason, I thought that was the default; but it's not and you have to explicitly pass -incremental to turn it on. My bad.

    The options should be documented at http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideCompilerOptions but the doc is unfortunately out of date currently. You can get them easily for your version of GWT by passing -? or -help as a compiler argument (this applies to all GWT tools BTW, so would work the same with <codeserverArgs>, <devmodeArgs>, and <testArgs>)

    点赞 评论 复制链接分享
  • weixin_39567943 weixin_39567943 5月前

    That works, the compilation is much faster now. Thank you very much. i really appreciate your quick response and patience.

    点赞 评论 复制链接分享

相关推荐