blob: 0860d9c7cf278952c88471358d11251b5be878b9 [file] [log] [blame]
Mark Slee95771002006-06-07 06:53:25 +00001<project name="thrifttest" default="test" basedir=".">
2
3 <description>Thrift Test Build File</description>
4
5 <property name="src" location="src" />
6 <property name="gen" location="gen-java" />
David Reiss25be92b2009-01-05 21:02:58 +00007 <property name="genbean" location="gen-javabean" />
Mark Slee95771002006-06-07 06:53:25 +00008 <property name="build" location="build" />
David Reiss14feb412008-03-02 06:29:23 +00009 <property name="cpath" location="../../lib/java/libthrift.jar:/usr/share/java/commons-lang-2.3.jar" />
David Reissea5e75a2008-03-07 20:12:20 +000010 <property name="testjar" location="thrifttest.jar" />
Mark Slee95771002006-06-07 06:53:25 +000011
12 <target name="init">
13 <tstamp />
14 <mkdir dir="${build}"/>
15 </target>
16
17 <target name="generate">
Mark Slee6f5e2cb2007-01-25 08:01:28 +000018 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000019 <arg line="--gen java:hashcode ../ThriftTest.thrift" />
Mark Slee95771002006-06-07 06:53:25 +000020 </exec>
David Reiss3b15ebc2008-03-02 06:29:19 +000021 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000022 <arg line="--gen java:hashcode ../DebugProtoTest.thrift" />
David Reiss3b15ebc2008-03-02 06:29:19 +000023 </exec>
24 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000025 <arg line="--gen java:hashcode ../OptionalRequiredTest.thrift" />
David Reiss3b15ebc2008-03-02 06:29:19 +000026 </exec>
David Reissea5e75a2008-03-07 20:12:20 +000027 <exec executable="../../compiler/cpp/thrift">
David Reiss25be92b2009-01-05 21:02:58 +000028 <arg line="--gen java:beans,nocamel ../JavaBeansTest.thrift" />
David Reissea5e75a2008-03-07 20:12:20 +000029 </exec>
Mark Slee95771002006-06-07 06:53:25 +000030 </target>
31
Mark Slee78f58e22006-09-02 04:17:07 +000032 <target name="compileonly">
David Reiss3b15ebc2008-03-02 06:29:19 +000033 <javac debug="true" srcdir="${gen}" destdir="${build}" classpath="${cpath}" />
David Reiss25be92b2009-01-05 21:02:58 +000034 <javac debug="true" srcdir="${genbean}" destdir="${build}" classpath="${cpath}" />
David Reiss3b15ebc2008-03-02 06:29:19 +000035 <javac debug="true" srcdir="${src}" destdir="${build}" classpath="${cpath}:${gen}" />
36 </target>
37
38 <target name="compile" depends="init,generate,compileonly">
David Reissea5e75a2008-03-07 20:12:20 +000039 <jar jarfile="${testjar}" basedir="${build}"/>
Mark Slee78f58e22006-09-02 04:17:07 +000040 </target>
41
Mark Slee95771002006-06-07 06:53:25 +000042 <target name="test" depends="compile">
David Reissea5e75a2008-03-07 20:12:20 +000043 <java classname="com.facebook.thrift.test.JSONProtoTest"
44 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
45 <java classname="com.facebook.thrift.test.IdentityTest"
46 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
47 <java classname="com.facebook.thrift.test.EqualityTest"
48 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
David Reiss30a93602008-11-21 21:31:36 +000049 <java classname="com.facebook.thrift.test.ToStringTest"
50 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
David Reiss603d5042008-12-02 02:06:31 +000051 <java classname="com.facebook.thrift.test.DeepCopyTest"
52 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
David Reiss25be92b2009-01-05 21:02:58 +000053 <java classname="com.facebook.thrift.test.JavaBeansTest"
54 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
Mark Slee95771002006-06-07 06:53:25 +000055 </target>
56
57 <target name="clean">
58 <delete dir="gen-java" />
David Reiss25be92b2009-01-05 21:02:58 +000059 <delete dir="gen-javabean" />
Mark Slee95771002006-06-07 06:53:25 +000060 <delete dir="${build}" />
61 <delete file="thrifttest.jar" />
62 </target>
63
64</project>