Proper running unittest.
[yaz4j-moved-to-github.git] / build.xml
1 <project name="yaz4j" default="compile" basedir=".">
2
3   <description>Build the java side of Yaz4J</description>
4
5   <property name="version" value="0.9.3"/>      
6   <property name="src" location="src"/>
7   <property name="test" location="test"/>
8   <property name="bin" location="bin"/>
9   <property name="distributions"  location="distributions"/>
10         
11   <path id="project.classpath">
12     <pathelement location="${bin}"/>
13     <pathelement location="dependencies/JUnit-4.3.1/junit-4.3.1.jar"/>
14   </path>
15
16   <target name="init">
17     <mkdir dir="${bin}"/>
18   </target>
19
20   <target name="compile" depends="init" description="compile the source">
21     <javac srcdir="${src}" destdir="${bin}">
22        <classpath refid="project.classpath"/>
23     </javac>
24   </target>
25
26   <target name="compile-test" depends="compile" description="compile test the code">
27     <javac srcdir="${test}" destdir="${bin}">
28        <classpath refid="project.classpath"/>
29     </javac>
30   </target>
31
32   <!-- LD_LIBRARY_PATH=libyaz4j/lib java -cp bin:dependencies/JUnit-4.3.1/junit-4.3.1.jar org.junit.runner.JUnitCore yaz4jtest.ConnectionTest -->
33
34   <target name="unit-test" depends="compile-test" description="test the code">
35     <junit fork="on">
36        <env key="LD_LIBRARY_PATH" value="libyaz4j/lib"/>
37        <classpath refid="project.classpath"/>
38        <test name="yaz4jtest.ConnectionTest"/>
39     </junit>
40   </target>
41
42   <target name="build-dist" depends="compile" description="generate the distribution">
43     <mkdir dir="${distributions}/${version}"/>
44     <jar jarfile="${distributions}/${version}/yaz4j.jar" basedir="${bin}">
45       <manifest>
46         <attribute name="Version" value="${version}"/>
47         <attribute name="Author" value="Talis Information Ltd"/>
48         <attribute name="About" value="Java wrapper for the ZOOM API of YAZ"/>
49         <attribute name="Main-Class" value="org.yaz4j.Yaz4jMain"/>
50       </manifest>
51     </jar>
52     <copy file="libyaz4j/lib/libyaz4j.so" tofile="${distributions}/${version}/libyaz4j.so"/>
53     <copy file="dependencies/yaz-2.1.28/lib/libyaz.so" tofile="${distributions}/${version}/libyaz.so"/>
54   </target>
55
56   <target name="clean" description="clean up" >
57     <!-- Delete various paths as part of the clean trees -->
58     <delete dir="${bin}"/>
59     <!-- delete dir="${distributions}/${version}"/ -->
60   </target>
61
62 </project>