-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
167 lines (137 loc) · 4.91 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0"?>
<!--
File: build.xml
Copyright (C) 2006 Steve Ratcliffe
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 or 3 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Author: Steve Ratcliffe
Create date: 3 Jan 2008
-->
<project name="splitter" default="dist" basedir=".">
<!-- Init -->
<property name="top" value="."/>
<!--
This file is not checked into svn, so you can create it and put any
property definitions that you want to override those below.
-->
<property file="${top}/local.properties"/>
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="src" value="src"/>
<property name="lib" value="lib"/>
<property name="test" value="test"/>
<property name="doc" value="doc"/>
<property name="javadoc" value="${doc}/api"/>
<property name="resources" value="resources"/>
<property name="build.classes" value="${build}/classes"/>
<property name="build.test-classes" value="${build}/test-classes"/>
<property name="build.test-output" location="${build}/test-output"/>
<!-- Third party libraries -->
<property name="xpp.jar" location="${lib}/xpp3-1.1.4c.jar"/>
<property name="testng.jar" location="${lib}/testng-5.9-jdk15.jar"/>
<!-- Classpaths -->
<path id="classpath">
<pathelement location="${build.classes}"/>
<pathelement path="${xpp.jar}"/>
</path>
<path id="test.classpath">
<path refid="classpath"/>
<pathelement location="${build.test-classes}"/>
<pathelement path="${testng.jar}"/>
</path>
<!-- Prepare - make all the directories -->
<target name="prepare">
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.test-classes}"/>
<mkdir dir="${build.test-output}"/>
</target>
<target name="compile" depends="prepare" description="main compilation">
<javac srcdir="${src}" destdir="${build.classes}" debug="yes">
<include name="**/*.java"/>
<classpath refid="classpath"/>
</javac>
</target>
<target name="compile.tests" depends="prepare" description="test compilation">
<javac srcdir="${test}" destdir="${build.test-classes}" debug="yes">
<include name="**/*.java"/>
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="javadoc" description="Create the javadoc">
<mkdir dir="doc"/>
<javadoc destdir="${javadoc}">
<fileset dir="${src}" includes="**/*.java"/>
<classpath refid="classpath"/>
</javadoc>
</target>
<target name="run.tests" depends="compile.tests">
<!-- Run the java unit tests -->
<taskdef resource="testngtasks" classpath="${testng.jar}"/>
<testng classpathref="test.classpath" outputdir="${build.test-output}" haltonfailure="true">
<classfileset dir="${build.test-classes}">
<include name="**/*.class"/>
</classfileset>
</testng>
</target>
<target name="dist" depends="build" description="Make the distribution area">
<mkdir dir="${dist}"/>
<mkdir dir="${dist}/doc/api"/>
<!-- Make the jar -->
<jar basedir="${build.classes}" jarfile="${dist}/splitter.jar">
<manifest>
<attribute name="Main-Class" value="uk.me.parabola.splitter.Main"/>
</manifest>
<include name="**/*.class"/>
<include name="*.csv"/>
<include name="*.properties"/>
<zipfileset src="${xpp.jar}" includes="**/*.class,META-INF/services/**"/>
</jar>
<copy todir="${dist}/doc">
<fileset dir="doc" includes="*.txt"/>
</copy>
<!-- Copy the source code -->
<copy todir="${dist}/src">
<fileset dir="${src}"/>
</copy>
<copy todir="${dist}/test">
<fileset dir="${test}"/>
</copy>
<copy todir="${dist}/lib">
<fileset dir="${lib}"/>
</copy>
<!-- misc -->
<copy todir="${dist}">
<fileset dir="${basedir}">
<include name="README"/>
<include name="LICENCE*"/>
<include name="build.xml"/>
<include name="external.properties"/>
<include name="resources/**"/>
</fileset>
</copy>
</target>
<!-- Clean everything -->
<target name="clean">
<delete dir="${build}"/>
</target>
<!-- Clobber all generated and built files -->
<target name="clobber" depends="clean">
<delete dir="${dist}"/>
</target>
<!-- Main -->
<target name="build" depends="compile,compile.tests,run.tests">
<copy todir="${build.classes}">
<fileset dir="${resources}">
<include name="*.csv"/>
<include name="*.properties"/>
<include name="**/*.trans"/>
</fileset>
</copy>
</target>
<target name="rebuild" depends="clean, build"/>
</project>