blob: 7567be4c3041a1fe52c6144d6128551136f72912 [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" />
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000013 <property name="test.thrift.home" location="../../test"/>
14
15 <property file="${user.home}/.thrift-build.properties" />
Bryan Duxbury538e3442009-02-10 04:49:39 +000016
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000017 <property name="cpath" location="libthrift.jar:${thrift.extra.cpath}" />
Bryan Duxbury538e3442009-02-10 04:49:39 +000018
Mark Slee83c52a82006-06-07 06:51:18 +000019 <target name="init">
20 <tstamp />
21 <mkdir dir="${build}"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000022 <mkdir dir="${build.test}" />
Mark Slee83c52a82006-06-07 06:51:18 +000023 </target>
24
25 <target name="compile" depends="init">
Bryan Duxbury538e3442009-02-10 04:49:39 +000026 <javac srcdir="${src}" destdir="${build}" source="1.5" debug="true"/>
Mark Slee83c52a82006-06-07 06:51:18 +000027 </target>
28
29 <target name="dist" depends="compile">
30 <jar jarfile="libthrift.jar" basedir="${build}"/>
31 </target>
32
33 <target name="install" depends="dist">
Mark Slee54b7ab92007-03-06 00:06:27 +000034 <exec executable="install">
David Reissf0c21a72008-07-11 01:26:16 +000035 <arg line="libthrift.jar ${install.path}" />
Mark Slee83c52a82006-06-07 06:51:18 +000036 </exec>
37 </target>
38
39 <target name="clean">
40 <delete dir="${build}" />
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000041 <delete dir="${gen}"/>
42 <delete dir="${genbean}"/>
Mark Slee83c52a82006-06-07 06:51:18 +000043 <delete file="libthrift.jar" />
44 </target>
45
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000046 <target name="compile-test" description="Build the test suite classes" depends="generate,dist">
47 <javac debug="true" srcdir="${gen}" destdir="${build.test}" classpath="${cpath}" />
48 <javac debug="true" srcdir="${genbean}" destdir="${build.test}" classpath="${cpath}" />
49 <javac debug="true" srcdir="${src.test}" destdir="${build.test}" classpath="${cpath}:${gen}" />
50 </target>
51
52 <target name="test" description="Run the full test suite" depends="compile-test">
53 <java classname="org.apache.thrift.test.JSONProtoTest"
54 classpath="${cpath}:${build.test}" failonerror="true" />
Bryan Duxbury538e3442009-02-10 04:49:39 +000055 <java classname="org.apache.thrift.test.TCompactProtocolTest"
56 classpath="${cpath}:${build.test}" failonerror="true" />
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000057 <java classname="org.apache.thrift.test.IdentityTest"
58 classpath="${cpath}:${build.test}" failonerror="true" />
59 <java classname="org.apache.thrift.test.EqualityTest"
60 classpath="${cpath}:${build.test}" failonerror="true" />
61 <java classname="org.apache.thrift.test.ToStringTest"
62 classpath="${cpath}:${build.test}" failonerror="true" />
63 <java classname="org.apache.thrift.test.DeepCopyTest"
64 classpath="${cpath}:${build.test}" failonerror="true" />
Bryan Duxbury986d7052009-01-29 01:51:08 +000065 <java classname="org.apache.thrift.test.MetaDataTest"
66 classpath="${cpath}:${build.test}" failonerror="true" />
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000067 <java classname="org.apache.thrift.test.JavaBeansTest"
68 classpath="${cpath}:${build.test}" failonerror="true" />
69 </target>
70
71 <target name="generate">
72 <exec executable="../../compiler/cpp/thrift">
73 <arg line="--gen java:hashcode ${test.thrift.home}/ThriftTest.thrift" />
74 </exec>
75 <exec executable="../../compiler/cpp/thrift">
76 <arg line="--gen java:hashcode ${test.thrift.home}/DebugProtoTest.thrift" />
77 </exec>
78 <exec executable="../../compiler/cpp/thrift">
79 <arg line="--gen java:hashcode ${test.thrift.home}/OptionalRequiredTest.thrift" />
80 </exec>
81 <exec executable="../../compiler/cpp/thrift">
82 <arg line="--gen java:beans,nocamel ${test.thrift.home}/JavaBeansTest.thrift" />
83 </exec>
84 </target>
85
Mark Slee83c52a82006-06-07 06:51:18 +000086</project>