-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
225 lines (189 loc) · 7.03 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!-- Ant build file for Lagoon -->
<!-- You need Apache Ant, version 1.4.1 or later, to use it -->
<!-- Get Ant from http://jakarta.apache.org/ant/ -->
<!-- To compile and run the testcases, you need JUnit 3.7 and
the Ant optional tasks installed -->
<!-- Assumes Java2 SDK 1.4 or later -->
<project name="Lagoon" default="lagoon">
<property file="build.properties"/>
<path id="lagoon.class.path">
<pathelement location="${FOP}" />
<pathelement location="${LogKit}" />
<pathelement location="${Ant}" />
<pathelement location="${LSP}" />
<pathelement location="${LSPC}" />
<fileset dir="${Batik}">
<include name="*.jar"/>
</fileset>
</path>
<property name="Name" value="Lagoon"/>
<property name="name" value="lagoon"/>
<property name="version" value="1.0b24"/>
<property name="ver" value="10b24"/>
<property name="res.dir" value="resource"/>
<property name="src.dir" value="src"/>
<property name="src.testsuite" value="testsuite"/>
<property name="build.dir" value="build"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.testsuite" value="${build.dir}/testsuite"/>
<target name="init">
<tstamp>
<format property="TODAY_DATE" pattern="yyyy-MM-dd" locale="en"/>
</tstamp>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.testsuite}"/>
<mkdir dir="dist"/>
</target>
<target name="lagoon_version_check">
<uptodate property="lagoon_version.notRequired"
targetfile="dist/${name}.jar">
<srcfiles dir="${build.classes}">
<include name="*"/>
<include name="nu/staldal/lagoon/**/*"/>
</srcfiles>
<srcfiles dir="${res.dir}"/>
</uptodate>
</target>
<target name="lagoon_version" depends="init,lagoon_version_check"
unless="lagoon_version.notRequired">
<filter token="NAME" value="${Name}" />
<filter token="VERSION" value="${version}" />
<filter token="DATE" value="${TODAY_DATE}" />
<copy file="version.txt" todir="${build.classes}"
filtering="on" overwrite="on"/>
</target>
<target name="lagoon_compile" depends="init">
<javac srcdir="${src.dir}"
includes="nu/staldal/lagoon/**/*"
destdir="${build.classes}"
source="1.4" target="1.4"
optimize="on" debug="on">
<classpath refid="lagoon.class.path"/>
</javac>
<copy todir="${build.classes}" includeEmptyDirs="no">
<fileset dir="${src.dir}">
<include name="nu/staldal/lagoon/**/*" />
<exclude name="**/*.java" />
<exclude name="**/*.lex" />
<exclude name="**/package.html" />
</fileset>
</copy>
</target>
<target name="lagoon"
depends="init,xmlutil,lagoon_compile,lagoon_version"
description="Compiles Lagoon">
<jar jarfile="dist/${name}.jar"
manifest="src/lagoon.mf">
<fileset dir="${build.classes}">
<include name="*"/>
<include name="nu/staldal/lagoon/**/*"/>
</fileset>
<fileset dir="${res.dir}"/>
</jar>
</target>
<target name="xmlutil" depends="init"
description="Compiles XML Utils">
<javac srcdir="${src.dir}"
includes="nu/staldal/xtree/**/*,nu/staldal/xmlutil/**/*,nu/staldal/ftp/**/*,nu/staldal/util/**/*,nu/staldal/xodus/**/*"
destdir="${build.classes}"
source="1.4" target="1.4"
optimize="on" debug="on">
<classpath>
<pathelement location="${JAF}" />
<pathelement location="${JARV}" />
</classpath>
</javac>
<copy todir="${build.classes}" includeEmptyDirs="no">
<fileset dir="${src.dir}">
<include name="nu/staldal/xtree/**/*" />
<include name="nu/staldal/xmlutil/**/*" />
<include name="nu/staldal/ftp/**/*" />
<include name="nu/staldal/util/**/*" />
<include name="nu/staldal/xodus/**/*" />
<exclude name="**/*.java" />
<exclude name="**/*.lex" />
<exclude name="**/package.html" />
</fileset>
</copy>
<jar jarfile="dist/xmlutil.jar">
<!-- manifest="src/xmlutil.mf" -->
<fileset dir="${build.classes}">
<include name="nu/staldal/xtree/**/*"/>
<include name="nu/staldal/xmlutil/**/*"/>
<include name="nu/staldal/ftp/**/*"/>
<include name="nu/staldal/util/**/*"/>
<include name="nu/staldal/xodus/**/*" />
</fileset>
</jar>
</target>
<target name="testsuite" depends="init,xmlutil,lagoon"
description="Compiles testsuite">
<javac srcdir="${src.testsuite}"
includes="nu/staldal/**/*"
destdir="${build.testsuite}"
source="1.4" target="1.4"
optimize="off" debug="on">
<classpath>
<pathelement location="${build.classes}" />
<pathelement location="${JUnit}" />
</classpath>
</javac>
<copy todir="${build.testsuite}" includeEmptyDirs="no">
<fileset dir="${src.testsuite}">
<include name="nu/staldal/**/*" />
<exclude name="**/*.java" />
<exclude name="**/package.html" />
</fileset>
</copy>
<junit>
<formatter type="plain" usefile="no"/>
<test name="nu.staldal.util.TestUtils"/>
<test name="nu.staldal.xtree.TestXTree"/>
<test name="nu.staldal.xtree.TestSequentialTreeBuilder"/>
<test name="nu.staldal.xodus.TestXMLCharacterEncoder"/>
<test name="nu.staldal.xodus.TestOutputConfig"/>
<!-- <test name="nu.staldal.xodus.TestXMLSerializer"/> -->
<!-- <test name="nu.staldal.lagoon.filestorage.TestLocalFileStorage"/> -->
<classpath>
<pathelement location="${build.classes}" />
<pathelement location="${build.testsuite}" />
</classpath>
</junit>
</target>
<target name="docs" depends="init"
description="Creates the documentation">
<copy todir="dist/docs">
<fileset dir="docs"/>
</copy>
<mkdir dir="dist/docs/javadoc"/>
<javadoc packagenames="nu.staldal.lagoon.core,nu.staldal.lagoon.util,nu.staldal.xtree,nu.staldal.xmlutil,nu.staldal.ftp,nu.staldal.util,nu.staldal.xodus"
sourcepath="${src.dir}"
classpathref="lagoon.class.path"
classpath="${JAF};${JARV}"
destdir="dist/docs/javadoc"
author="true"
version="true"
windowtitle="${Name} API"
doctitle="${Name}"/>
</target>
<target name="dist" depends="lagoon,docs"
description="Builds the Lagoon distribution">
<filter token="NAME" value="${Name}" />
<filter token="VERSION" value="${version}" />
<filter token="DATE" value="${TODAY_DATE}" />
<copy file="README" todir="dist"
overwrite="true"
filtering="on"/>
<copy file="LICENSE" todir="dist" />
<copy file="HISTORY" todir="dist" />
<copy todir="dist/bin">
<fileset dir="bin"/>
</copy>
<zip zipfile="${name}${ver}.zip"
basedir="dist" />
</target>
<target name="clean" description="Remove built files">
<delete dir="${build.dir}"/>
<delete dir="dist"/>
</target>
</project>