blob: 370156952a697366b57ceafd89e299b6eecf80e3 [file] [log] [blame]
pwyckoff99b000b2008-04-03 19:30:55 +00001<project name="libfb303" default="dist" basedir="..">
2
3 <!-- project wide settings. All directories relative to basedir -->
4 <property name="src.dir" value="java"/>
5 <property name="if.dir" value="if"/>
6 <property name="thrift_home" value="/usr/local"/>
7
8 <!-- temp build directories -->
9 <property name="build.dir" value="${src.dir}/build"/>
10 <property name="build.classes.dir" value="${build.dir}/classes"/>
11 <property name="build.lib.dir" value="${build.dir}/lib"/>
12
13 <!-- final distribution directories -->
14 <property name="dist.dir" value="/usr/local"/>
15 <property name="dist.lib.dir" value="${dist.dir}/lib"/>
16
17 <!-- make temporary and distribution directories -->
18 <target name="prepare">
19 <mkdir dir="${build.dir}"/>
20 <mkdir dir="${build.classes.dir}"/>
21 <mkdir dir="${build.lib.dir}"/>
22 <mkdir dir="${dist.dir}"/>
23 <mkdir dir="${dist.lib.dir}"/>
24 </target>
25
26 <!-- generate fb303 thrift code -->
27 <target name="thriftbuild">
28 <echo>generating thrift fb303 files</echo>
29 <exec executable="${thrift_home}/bin/thrift" failonerror="true">
30 <arg line="--gen java -I ${thrift_home}/share/ -o ${build.dir} ${src.dir}/../if/fb303.thrift" />
31 </exec>
32 </target>
33
34 <!-- compile the base and thrift generated code and jar them -->
35 <target name="dist" depends="prepare,thriftbuild">
36 <echo>Building libfb303.jar .... </echo>
37 <javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="on">
38 <classpath>
39 <pathelement location="${thrift_home}/lib/libthrift.jar"/>
40 </classpath>
41 <include name="*.java"/>
42 <include name="${build.dir}/gen-java/com/facebook/fb303"/>
43 </javac>
44 <jar jarfile="${build.lib.dir}/libfb303.jar" basedir="${build.classes.dir}">
45 </jar>
46 </target>
47
48 <!-- copy the build jar to the distribution library directory -->
49 <target name="install" depends="dist">
50 <copy todir="${dist.lib.dir}">
51 <fileset dir="${build.lib.dir}" includes="libfb303.jar"/>
52 </copy>
53 </target>
54
55 <target name="clean">
56 <echo>Cleaning old stuff .... </echo>
57 <delete dir="${build.dir}/classes/com"/>
58 <delete dir="${build.dir}/lib"/>
59 <delete dir="${build.dir}"/>
pwyckoff99b000b2008-04-03 19:30:55 +000060 </target>
61</project>