/
build.xml
107 lines (96 loc) · 3.52 KB
/
build.xml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version="1.0"?>
<!-- ======================================================================
ant build file
====================================================================== -->
<project name="Phenoscape data loader" default="compile" basedir=".">
<description>Phenoscape data loader ant build</description>
<property name="src" value="src"/>
<property name="test" value="test"/>
<property name="classfiles" value="bin"/>
<property name="lib" value="lib"/>
<property name="jarfile" value="phenoscapedataloader.jar"/>
<tstamp>
<format property="NOW" pattern="yyyy-MM-dd_HH:mm:ss"/>
</tstamp>
<property name="project.build" value="${NOW}"/>
<property name="java-minimum" value="1.5"/>
<!-- The init target makes sure that the prerequisite directories exist. -->
<target name="init">
<mkdir dir="${classfiles}"/>
</target>
<path id="project.classpath">
<fileset dir="${lib}">
<include name="*"/>
</fileset>
</path>
<!-- The compile target runs javac on all the java files, and saves them into the classfiles directory -->
<target name="compile" depends="init">
<javac includeantruntime="false" srcdir="${src}" destdir="${classfiles}" debug="yes" source="${java-minimum}" target="${java-minimum}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="build-test" depends="compile">
<javac includeantruntime="false" srcdir="${test}" destdir="${classfiles}" debug="yes" source="${java-minimum}" target="${java-minimum}">
<classpath refid="project.classpath"/>
</javac>
</target>
<!-- terse FAIL or PASS -->
<target name="test" depends="build-test" description="Unit tests">
<junit fork="yes" printsummary="on" maxmemory="1024m">
<classpath>
<pathelement path="."/>
<pathelement path="${classfiles}"/>
<pathelement path="${src}"/> <!-- need to include src folder to find resource files such as filters -->
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</classpath>
<batchtest>
<fileset dir="${test}"/>
</batchtest>
</junit>
</target>
<!-- prints to stdout all messages -->
<target name="verbose-test" depends="build-test" description="Unit tests">
<junit fork="yes" printsummary="withOutAndErr" maxmemory="1024m">
<classpath>
<pathelement path="."/>
<pathelement path="${classfiles}"/>
<pathelement path="${src}"/> <!-- need to include src folder to find resource files such as filters -->
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</classpath>
<batchtest>
<fileset dir="${test}"/>
</batchtest>
</junit>
</target>
<!-- set var junit.test.class.name from cmd line for example: ant runatest -Djunit.test.class.name="org.phenoscape.io.NEXUSReaderTest"-->
<target name="runatest" depends="build-test">
<junit fork="yes" printsummary="withOutAndErr" maxmemory="1024m" showoutput="true">
<classpath>
<pathelement path="."/>
<pathelement path="${classfiles}"/>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</classpath>
<test name="${junit.test.class.name}"/>
</junit>
</target>
<!-- The clean target just erases the classes -->
<target name="clean">
<delete dir="${classfiles}"/>
</target>
<!-- clean and compile everything -->
<target name="build-all" depends="clean,compile,build-test"/>
<target name="jar" depends="compile">
<jar destfile="${jarfile}">
<fileset dir="${classfiles}"/>
<manifest>
<attribute name="build-date" value="${project.build}"/>
</manifest>
</jar>
</target>
</project>