Saturday, April 18, 2015

SuperDevMode Running With GWT 2.6.1 (ant/Command Line)

Hello,

I upgraded from GWT 2.6.1 to GWT 2.7 and immediately starting getting reports of my app not launching after being loaded. I was unable to reproduce the issue, so I went back to using GWT 2.6.1 for now. I will try again with 2.7.1 maybe. However, in the mean time, I got REALLY attached to SuperDevMode, or rather not having to manage stale and a fresh versions of my browser. So I really wanted to get SuperDevMode working with GWT 2.6.1. Unfortunately I seem to be one of the few people that prefer not use an IDE to develop, so most of the examples of how to do what I want have been less than helpful. To make things even more interesting, I am using JSON to talk to a Perl server instead of the standard server. I just got it working, so I wanted to share the wealth.

First edit your project.gwt.xml file and add:

  <add-linker name="xsiframe"/>

Second, edit your build.xml file and add something like:

  <target name="sdm" depends="javac" description="starts the superdevmode">
    <java fork="true" failonerror="true" classname="com.google.gwt.dev.codeserver.CodeServer">
      <classpath>
        <pathelement location="src"/>
        <path refid="project.class.path"/>
        <pathelement location="${gwt.sdk}/gwt-codeserver.jar"/>
        <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar" />
        <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar" />
      </classpath>
      <arg value="-src"/>
      <arg value="${basedir}/src"/>
      <arg value="com.myproject.Project"/>
    </java>
  </target>

Third, assuming everything works right, when you ant the sdm target it will provide a URL. If you go to that URL it will give you a bookmarkable URL to start SuperDevMode and another one to stop it. Yes, you really need to at least add the "Dev Mode On" bookmark. After you do that then you can close the tab and probably never visit it again.

Fourth, and this was the hardest part for me to figure out from the information given, is you need to go to the same base URL to run your application that regular DevMode uses. In other words, omit the gwt.codesvr parameter.  In my case that is "http://localhost:3000/app/index.htm", but it will definitely be different for you unless you are running a development Mojolicious server. Your app should load, and then you click your "Dev Mode On" bookmark to recompile and reload. It's a little clunky having to click the button to recompile, but it's a whole lot better than running an old version of a browser.

James

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment