<project name="gxptest">
<description>
Script to build GXP files
</description>
<taskdef name="gxpc" classname="com.google.gxp.compiler.ant.GxpcTask"
classpath="c:/dev/gxp/gxp-0.2.3-beta.jar" />
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="classes" location="${build}/classes"/>
<property name="gen" location="${build}/gen"/>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${gen}"/>
</target>
<target name="compile" depends="init"
description="Compile Java sources.">
<gxpc srcdir="${src}"
srcpaths="${src}"
destdir="${gen}"
target="test.gxptest.messages" />
<copy todir="${classes}">
<fileset dir="${src}/">
<include name="test/gxptest/messages_en.properties" />
</fileset>
</copy>
<javac srcdir="${src}" destdir="${classes}" includeJavaRuntime="yes"
debug="true">
<src>
<pathelement location="${gen}/" />
</src>
</javac>
</target>
<target name="clean"
description="Remove autogenerated files and directories.">
<delete dir="${build}"/>
</target>
</project>
C:\Dev\gxptest>ant compile
Buildfile: build.xml
init:
compile:
BUILD FAILED
java.lang.NullPointerException
at
com
.google
.gxp
.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:
181)
at
com
.google
.gxp.com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:
141)
at
com.google.gxp.com.google.common.collect.ImmutableMap.access
$300(ImmutableMap.java:55)
at com.google.gxp.com.google.common.collect.ImmutableMap
$Builder.put(ImmutableMap.java:176)
at
com
.google
.gxp
.compiler.CompilationSet.createCompilationUnits(CompilationSet.java:143)
at
com.google.gxp.compiler.CompilationSet.<init>(CompilationSet.java:130)
at
com.google.gxp.compiler.CompilationSet.<init>(CompilationSet.java:53)
at com.google.gxp.compiler.CompilationSet
$Builder.build(CompilationSet.java:98)
at com.google.gxp.compiler.Compiler.call(Compiler.java:105)
at com.google.gxp.compiler.ant.GxpcTask.execute(GxpcTask.java:
99)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
src/HelloWorld.gxp is from the tutorial:
<!-- HelloWorld.gxp -->
<gxp:template name='com.google.tutorial.HelloWorld' xmlns:gxp='http://google.com/2001/gxp'
>
Hello, World!
</gxp:template>
Thanks,
Rich
HelloWorld.gxp needs to live at src/com/google/tutorial/HelloWorld.gxp
If it doesn't, you can adjust the srcpaths in the <gxpc> task to point
to the part of the directory up to just before com.
So if HellowWorld.gxp was at src/gxp/com/google/tutorial/HelloWorld.gxp
then you could change srcpaths to ${src}/gxp
At least I think this is the problem. If it doesn't work let me know.
I'm also gonna look into this further. I'm kind of surprised that it
could NPE at this point in the code.
-harryh
Rich