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

Revision 586, 2.9 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.cronos" 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.cronos.jar"/>
9 
10  <target name="prepare">
11        <mkdir dir="build"/>
12  </target>
13
14  <path id="dependencies">
15        <fileset dir="lib/axis-1_4/lib" includes="*.jar" />
16  </path>
17 
18  <path id="class.path">
19    <path refid="dependencies"/>
20    <fileset dir="../dist">
21      <include name="org.bridgedb.jar"/>
22      <include name="org.bridgedb.bio.jar"/>
23    </fileset>
24  </path>
25
26  <target name="build" depends="prepare">
27        <javac srcdir="src-axis"
28                   includes="**"
29                   debug="true"
30                   destdir="build">
31                <classpath refid="class.path"/>
32        </javac>
33    <javac srcdir="src"
34                   includes="**"
35                   debug="true"
36                   destdir="build">
37                <classpath refid="class.path"/>
38        </javac>
39    <copy toDir="../dist"><path refid="dependencies"/></copy>
40  </target>
41 
42  <target name="jar" depends="build">
43        <jar jarfile="${jar.name}">
44          <fileset dir="build" includes="**/*.class"/>
45        </jar>
46  </target>
47
48  <target name="clean">
49        <delete dir="build"/>
50        <delete dir="doc"/>
51  </target>
52
53  <target name="dist-clean" depends="clean">
54        <delete file="${jar.name}"/>
55  </target>
56
57  <target name="dist" depends="jar"/>
58                         
59        <target name="test" depends="build">
60                <path id="test.classpath">
61                        <path refid="class.path"/>
62                        <pathelement location="build"/>
63                        <pathelement location="../org.bridgedb/build-lib/junit4.jar"/>
64                        <pathelement location="../org.bridgedb/build-lib/measure.jar"/>
65                </path>
66                <javac srcdir="test" debug="true"
67                                        includes="**"
68                                        destdir="build"
69                                        source="1.5">
70                        <classpath refid="test.classpath"/>
71                </javac>               
72                <junit printsummary="on" haltonfailure="true" fork="true">
73                        <formatter type="brief" usefile="false"/>
74                        <classpath refid="test.classpath"/>
75                        <batchtest>
76                                <fileset dir="test">
77                                        <include name="**/*Test*.java"/>
78                                </fileset>
79                        </batchtest>
80                </junit>
81        </target>
82
83        <property name="wsdl.url" value="http://mips.helmholtz-muenchen.de/genre/proj/cronos/CronosWSService.wsdl"/>
84        <property name="src.axis" value="src-axis"/>
85        <property name="build.wpclient.dir" value="build/wpclient" />
86       
87        <target name="update-axis">
88                <fail message="You must specify a url to the CRONOS web service WSDL:
89                        ant -Dwsdl.url=http://mips.helmholtz-muenchen.de/genre/proj/cronos/CronosWSService.wsdl [ant target]">
90                        <condition>
91                                <not> <isset property="wsdl.url"/> </not>
92                        </condition>
93                </fail>
94                <delete dir="${src.axis}"/>
95                <java classpathref="class.path" fork="true" failonerror="true" classname="org.apache.axis.wsdl.WSDL2Java">
96                        <arg value="-o" />
97                        <arg value="${src.axis}" />
98                        <arg value="-p" />
99                        <arg value="org.bridgedb.webservice.cronos" />
100                        <arg value="${wsdl.url}" />
101                </java>
102        </target>
103
104</project>
Note: See TracBrowser for help on using the browser.