blob: 7eed8c33bbb847687c030c156f73c5027d33b01f [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" />
Mark Slee95771002006-06-07 06:53:25 +00009
10 <target name="init">
11 <tstamp />
12 <mkdir dir="${build}"/>
13 </target>
14
15 <target name="generate">
Mark Slee6f5e2cb2007-01-25 08:01:28 +000016 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000017 <arg line="--gen java:hashcode ../ThriftTest.thrift" />
Mark Slee95771002006-06-07 06:53:25 +000018 </exec>
David Reiss3b15ebc2008-03-02 06:29:19 +000019 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000020 <arg line="--gen java:hashcode ../DebugProtoTest.thrift" />
David Reiss3b15ebc2008-03-02 06:29:19 +000021 </exec>
22 <exec executable="../../compiler/cpp/thrift">
David Reiss14feb412008-03-02 06:29:23 +000023 <arg line="--gen java:hashcode ../OptionalRequiredTest.thrift" />
David Reiss3b15ebc2008-03-02 06:29:19 +000024 </exec>
Mark Slee95771002006-06-07 06:53:25 +000025 </target>
26
Mark Slee78f58e22006-09-02 04:17:07 +000027 <target name="compileonly">
David Reiss3b15ebc2008-03-02 06:29:19 +000028 <javac debug="true" srcdir="${gen}" destdir="${build}" classpath="${cpath}" />
29 <javac debug="true" srcdir="${src}" destdir="${build}" classpath="${cpath}:${gen}" />
30 </target>
31
32 <target name="compile" depends="init,generate,compileonly">
33 <jar jarfile="thrifttest.jar" basedir="${build}"/>
Mark Slee78f58e22006-09-02 04:17:07 +000034 </target>
35
Mark Slee95771002006-06-07 06:53:25 +000036 <target name="test" depends="compile">
David Reiss3b15ebc2008-03-02 06:29:19 +000037 <java classname="com.facebook.thrift.test.IdentityTest" classpath="${cpath}:./thrifttest.jar"/>
38 <java classname="com.facebook.thrift.test.EqualityTest" classpath="${cpath}:./thrifttest.jar"/>
Mark Slee95771002006-06-07 06:53:25 +000039 </target>
40
41 <target name="clean">
42 <delete dir="gen-java" />
43 <delete dir="${build}" />
44 <delete file="thrifttest.jar" />
45 </target>
46
47</project>