Giter Club home page Giter Club logo

Comments (7)

tbroyer avatar tbroyer commented on May 28, 2024

It's intentionally not there, at least for the time being. The tools provided by GWT (CSS or I18N) are supposed to be one-off tools to help you bootstrap a project from existing files. At least that's how I see them; YMMV. So I don't plan to add those goals to the plugin, unless there's a huge demand for them (but you can use the exec-maven-plugin in the mean time)

from gwt-maven-plugin.

kaefert avatar kaefert commented on May 28, 2024

thanks for the fast answer Thomas!
Sadly I'm having difficulties to understand what you're saying. So I'll try to repeat what I understood:
CSS or I18N generations are supplied by GWT and you do not want to provide a wrapper for them in the newer version of you're gwt-maven-plugin, because you say that they are only helpful for migrating existing projects, not for new ones?

But there exists some other maven plugin called exec-maven-plugin that allows to use them without you wrapping them? Could you give details how that would work?

from gwt-maven-plugin.

tbroyer avatar tbroyer commented on May 28, 2024

That's it. The CodeHaus Mojo binds them to build phases by default, and I believe this is a mistake.

As for the exec-maven-plugin, apparently it's not powerful enough (InterfaceGenerator outputs the class to standard output, and exec-maven-plugin provides no way to redirect that output to a file); but the antrun-maven-plugin should work.

<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  <version>1.8</version>
  <configuration>
    <sourceRoot>${project.build.directory}/generated-sources/css</sourceRoot>
    <target>
      <java fork="true" failonerror="true"
        classname="com.google.gwt.resources.css.InterfaceGenerator"
        output="${maven.project.build.directory}/generated-sources/css/net/example/client/Whatever.java" logError="true">
        <classpath>
          <pathentry location="${com.google.gwt:gwt-dev:jar}"/>
          <pathentry location="${com.google.gwt:gwt-user:jar}"/>
        </classpath>
        <arg>-addPackageHeader</arg>
        <arg>-typeName</arg>
        <arg>net.example.client.Whatever</arg>
        <arg>-css</argument>
        <arg>src/main/resources/net/example/client/whatever.css</arg>
      </java>
    </target>
  </configuration>

from gwt-maven-plugin.

kaefert avatar kaefert commented on May 28, 2024

Thanks for the maven-antrun-plugin pom.xml snippet! - I'll try that soon.

In the meantime I've generated myself a project from tbroyer/gwt-maven-archetypes@3f53aa7 but it sadly requires the use of the SuperDevMode booklets, a project generated from trunk containing your new gwt-maven-plugin does trigger the compiling automatically by simply refreshing the page. thats much nicer.

About the binding the codeGeneration execution to a phase in maven - what alternatives are there? If you don't bind the execution to a phase, it won't get executed during build, or will it?

from gwt-maven-plugin.

tbroyer avatar tbroyer commented on May 28, 2024

In the meantime I've generated myself a project from tbroyer/gwt-maven-archetypes@3f53aa7 but it sadly requires the use of the SuperDevMode booklets, a project generated from trunk containing your new gwt-maven-plugin does trigger the compiling automatically by simply refreshing the page. thats much nicer.

Add a <launcherDir> (or pass -Dgwt.codeServer.launcherDir=… on the command-line) to the gwt-maven-plugin in the *-client project pointing to ${project.build.directory}/${project.build.finalName}, or just use gwt:run instead of gwt:run-codeserver.

About the binding the codeGeneration execution to a phase in maven - what alternatives are there? If you don't bind the execution to a phase, it won't get executed during build, or will it?

Run it once and commit the generated file. Maybe it's not the case for CSS (and I haven't evaluated GSS yet), but for I18N the generated file can only be a starting point: you'll change return types in Constants and parameter types in Messages to things other than String, you'll possibly change return types in Messages to SafeHtml, you'll add @AlternateMessage and @Select, etc.

from gwt-maven-plugin.

kaefert avatar kaefert commented on May 28, 2024

thanks for that hint with the <launcherDir> tag, that works nicely!

One other problem I have observed: most of the time when I try to kill the codeserver by pressing the red stop button in eclipse it won't die and I have to kill it in htop (or the like) before a new one will successfully start (address in use error). Do you know what might cause this or how to prevent that?

About the code generation: I've never wanted to manually modify a I18N generated file (I've only used Strings as of yet..), neither CSS or RPC-Async interface - but I do by time edit the messages text files, the css files or add new methods to my RPC interface - And I very much prefer for the generated code to get updated automatically during build time. But that's a matter of developers preference I guess.

from gwt-maven-plugin.

tbroyer avatar tbroyer commented on May 28, 2024

One other problem I have observed: most of the time when I try to kill the codeserver by pressing the red stop button in eclipse it won't die and I have to kill it in htop (or the like) before a new one will successfully start (address in use error). Do you know what might cause this or how to prevent that?

That's an Eclipse issue. Eclipse force-kills processes, it doesn't ask them to gracefully shutdown, so among other things shutdown hooks aren't invoked (GWT leaves a whole lot of temp files in your temp dir) and forked processes aren't killed.

About the code generation: I've never wanted to manually modify a I18N generated file (I've only used Strings as of yet..), neither CSS or RPC-Async interface - but I do by time edit the messages text files, the css files or add new methods to my RPC interface - And I very much prefer for the generated code to get updated automatically during build time. But that's a matter of developers preference I guess.

I suppose. Note that you can continue to use those goals from the org.codehaus.mojo:gwt-maven-plugin, without using the compile goal, if they fit your needs (well, yes, no need for the maven-antrun-plugin after all… I suppose I need some sleep or coffee).

from gwt-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.