blob: 77267fc2de014ed8c45748b01035ab1ce6985a1b [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" />
7 <property name="build" location="build" />
David Reiss14feb412008-03-02 06:29:23 +00008 <property name="cpath" location="../../lib/java/libthrift.jar:/usr/share/java/commons-lang-2.3.jar" />
David Reissea5e75a2008-03-07 20:12:20 +00009 <property name="testjar" location="thrifttest.jar" />
Mark Slee95771002006-06-07 06:53:25 +000010
11 <target name="init">
12 <tstamp />
13 <mkdir dir="${build}"/>
14 </target>
15
16 <target name="generate">
Mark Slee6f5e2cb2007-01-25 08:01:28 +000017 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000018 <arg line="--gen java:hashcode ../ThriftTest.thrift" />
Mark Slee95771002006-06-07 06:53:25 +000019 </exec>
David Reiss3b15ebc2008-03-02 06:29:19 +000020 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000021 <arg line="--gen java:hashcode ../DebugProtoTest.thrift" />
David Reiss3b15ebc2008-03-02 06:29:19 +000022 </exec>
23 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000024 <arg line="--gen java:hashcode ../OptionalRequiredTest.thrift" />
David Reiss3b15ebc2008-03-02 06:29:19 +000025 </exec>
David Reissea5e75a2008-03-07 20:12:20 +000026 <exec executable="../../compiler/cpp/thrift">
27 <arg line="--gen java ../DebugProtoTest.thrift" />
28 </exec>
Mark Slee95771002006-06-07 06:53:25 +000029 </target>
30
Mark Slee78f58e22006-09-02 04:17:07 +000031 <target name="compileonly">
David Reiss3b15ebc2008-03-02 06:29:19 +000032 <javac debug="true" srcdir="${gen}" destdir="${build}" classpath="${cpath}" />
33 <javac debug="true" srcdir="${src}" destdir="${build}" classpath="${cpath}:${gen}" />
34 </target>
35
36 <target name="compile" depends="init,generate,compileonly">
David Reissea5e75a2008-03-07 20:12:20 +000037 <jar jarfile="${testjar}" basedir="${build}"/>
Mark Slee78f58e22006-09-02 04:17:07 +000038 </target>
39
Mark Slee95771002006-06-07 06:53:25 +000040 <target name="test" depends="compile">
David Reissea5e75a2008-03-07 20:12:20 +000041 <java classname="com.facebook.thrift.test.JSONProtoTest"
42 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
43 <java classname="com.facebook.thrift.test.IdentityTest"
44 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
45 <java classname="com.facebook.thrift.test.EqualityTest"
46 classpath="${cpath}:${testjar}:${gen}" failonerror="true" />
Mark Slee95771002006-06-07 06:53:25 +000047 </target>
48
49 <target name="clean">
50 <delete dir="gen-java" />
51 <delete dir="${build}" />
52 <delete file="thrifttest.jar" />
53 </target>
54
55</project>