Hi Brandon,
I think the typical way to reuse an existing GWT module in another is to
package that module into a JAR file (source included) and then refer to the
module from main project in its module XML file, as you did above. You would
then add that JAR to any launch or compilation scripts so that all
references would be resolved while running hosted mode or the GWT compiler.
In the same way, you would refer to this JAR in your ant build.xml file for
gwtc or hosted mode startup targets.

You could also refer to the GWT module's source folder and classpath
directly, as you did in your Eclipse configurations. This should also work
in Ant by defining the appropriate <path> element. Something like the
snippet below should do the trick:

<path id="apple.class.path">
    <fileset dir="../Apple/src/com/gawkat/gwt/apple/client">
      <include name="**/*.java"/>
    </fileset>
  </path>

<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="apple.class.path"/>
        <pathelement location="${gwt.home}/${gwt.dev.jar}"/>
      </classpath>
      <jvmarg value="-Xmx256M"/>
      <arg value="com.gawkat.gwt.Test"/>
    </java>
  </target>

This would be in addition to other path elements you would need to define to
build your project.

Hope that helps,
-Sumit Chandel

On Wed, Mar 4, 2009 at 8:23 AM, branflake2267 <[email protected]>wrote:

>
> How do I include the classpath for another module so ant will build?
>
> - My main module com.gawkat.gwt.Test
> - In Text.gwt.xml file I include "<inherits
> name='com.gawkat.gwt.Apple'/>"
> - I have added Apple projects classpath and src folder to Test Debug
> Configurations classpath and hosted mode will build the projects.
>
> So How can I get Ant to Compile it?
>
> > Run As > Build.xml in com.gawkat.gwt.Test :
>
> Buildfile: /home/branflake2267/workspace2/Test/build.xml
> libs:
> javac:
> gwtc:
>     [java] Loading module 'com.gawkat.gwt.Test'
>     [java]    Loading inherited module 'com.gawkat.gwt.Apple'
>     [java]       [ERROR] Unable to find 'com/gawkat/gwt/
> Apple.gwt.xml' on your classpath; could be a typo, or maybe you forgot
> to include a classpath entry for source?
>     [java]    [ERROR] Line 15: Unexpected exception while processing
> element 'inherits'
>     [java] com.google.gwt.core.ext.UnableToCompleteException: (see
> previous log entries)
>    ....
> >
>

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

Reply via email to