blob: 1215de123d2ed25c90cede41b6739474538554fa [file] [log] [blame]
Mark Slee83c52a82006-06-07 06:51:18 +00001<project name="libthrift" default="dist" basedir=".">
2
3 <description>Thrift Build File</description>
4
Bryan Duxbury249d7cb2009-01-29 01:21:20 +00005 <property name="gen" location="gen-java" />
6 <property name="genbean" location="gen-javabean" />
7
Mark Slee83c52a82006-06-07 06:51:18 +00008 <property name="src" location="src" />
9 <property name="build" location="build" />
David Reissf0c21a72008-07-11 01:26:16 +000010 <property name="install.path" value="/usr/local/lib" />
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000011 <property name="src.test" location="test" />
12 <property name="build.test" location="${build}/test" />
Mark Slee83c52a82006-06-07 06:51:18 +000013
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000014 <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 Slee83c52a82006-06-07 06:51:18 +000020 <target name="init">
21 <tstamp />
22 <mkdir dir="${build}"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000023 <mkdir dir="${build.test}" />
Mark Slee83c52a82006-06-07 06:51:18 +000024 </target>
25
26 <target name="compile" depends="init">
David Reiss4ad40d72008-08-04 18:38:36 +000027 <javac srcdir="${src}" destdir="${build}" source="1.5" />
Mark Slee83c52a82006-06-07 06:51:18 +000028 </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 Slee54b7ab92007-03-06 00:06:27 +000035 <exec executable="install">
David Reissf0c21a72008-07-11 01:26:16 +000036 <arg line="libthrift.jar ${install.path}" />
Mark Slee83c52a82006-06-07 06:51:18 +000037 </exec>
38 </target>
39
40 <target name="clean">
41 <delete dir="${build}" />
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000042 <delete dir="${gen}"/>
43 <delete dir="${genbean}"/>
Mark Slee83c52a82006-06-07 06:51:18 +000044 <delete file="libthrift.jar" />
45 </target>
46
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000047 <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 Slee83c52a82006-06-07 06:51:18 +000084</project>