On Thu, Apr 23, 2009 at 3:50 AM, Salvador Diaz <diaz.salva...@gmail.com>wrote:

> Unfortunately this pom has the undesirable side effect of polluting
> your source tree with generated artifacts. I'll try to post mine as
> soon as I have time to comment it.
>

Oh, absolutely agreed.  That's the way the build.xml does it, though, and
I've got a lot of Eclipse users who want to follow the Eclipse plugin
recommendations.

Here's the stock build.xml barfed out by webappCreator, complete with
various hard coded paths.  My goal was to make it so that maven and this
thing could coexist:

<?xml version="1.0" encoding="utf-8" ?>
<project name="Module" default="build" basedir=".">
  <!-- Configure path to GWT SDK -->
  <property name="gwt.sdk" location="E:/gwt-windows-1.6.4" />

  <path id="project.class.path">
    <pathelement location="war/WEB-INF/classes"/>
    <pathelement location="${gwt.sdk}/gwt-user.jar"/>
    <fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/>
    <!-- Add any additional non-server libs (such as JUnit) -->
    <fileset dir="war/WEB-INF/lib" includes="**/*.jar"/>
  </path>

  <target name="libs" description="Copy libs to WEB-INF/lib">
    <mkdir dir="war/WEB-INF/lib" />
    <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
    <!-- Add any additional server libs that need to be copied -->
  </target>

  <target name="javac" depends="libs" description="Compile java source">
    <mkdir dir="war/WEB-INF/classes"/>
    <javac srcdir="src" includes="**" encoding="utf-8"
        destdir="war/WEB-INF/classes"
        source="1.5" target="1.5" nowarn="true"
        debug="true" debuglevel="lines,vars,source">
      <classpath refid="project.class.path"/>
    </javac>
    <copy todir="war/WEB-INF/classes">
      <fileset dir="src" excludes="**/*.java"/>
    </copy>
  </target>

  <target name="gwtc" depends="javac" description="GWT compile to
JavaScript">
    <java failonerror="true" fork="true"
classname="com.google.gwt.dev.Compiler">
      <classpath>
        <pathelement location="src"/>
        <path refid="project.class.path"/>
      </classpath>
      <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
      <jvmarg value="-Xmx256M"/>
      <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
      <arg value="com.foobar.Module"/>
    </java>
  </target>

  <target name="hosted" depends="javac" description="Run hosted mode">
    <java failonerror="true" fork="true"
classname="com.google.gwt.dev.HostedMode">
      <classpath>
        <pathelement location="src"/>
        <path refid="project.class.path"/>
      </classpath>
      <jvmarg value="-Xmx256M"/>
      <arg value="-startupUrl"/>
      <arg value="GWTTest.html"/>
      <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
      <arg value="com.foobar.Module"/>
    </java>
  </target>

  <target name="build" depends="gwtc" description="Build this project" />

  <target name="war" depends="build" description="Create a war file">
    <zip destfile="Module.war" basedir="war"/>
  </target>

  <target name="clean" description="Cleans this project">
    <delete dir="war/WEB-INF/classes" failonerror="false" />
    <delete dir="war/module" failonerror="false" />
  </target>

</project>

I'd be very curious to see your POM as *I* personally don't want to have my
source tree polluted, and I don't use Eclipse.

Cheers,
Laird

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to