Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 1 | <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 Reiss | 14feb41 | 2008-03-02 06:29:23 +0000 | [diff] [blame] | 8 | <property name="cpath" location="../../lib/java/libthrift.jar:/usr/share/java/commons-lang-2.3.jar" /> |
David Reiss | ea5e75a | 2008-03-07 20:12:20 +0000 | [diff] [blame] | 9 | <property name="testjar" location="thrifttest.jar" /> |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 10 | |
| 11 | <target name="init"> |
| 12 | <tstamp /> |
| 13 | <mkdir dir="${build}"/> |
| 14 | </target> |
| 15 | |
| 16 | <target name="generate"> |
Mark Slee | 6f5e2cb | 2007-01-25 08:01:28 +0000 | [diff] [blame] | 17 | <exec executable="../../compiler/cpp/thrift"> |
David Reiss | 14feb41 | 2008-03-02 06:29:23 +0000 | [diff] [blame] | 18 | <arg line="--gen java:hashcode ../ThriftTest.thrift" /> |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 19 | </exec> |
David Reiss | 3b15ebc | 2008-03-02 06:29:19 +0000 | [diff] [blame] | 20 | <exec executable="../../compiler/cpp/thrift"> |
David Reiss | 14feb41 | 2008-03-02 06:29:23 +0000 | [diff] [blame] | 21 | <arg line="--gen java:hashcode ../DebugProtoTest.thrift" /> |
David Reiss | 3b15ebc | 2008-03-02 06:29:19 +0000 | [diff] [blame] | 22 | </exec> |
| 23 | <exec executable="../../compiler/cpp/thrift"> |
David Reiss | 14feb41 | 2008-03-02 06:29:23 +0000 | [diff] [blame] | 24 | <arg line="--gen java:hashcode ../OptionalRequiredTest.thrift" /> |
David Reiss | 3b15ebc | 2008-03-02 06:29:19 +0000 | [diff] [blame] | 25 | </exec> |
David Reiss | ea5e75a | 2008-03-07 20:12:20 +0000 | [diff] [blame] | 26 | <exec executable="../../compiler/cpp/thrift"> |
| 27 | <arg line="--gen java ../DebugProtoTest.thrift" /> |
| 28 | </exec> |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 29 | </target> |
| 30 | |
Mark Slee | 78f58e2 | 2006-09-02 04:17:07 +0000 | [diff] [blame] | 31 | <target name="compileonly"> |
David Reiss | 3b15ebc | 2008-03-02 06:29:19 +0000 | [diff] [blame] | 32 | <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 Reiss | ea5e75a | 2008-03-07 20:12:20 +0000 | [diff] [blame] | 37 | <jar jarfile="${testjar}" basedir="${build}"/> |
Mark Slee | 78f58e2 | 2006-09-02 04:17:07 +0000 | [diff] [blame] | 38 | </target> |
| 39 | |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 40 | <target name="test" depends="compile"> |
David Reiss | ea5e75a | 2008-03-07 20:12:20 +0000 | [diff] [blame] | 41 | <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 Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 47 | </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> |