summaryrefslogtreecommitdiffstats
path: root/src/java/build.xml
blob: 49509adbf66c4050f9d4a060242896d2c6e49b46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?xml version="1.0"?>
<project name="cephfs-java" default="main" basedir=".">

  <description>CephFS Java Bindings</description>

  <property name="src.dir" location="java" />
  <property name="doc.dir" location="doc" />
  <property name="test.dir" location="test" />

  <property environment="env"/>

  <target name="clean">
    <delete dir="${doc.dir}" />
    <delete>
      <fileset dir="${test.dir}" includes="**/*.class" />
    </delete>
    <delete file="./libcephfs-test.jar" />
  </target>

  <target name="makedir">
    <mkdir dir="${doc.dir}" />
  </target>

  <target name="docs" depends="makedir">
    <javadoc packagenames="src" sourcepath="${src.dir}" destdir="${doc.dir}">
      <fileset dir="${src.dir}">
        <include name="**/*.java" />
      </fileset>
    </javadoc>
  </target>

  <target name="compile-tests-jar">
    <javac srcdir="${test.dir}" destdir="${test.dir}"
      includeantruntime="false" source="1.5" target="1.5"> 
      <classpath>
        <pathelement location="${env.CEPHFS_JAR}"/>
        <pathelement location="libcephfs.jar"/>
        <pathelement location="${env.CLASSPATH}" />
      </classpath>
    </javac>
    <jar destfile="./libcephfs-test.jar"> 
      <fileset dir="${test.dir}" includes="**/*.class"/>  
    </jar>
  </target>

  <target name="test" depends="compile-tests-jar">
    <junit printsummary="yes" haltonfailure="yes" showoutput="yes" fork="true">
      <sysproperty key="java.library.path" path="${env.CEPHFS_JNI_LIB}:../../build/lib/"/>
      <sysproperty key="CEPH_CONF_FILE" path="${env.CEPHFS_CONF}"/>
      <jvmarg value="-Xcheck:jni"/>
      <classpath>
        <pathelement location="${env.CEPHFS_JAR}"/>
        <pathelement location="libcephfs.jar"/>
        <pathelement location="libcephfs-test.jar"/>
      </classpath>
      <formatter type="plain"/>
      <test name="com.ceph.fs.CephAllTests" haltonerror="true" />
    </junit>
  </target>

  <target name="test-compat" depends="compile-tests-jar">
    <junit printsummary="yes" haltonfailure="yes" showoutput="yes" fork="true">
      <sysproperty key="java.library.path" path="${env.CEPHFS_JNI_LIB}:../../build/lib/"/>
      <sysproperty key="CEPH_CONF_FILE" path="${env.CEPHFS_CONF}"/>
      <classpath>
        <pathelement location="${env.CEPHFS_JAR}"/>
        <pathelement location="libcephfs.jar"/>
        <pathelement location="libcephfs-test.jar"/>
      </classpath>
      <formatter type="plain"/>
      <test name="com.ceph.fs.CephAllTests" haltonerror="true" />
    </junit>
  </target>

</project>