root/trunk/org.bridgedb.webservice.picr/build.xml

Revision 586, 2.0 KB (checked in by martijn, 3 months ago)

Various fixes for unit testing in ant

  • Property svn:eol-style set to native
Line 
1<?xml version="1.0"?>
2<project name="org.bridgedb.webservice.picr" default="dist" basedir=".">
3
4  <!-- always be java 1.5 compatible -->
5  <property name="ant.build.javac.target" value="1.5"/>
6  <property name="ant.build.javac.source" value="1.5"/>
7       
8  <property name="jar.name" value="../dist/org.bridgedb.webservice.picr.jar"/>
9 
10  <target name="prepare">
11        <mkdir dir="build"/>
12  </target>
13
14  <path id="class.path">
15    <fileset dir="lib">
16      <include name="*.jar"/>
17    </fileset>
18    <fileset dir="../dist">
19      <include name="org.bridgedb.jar"/>
20    </fileset>
21  </path>
22
23  <target name="build" depends="prepare">
24        <javac srcdir="src"
25                   includes="**"
26                   debug="true"
27                   destdir="build">
28                <classpath refid="class.path"/>
29        </javac>
30  </target>
31 
32  <target name="jar" depends="build">
33    <manifestclasspath property="manifest.cp" jarfile="${jar.name}">
34      <classpath refid="class.path" />
35    </manifestclasspath>
36    <echo>${manifest.cp}</echo>
37        <jar jarfile="${jar.name}">
38          <manifest>
39                <attribute name="Class-Path" value="${manifest.cp}"/>
40          </manifest>
41          <fileset dir="build"/>
42          <fileset dir="src" includes="**/*.properties"/>
43        </jar>
44    <copy toDir="../dist"><path refid="class.path"/></copy>
45  </target>
46
47  <target name="dist" depends="jar"/>
48
49  <target name="clean">
50        <delete dir="build"/>
51  </target>
52
53  <target name="dist-clean" depends="clean">
54        <delete file="${jar.name}"/>
55       
56  </target>
57        <target name="test" depends="build">
58                <path id="test.classpath">
59                        <path refid="class.path"/>
60                        <pathelement location="build"/>
61                        <pathelement location="../org.bridgedb/build-lib/junit4.jar"/>
62                </path>
63                <javac srcdir="test" debug="true"
64                                        includes="**"
65                                        destdir="build"
66                                        source="1.5">
67                        <classpath refid="test.classpath"/>
68                </javac>               
69                <junit printsummary="on" haltonfailure="true" fork="true">
70                        <formatter type="brief" usefile="false"/>
71                        <classpath refid="test.classpath"/>
72                        <batchtest>
73                                <fileset dir="test">
74                                        <include name="**/*Test*.java"/>
75                                </fileset>
76                        </batchtest>
77                </junit>
78        </target>
79
80</project>
Note: See TracBrowser for help on using the browser.