Do no make libyaz.so part of dist
[yaz4j-moved-to-github.git] / build.xml
index bd572bd..16bc930 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,44 +1,61 @@
-<project name="yaz4j" default="compile" basedir=".">\r
-\r
-  <description>Build the java side of Yaz4J</description>\r
-\r
-  <property name="version" value="0.9.3"/>     \r
-  <property name="src" location="src"/>\r
-  <property name="bin" location="bin"/>\r
-  <property name="distributions"  location="distributions"/>\r
-       \r
-  <path id="project.classpath">\r
-    <pathelement location="${bin}"/>\r
-  </path>\r
-\r
-  <target name="init">\r
-    <mkdir dir="${bin}"/>\r
-  </target>\r
-\r
-  <target name="compile" depends="init" description="compile the source">\r
-    <javac srcdir="${src}" destdir="${bin}">\r
-       <classpath refid="project.classpath"/>\r
-    </javac>\r
-  </target>\r
-\r
-  <target name="build-dist" depends="compile" description="generate the distribution">\r
-    <mkdir dir="${distributions}/${version}"/>\r
-    <jar jarfile="${distributions}/${version}/yaz4j.jar" basedir="${bin}">\r
-      <manifest>\r
-        <attribute name="Version" value="${version}"/>\r
-        <attribute name="Author" value="Talis Information Ltd"/>\r
-        <attribute name="About" value="Java wrapper for the ZOOM API of YAZ"/>\r
-        <attribute name="Main-Class" value="org.yaz4j.Yaz4jMain"/>\r
-      </manifest>\r
-    </jar>\r
-    <copy file="libyaz4j/lib/libyaz4j.so" tofile="${distributions}/${version}/libyaz4j.so"/>\r
-    <copy file="dependencies/yaz-2.1.28/lib/libyaz.so" tofile="${distributions}/${version}/libyaz.so"/>\r
-  </target>\r
-\r
-  <target name="clean" description="clean up" >\r
-    <!-- Delete various paths as part of the clean trees -->\r
-    <delete dir="${bin}"/>\r
-    <!-- delete dir="${distributions}/${version}"/ -->\r
-  </target>\r
-\r
-</project>\r
+<project name="yaz4j" default="compile" basedir=".">
+
+  <description>Build the java side of Yaz4J</description>
+
+  <property name="version" value="0.9.3"/>     
+  <property name="src" location="src"/>
+  <property name="test" location="test"/>
+  <property name="bin" location="bin"/>
+  <property name="distributions"  location="distributions"/>
+       
+  <path id="project.classpath">
+    <pathelement location="${bin}"/>
+    <pathelement location="dependencies/JUnit-4.3.1/junit-4.3.1.jar"/>
+  </path>
+
+  <target name="init">
+    <mkdir dir="${bin}"/>
+  </target>
+
+  <target name="compile" depends="init" description="compile the source">
+    <javac srcdir="${src}" destdir="${bin}">
+       <classpath refid="project.classpath"/>
+    </javac>
+  </target>
+
+  <target name="compile-test" depends="compile" description="compile test the code">
+    <javac srcdir="${test}" destdir="${bin}">
+       <classpath refid="project.classpath"/>
+    </javac>
+  </target>
+
+  <!-- LD_LIBRARY_PATH=libyaz4j/lib java -cp bin:dependencies/JUnit-4.3.1/junit-4.3.1.jar org.junit.runner.JUnitCore yaz4jtest.ConnectionTest -->
+
+  <target name="unit-test" depends="compile-test" description="test the code">
+    <junit fork="on">
+       <env key="LD_LIBRARY_PATH" value="libyaz4j/lib"/>
+       <classpath refid="project.classpath"/>
+       <test name="yaz4jtest.ConnectionTest"/>
+    </junit>
+  </target>
+
+  <target name="build-dist" depends="compile" description="generate the distribution">
+    <mkdir dir="${distributions}/${version}"/>
+    <jar jarfile="${distributions}/${version}/yaz4j.jar" basedir="${bin}">
+      <manifest>
+        <attribute name="Version" value="${version}"/>
+        <attribute name="Author" value="Talis Information Ltd"/>
+        <attribute name="About" value="Java wrapper for the ZOOM API of YAZ"/>
+        <attribute name="Main-Class" value="org.yaz4j.Yaz4jMain"/>
+      </manifest>
+    </jar>
+    <copy file="libyaz4j/lib/libyaz4j.so" tofile="${distributions}/${version}/libyaz4j.so"/>
+  </target>
+
+  <target name="clean" description="clean up" >
+    <!-- Delete various paths as part of the clean trees -->
+    <delete dir="${bin}"/>
+    <!-- delete dir="${distributions}/${version}"/ -->
+  </target>
+
+</project>