Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 1 | <project name="libthrift" default="dist" basedir="."> |
| 2 | |
| 3 | <description>Thrift Build File</description> |
| 4 | |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame^] | 5 | <property name="gen" location="gen-java" /> |
| 6 | <property name="genbean" location="gen-javabean" /> |
| 7 | |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 8 | <property name="src" location="src" /> |
| 9 | <property name="build" location="build" /> |
David Reiss | f0c21a7 | 2008-07-11 01:26:16 +0000 | [diff] [blame] | 10 | <property name="install.path" value="/usr/local/lib" /> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame^] | 11 | <property name="src.test" location="test" /> |
| 12 | <property name="build.test" location="${build}/test" /> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 13 | |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame^] | 14 | <property name="test.thrift.home" location="../../test"/> |
| 15 | |
| 16 | <property file="${user.home}/.thrift-build.properties" /> |
| 17 | |
| 18 | <property name="cpath" location="libthrift.jar:${thrift.extra.cpath}" /> |
| 19 | |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 20 | <target name="init"> |
| 21 | <tstamp /> |
| 22 | <mkdir dir="${build}"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame^] | 23 | <mkdir dir="${build.test}" /> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 24 | </target> |
| 25 | |
| 26 | <target name="compile" depends="init"> |
David Reiss | 4ad40d7 | 2008-08-04 18:38:36 +0000 | [diff] [blame] | 27 | <javac srcdir="${src}" destdir="${build}" source="1.5" /> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 28 | </target> |
| 29 | |
| 30 | <target name="dist" depends="compile"> |
| 31 | <jar jarfile="libthrift.jar" basedir="${build}"/> |
| 32 | </target> |
| 33 | |
| 34 | <target name="install" depends="dist"> |
Mark Slee | 54b7ab9 | 2007-03-06 00:06:27 +0000 | [diff] [blame] | 35 | <exec executable="install"> |
David Reiss | f0c21a7 | 2008-07-11 01:26:16 +0000 | [diff] [blame] | 36 | <arg line="libthrift.jar ${install.path}" /> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 37 | </exec> |
| 38 | </target> |
| 39 | |
| 40 | <target name="clean"> |
| 41 | <delete dir="${build}" /> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame^] | 42 | <delete dir="${gen}"/> |
| 43 | <delete dir="${genbean}"/> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 44 | <delete file="libthrift.jar" /> |
| 45 | </target> |
| 46 | |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame^] | 47 | <target name="compile-test" description="Build the test suite classes" depends="generate,dist"> |
| 48 | <javac debug="true" srcdir="${gen}" destdir="${build.test}" classpath="${cpath}" /> |
| 49 | <javac debug="true" srcdir="${genbean}" destdir="${build.test}" classpath="${cpath}" /> |
| 50 | <javac debug="true" srcdir="${src.test}" destdir="${build.test}" classpath="${cpath}:${gen}" /> |
| 51 | </target> |
| 52 | |
| 53 | <target name="test" description="Run the full test suite" depends="compile-test"> |
| 54 | <java classname="org.apache.thrift.test.JSONProtoTest" |
| 55 | classpath="${cpath}:${build.test}" failonerror="true" /> |
| 56 | <java classname="org.apache.thrift.test.IdentityTest" |
| 57 | classpath="${cpath}:${build.test}" failonerror="true" /> |
| 58 | <java classname="org.apache.thrift.test.EqualityTest" |
| 59 | classpath="${cpath}:${build.test}" failonerror="true" /> |
| 60 | <java classname="org.apache.thrift.test.ToStringTest" |
| 61 | classpath="${cpath}:${build.test}" failonerror="true" /> |
| 62 | <java classname="org.apache.thrift.test.DeepCopyTest" |
| 63 | classpath="${cpath}:${build.test}" failonerror="true" /> |
| 64 | <java classname="org.apache.thrift.test.JavaBeansTest" |
| 65 | classpath="${cpath}:${build.test}" failonerror="true" /> |
| 66 | </target> |
| 67 | |
| 68 | <target name="generate"> |
| 69 | <exec executable="../../compiler/cpp/thrift"> |
| 70 | <arg line="--gen java:hashcode ${test.thrift.home}/ThriftTest.thrift" /> |
| 71 | </exec> |
| 72 | <exec executable="../../compiler/cpp/thrift"> |
| 73 | <arg line="--gen java:hashcode ${test.thrift.home}/DebugProtoTest.thrift" /> |
| 74 | </exec> |
| 75 | <exec executable="../../compiler/cpp/thrift"> |
| 76 | <arg line="--gen java:hashcode ${test.thrift.home}/OptionalRequiredTest.thrift" /> |
| 77 | </exec> |
| 78 | <exec executable="../../compiler/cpp/thrift"> |
| 79 | <arg line="--gen java:beans,nocamel ${test.thrift.home}/JavaBeansTest.thrift" /> |
| 80 | </exec> |
| 81 | </target> |
| 82 | |
| 83 | |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 84 | </project> |