mas01mj@723
|
1 <project name="AudioDB" default="compile" basedir="." xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
|
mas01mj@722
|
2 <cpptasks:cc />
|
mas01mj@722
|
3 <cpptasks:compiler />
|
mas01mj@722
|
4 <cpptasks:linker />
|
mas01mj@722
|
5
|
mas01mj@722
|
6 <property name="src" location="src" />
|
mas01mj@722
|
7 <property name="ext" location="ext" />
|
mas01mj@722
|
8 <property name="gen" location="gen" />
|
mas01mj@725
|
9 <property name="test" location="test" />
|
mas01mj@722
|
10 <property name="build" location="build" />
|
mas01mj@725
|
11
|
mas01mj@725
|
12 <path id="classpath.base">
|
mas01mj@725
|
13 <pathelement location="${build}" />
|
mas01mj@725
|
14 </path>
|
mas01mj@725
|
15
|
mas01mj@725
|
16 <path id="classpath.test">
|
mas01mj@725
|
17 <pathelement location="lib/junit.jar" />
|
mas01mj@725
|
18 <pathelement location="${test}" />
|
mas01mj@725
|
19 <path refid="classpath.base" />
|
mas01mj@725
|
20 </path>
|
mas01mj@722
|
21
|
mas01mj@722
|
22 <target name="init">
|
mas01mj@722
|
23 <tstamp />
|
mas01mj@722
|
24 <mkdir dir="${build}" />
|
mas01mj@722
|
25 <mkdir dir="${gen}" />
|
mas01mj@722
|
26 </target>
|
mas01mj@722
|
27
|
mas01mj@725
|
28 <target name="clean" depends="init,clean-test">
|
mas01mj@723
|
29 <delete dir="${build}" />
|
mas01mj@723
|
30 <delete dir="${gen}" />
|
mas01mj@723
|
31 </target>
|
mas01mj@723
|
32
|
mas01mj@722
|
33 <target name="compile" depends="init">
|
mas01mj@722
|
34 <javac srcdir="${src}" destdir="${build}"/>
|
mas01mj@722
|
35 <javah destdir="${gen}" force="yes" classpath="${build}">
|
mas01mj@722
|
36 <class name="org.omras2.AudioDB" />
|
mas01mj@722
|
37 </javah>
|
mas01mj@722
|
38 <cpptasks:cc link="shared" outtype="shared" objdir="${build}" outfile="${build}/AudioDB_JNI">
|
mas01mj@722
|
39 <compilerarg value="-shared" />
|
mas01mj@722
|
40 <compilerarg value="-fPIC" />
|
mas01mj@722
|
41 <compilerarg value="-g" />
|
mas01mj@722
|
42 <linker name="ld">
|
mas01mj@722
|
43 <linkerarg value="-fPIC" />
|
mas01mj@722
|
44 <linkerarg value="-G" />
|
mas01mj@722
|
45 <linkerarg value="-laudioDB" />
|
mas01mj@725
|
46 <linkerarg value="-lc" />
|
mas01mj@722
|
47 <linkerarg value="-o AudioDB_JNI.so" />
|
mas01mj@722
|
48 </linker>
|
mas01mj@722
|
49 <fileset dir="${ext}" includes="libAudioDB_JNI.c" />
|
mas01mj@722
|
50 <includepath>
|
mas01mj@722
|
51 <path path="${os.JAVA_HOME}/include" />
|
mas01mj@722
|
52 <path path="${os.JAVA_HOME}/include/linux/" />
|
mas01mj@722
|
53 <path path="/usr/local/include/" />
|
mas01mj@722
|
54 <path path="${gen}" />
|
mas01mj@722
|
55 </includepath>
|
mas01mj@722
|
56 </cpptasks:cc>
|
mas01mj@722
|
57 </target>
|
mas01mj@725
|
58
|
mas01mj@725
|
59
|
mas01mj@725
|
60 <target name="compile-test" depends="compile">
|
mas01mj@725
|
61 <javac srcdir="${test}">
|
mas01mj@725
|
62 <classpath refid="classpath.test"/>
|
mas01mj@725
|
63 </javac>
|
mas01mj@725
|
64 </target>
|
mas01mj@725
|
65 <target name="clean-test">
|
mas01mj@725
|
66 <delete>
|
mas01mj@725
|
67 <fileset dir="${test}" includes="**/*.class" />
|
mas01mj@725
|
68 </delete>
|
mas01mj@725
|
69 </target>
|
mas01mj@725
|
70
|
mas01mj@725
|
71 <target name="test" depends="compile-test">
|
mas01mj@725
|
72 <junit fork="yes">
|
mas01mj@725
|
73 <jvmarg value="-Djava.library.path=build" />
|
mas01mj@725
|
74 <classpath refid="classpath.test" />
|
mas01mj@725
|
75 <formatter type="brief" usefile="false" />
|
mas01mj@725
|
76 <test name="TestCreate" />
|
mas01mj@725
|
77 <test name="TestInsert" />
|
mas01mj@725
|
78 <test name="TestQuery" />
|
mas01mj@725
|
79 </junit>
|
mas01mj@725
|
80 </target>
|
mas01mj@722
|
81 </project>
|
mas01mj@722
|
82
|