-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.xml
366 lines (300 loc) · 13.3 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<!--
Copyright (C) 2004 VeriSign, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-0107 USA
http://www.verisign.com/nds/naming/namestore/techdocs.html
-->
<project name="EPP SDK-DefReg" default="jar" basedir=".">
<import file="${basedir}/common-targets.xml"/>
<!-- SDK home directory -->
<property name="sdk.home.dir" location=".."/>
<!-- Ensure environment variables are set to env prefixed properties -->
<property environment="env"/>
<!-- All properties can be overridden in build.properties -->
<property file="${basedir}/build.properties"/>
<property name="defreg.gen.dir" value="${sdk.home.dir}/gen"/>
<property name="defreg.idn.dir" value="${sdk.home.dir}/idn"/>
<property name="defreg.gen.src.dir" value="${defreg.gen.dir}/java"/>
<property name="defreg.idn.src.dir" value="${defreg.idn.dir}/java"/>
<!-- Temporary directory used for distribution -->
<property name="defreg.tmp.dir" location="${defreg.dir}/tmp"/>
<!-- compiler option properties -->
<property name="debug" value="on"/>
<property name="optimize" value="on"/>
<property name="deprecation" value="on"/>
<!-- classpath to use for compilation tasks -->
<path id="defreg.compile.classpath">
<fileset dir="${defreg.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${defreg.epp.lib.dir}">
<include name="epp-gen.jar"/>
<include name="epp-idn.jar"/>
</fileset>
</path>
<!-- classpath to use for compilation tasks -->
<path id="defreg.test.classpath">
<fileset dir="${defreg.epp.lib.dir}">
<include name="*.jar"/>
</fileset>
<path refid="defreg.compile.classpath"/>
</path>
<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init"
description="Initializes the build for rest of targets ">
<!-- set time stamp properties -->
<tstamp/>
<!-- Give build.version a default value of SNAPSHOT -->
<property name="build.version" value="SNAPSHOT"/>
<echo message="----------- ${ant.project.name} ${build.version} ------------"/>
<mkdir dir="${defreg.results.dir}" />
<mkdir dir="${defreg.build.dir}" />
<mkdir dir="${defreg.epp.lib.dir}" />
</target>
<!-- =================================================================== -->
<!-- Builds the epp-gen.jar file -->
<!-- =================================================================== -->
<target name="jar-gen"
description="Build the dependent epp-gen.jar file" >
<ant dir="${defreg.gen.dir}" target="jar" />
</target>
<!-- =================================================================== -->
<!-- Cleans the epp-gen files -->
<!-- =================================================================== -->
<target name="clean-gen"
description="Clean the epp-gen files" >
<ant dir="${defreg.gen.dir}" target="clean" />
</target>
<!-- =================================================================== -->
<!-- Builds the epp-idn.jar file -->
<!-- =================================================================== -->
<target name="jar-idn"
description="Build the dependent epp-idn.jar file" >
<ant dir="${defreg.idn.dir}" target="jar" />
</target>
<!-- =================================================================== -->
<!-- Cleans the epp-idn files -->
<!-- =================================================================== -->
<target name="clean-idn"
description="Clean the epp-idn files" >
<ant dir="${defreg.idn.dir}" target="clean" />
</target>
<!-- =================================================================== -->
<!-- Compiles source files -->
<!-- =================================================================== -->
<target name="compile" depends="init, jar-gen, jar-idn"
description="Compile EPP SDK-DefReg source files" >
<echo message="${ant.project.name} ${build.version} Compile"/>
<javac srcdir="${defreg.src.dir}"
destdir="${defreg.build.dir}"
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}"
failonerror="true"
target="1.6"
>
<classpath refid="defreg.compile.classpath" />
</javac>
</target>
<!-- =================================================================== -->
<!-- Creates epp-defreg.jar -->
<!-- =================================================================== -->
<target name="jar" depends="compile"
description="Generates EPP SDK-DefReg .jar file (default)" >
<!-- Set default value of build.version to SNAPSHOT -->
<property name="build.version" value="SNAPSHOT"/>
<jar jarfile="${defreg.epp.lib.dir}/epp-defreg.jar" >
<manifest>
<attribute name="baseline" value="EPP-CONTACT-SDK-${build.version}"/>
</manifest>
<fileset dir="${defreg.build.dir}"
includes="com/**/*.class" />
<fileset dir="${defreg.dir}"
includes="schemas/*.xsd" />
</jar>
</target>
<!-- =================================================================== -->
<!-- Formats the source code using Jalopy -->
<!-- =================================================================== -->
<target name="format"
description="Format the source code">
<taskdef name="jalopy"
classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
<classpath>
<fileset dir="${defreg.lib.dir}/jalopy">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<jalopy fileformat="unix"
convention="${defreg.lib.dir}/jalopy/sdk-convention.xml"
loglevel="info"
threads="2"
classpathref="defreg.compile.classpath">
<fileset dir="${defreg.src.dir}">
<include name="**/*.java"/>
<exclude name="**/types/*.java"/>
</fileset>
</jalopy>
</target>
<!-- =================================================================== -->
<!-- Creates the HTML API documentation -->
<!-- =================================================================== -->
<target name="doc"
description="Generate EPP SDK-DefReg HTML API documentation" >
<mkdir dir="${defreg.doc.dir}/html"/>
<javadoc packagenames="com.verisign.epp.*"
sourcepath="${defreg.src.dir}:${defreg.gen.src.dir}:${defreg.idn.src.dir}"
destdir="${defreg.doc.dir}/html"
author="true"
version="true"
use="true"
breakiterator="true"
splitindex="true"
noindex="false"
windowtitle="${ant.project.name} API"
doctitle="${ant.project.name}"
bottom="Copyright © VeriSign Inc. All Rights Reserved.">
<classpath refid="defreg.compile.classpath" />
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Ensure that build.version is set -->
<!-- =================================================================== -->
<target name="check-build-version" unless="build.version">
<fail message="Must set build.version with -Dbuild.version=X"/>
</target>
<!-- =================================================================== -->
<!-- Creates SDK source distribution -->
<!-- =================================================================== -->
<target name="dist-src" depends="check-build-version, init"
description = "Creates SDK source distribution (-Dbuild.version required)" >
<mkdir dir="${defreg.dist.dir}" />
<!-- Create source .zip distribution -->
<zip destfile="${defreg.dist.dir}/epp-defreg-${build.version}-src.zip">
<zipfileset dir="${defreg.license.dir}" prefix="eppsdk/license"/>
<zipfileset dir="${defreg.lib.dir}" prefix="eppsdk/lib">
<exclude name="epp/**"/>
</zipfileset>
<zipfileset dir="${defreg.epp.lib.dir}" prefix="eppsdk/lib/epp">
<include name="${defreg.epp.lib.dir}/epp-gen-${build.version}.jar"/>
<include name="${defreg.epp.lib.dir}/epp-idn-${build.version}.jar"/>
</zipfileset>
<zipfileset dir="${defreg.dir}" prefix="eppsdk/defreg">
<exclude name="junit*"/>
<exclude name="*.log*"/>
<exclude name="*.err"/>
<exclude name="build-bin.xml"/>
<exclude name="doc/*.doc"/>
<exclude name="doc/html/**"/>
<exclude name="results/**"/>
<exclude name="build/**"/>
</zipfileset>
</zip>
<!-- Create source .tar.gz distribution -->
<tar destfile="${defreg.dist.dir}/epp-defreg-${build.version}-src.tar.gz"
compression="gzip">
<tarfileset dir="${defreg.license.dir}" prefix="eppsdk/license"/>
<tarfileset dir="${defreg.lib.dir}" prefix="eppsdk/lib">
<exclude name="epp/**"/>
</tarfileset>
<tarfileset dir="${defreg.dir}" mode="755" prefix="eppsdk/defreg">
<exclude name="junit*"/>
<exclude name="*.log*"/>
<exclude name="*.err"/>
<exclude name="build-bin.xml"/>
<exclude name="doc/*.doc"/>
<exclude name="doc/html/**"/>
<exclude name="results/**"/>
<exclude name="build/**"/>
</tarfileset>
</tar>
</target>
<!-- =================================================================== -->
<!-- Creates SDK binary distribution -->
<!-- =================================================================== -->
<target name="dist-bin" depends="check-build-version, jar, test, doc"
description = "Creates SDK binary distribution (-Dbuild.version required)" >
<mkdir dir="${defreg.dist.dir}" />
<mkdir dir="${defreg.tmp.dir}" />
<copy file="${defreg.dir}/build-bin.xml" tofile="${defreg.tmp.dir}/build.xml"/>
<!-- Create binary .zip distribution -->
<zip destfile="${defreg.dist.dir}/epp-defreg-${build.version}-bin.zip">
<zipfileset dir="${defreg.license.dir}" prefix="eppsdk/license"/>
<zipfileset dir="${defreg.lib.dir}" prefix="eppsdk/lib"/>
<zipfileset dir="${defreg.tmp.dir}" includes="build.xml" prefix="eppsdk/defreg"/>
<zipfileset dir="${defreg.dir}" prefix="eppsdk/defreg">
<exclude name="*.log"/>
<exclude name="*.err"/>
<exclude name="java/**"/>
<exclude name="schemas/**"/>
<exclude name="build.xml"/>
<exclude name="build-bin.xml"/>
<exclude name="doc/*.doc"/>
<exclude name="results/**"/>
<exclude name="build/**"/>
<exclude name="tmp/**"/>
</zipfileset>
</zip>
<!-- Create binary .tar.gz distribution -->
<tar destfile="${defreg.dist.dir}/epp-defreg-${build.version}-bin.tar.gz"
compression="gzip">
<tarfileset dir="${defreg.license.dir}" prefix="eppsdk/license"/>
<tarfileset dir="${defreg.lib.dir}" prefix="eppsdk/lib"/>
<tarfileset dir="${defreg.tmp.dir}" includes="build.xml" prefix="eppsdk/defreg"/>
<tarfileset dir="${defreg.dir}" mode="755" prefix="eppsdk/defreg">
<exclude name="*.log"/>
<exclude name="*.err"/>
<exclude name="java/**"/>
<exclude name="schemas/**"/>
<exclude name="build.xml"/>
<exclude name="build-bin.xml"/>
<exclude name="doc/*.doc"/>
<exclude name="results/**"/>
<exclude name="build/**"/>
<exclude name="tmp/**"/>
</tarfileset>
</tar>
<delete dir="${defreg.tmp.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Creates SDK distributions -->
<!-- =================================================================== -->
<target name="dist" depends="dist-src, dist-bin"
description = "Creates SDK distributions (-Dbuild.version required)" >
</target>
<!-- =================================================================== -->
<!-- Clean targets -->
<!-- =================================================================== -->
<target name="clean" depends="init, clean-gen, clean-idn"
description="Clean EPP SDK-DefReg compiled files" >
<!-- Clean build directory -->
<delete dir="${defreg.build.dir}" quiet="true"/>
<!-- Clean the EPP lib directory -->
<delete dir="${defreg.epp.lib.dir}" quiet="true"/>
<!-- Clean results directory -->
<delete dir="${defreg.results.dir}" quiet="true"/>
<!-- Clean log files -->
<delete>
<fileset dir="${defreg.dir}" includes="*.log, *.err"/>
</delete>
<!-- Clean generated documentation files -->
<delete dir="${defreg.doc.dir}/html" quiet="true"/>
<!-- Clean distribution directory -->
<delete dir="${defreg.dist.dir}" quiet="true"/>
<!-- Clean the tmp directory -->
<delete dir="${defreg.tmp.dir}" quiet="true"/>
</target>
</project>
<!-- End of file -->