forked from zkoss/zkckeditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.target.xml
339 lines (305 loc) · 11.4 KB
/
build.target.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
<!-- build.target.xml
Purpose:
The target definitions for build.xml
Description:
The target definitions are put in a separate file for two reasons:
1) it is shared by two projects
2) reduce the complexity of build.xml
History:
Wed Aug 21 18:01:44 2002, Created by tomyeh
Copyright (C) 2002-2006 Potix Corporation. All Rights Reserved.
-->
<!-- ======= -->
<!-- CODEGEN -->
<!-- ======= -->
<target name="codegen.mesg" depends="config.build" if="src.mesg.dir.exist">
<!-- generate MxxConst.java -->
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/genprop"/>
<arg value="-x"/>
<arg value="${src.mesg.dir}"/>
<arg value="${codegen.dir}"/>
</exec>
</target>
<!-- ======= -->
<!-- COMPILE -->
<!-- ======= -->
<target name="compile" depends="codegen.mesg" if="compile.required">
<mkdir dir="${out.dir}"/>
<javac srcdir="${src.dir}:${codegen.dir}" destdir="${out.dir}"
debug="${debug}" optimize="${optimize}" encoding="UTF-8"
target="1.5" deprecation="${deprecation}"
source="1.5"/>
</target>
<!-- ====== -->
<!-- DEPLOY -->
<!-- ====== -->
<target name="deploy.export" depends="config.build" if="src.export.dir.exist">
<copy todir="${dist.export.dir}" preservelastmodified="yes">
<fileset dir="${src.export.dir}" excludes="**/CVS/**"/>
</copy>
</target>
<target name="deploy.lib" depends="config.build" if="deploy.lib.required">
<copy todir="${dist.lib.dir}" preservelastmodified="yes">
<fileset dir="${out.dir}" includes="${xar.name}, ${jad.name}"/>
</copy>
</target>
<target name="stop.service" depends="config.build"
if="start.service.required">
<exec executable="net" dir="." failonerror="false">
<arg value="stop"/>
<arg value="${start.service}"/>
</exec>
</target>
<target name="start.service" depends="config.build"
if="start.service.required">
<exec executable="net" dir="." failonerror="false">
<arg value="start"/>
<arg value="${start.service}"/>
</exec>
</target>
<target name="deploy.tomcat.files" depends="config.build"
if="deploy.tomcat.required">
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/deploy.unzip.war"/>
<arg value="${dist.lib.dir}"/>
<arg value="${tomcat.webapps.dir}"/>
<arg value="${ear.libs}"/>
<arg value="${root.context}/ROOT"/>
</exec>
<copy todir="${tomcat.lib.dir}" preservelastmodified="yes">
<fileset dir="${dist.lib.dir}" includes="${server.libs}"/>
<fileset dir="${dist.lib.ext.dir}" includes="${server.libs}"/>
</copy>
<copy tofile="${tomcat.conf.dir}/i3-log.conf" file="${dist.conf.dir}/i3-log.conf.local"
preservelastmodified="yes" failonerror="false"/>
</target>
<target name="deploy.tomcat"
depends="config.build, stop.service, deploy.tomcat.files, start.service"
if="deploy.tomcat.required">
</target>
<target name="deploy.jboss.intact" depends="config.build"
if="deploy.jboss.intact.required">
<!-- deploy to server intact -->
<copy todir="${jboss.deploy1.dir}" preservelastmodified="yes">
<fileset dir="${out.dir}" includes="${xar.name}"/>
</copy>
</target>
<target name="deploy.jboss.unzip" depends="config.build"
if="deploy.jboss.unzip.required">
<!-- deploy to server by unzip -->
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/deploy.unzip"/>
<arg value="${out.dir}/${xar.name}"/>
<arg value="${jboss.deploy1.dir}"/>
<arg value="${deploy.unzip.list}"/>
</exec>
</target>
<target name="deploy.jboss"
depends="config.build, deploy.jboss.unzip, deploy.jboss.intact"
if="deploy.jboss.required">
<mkdir dir="${dist.conf.dir}"/>
<!-- deploy configuration files -->
<copy tofile="${jboss.conf.dir}/i3-log.conf" file="${dist.conf.dir}/i3-log.conf.local"
preservelastmodified="yes" failonerror="false"/>
<copy todir="${jboss.conf.dir}" preservelastmodified="yes">
<fileset dir="${dist.conf.dir}"
includes="*-service.xml,i3-ks,*-policy.xml,*.properties"/>
</copy>
<copy todir="${jboss.app.conf.dir}" preservelastmodified="yes">
<fileset dir="${dist.conf.dir}"
includes="i3-*.xml" excludes="*-service.xml,i3-ks"/>
</copy>
<!-- deploy external library -->
<copy todir="${jboss.lib.dir}" preservelastmodified="yes">
<fileset dir="${dist.lib.ext.dir}" includes="${server.libs}"/>
</copy>
<copy todir="${jboss.lib.dir}" preservelastmodified="yes">
<fileset dir="${dist.lib.dir}" includes="${server.libs}"/>
</copy>
</target>
<target name="deploy"
depends="deploy.export, deploy.lib, deploy.tomcat, deploy.jboss">
</target>
<!-- ===== -->
<!-- BUILD -->
<!-- ===== -->
<target name="build.jar" depends="compile, copy.web.jar" if="build.jar.required">
<mkdir dir="${src.archive.dir}"/>
<mkdir dir="${codegen.archive.dir}"/>
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/zipjs"/>
<arg value="${dist.lib.ext.dir}/yuicompressor.jar"/>
<arg value="${dist.lib.ext.dir}/bsh.jar"/>
<arg value="${bin.dir}/rm1stcomment.java"/>
<arg value="${src.archive.dir}/${zipjs}"/>
<arg value="${codegen.archive.dir}/${zipjs}"/>
</exec>
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/zipcss"/>
<arg value="${dist.lib.ext.dir}/yuicompressor.jar"/>
<arg value="${src.archive.dir}/${zipcss}"/>
<arg value="${codegen.archive.dir}/${zipcss}"/>
</exec>
<jar jarfile="${out.dir}/${jar.name}" manifest="${manifest.mf}">
<fileset dir="${out.dir}" excludes="${exclude.list}"/>
<fileset dir="${src.archive.dir}" includes="**"
excludes="META-INF/MANIFEST.MF, ${zipjs}/**, ${zipcss}/**"/>
<fileset dir="${codegen.archive.dir}" includes="**"
excludes="META-INF/MANIFEST.MF"/>
</jar>
</target>
<target name="build.jad" depends="compile, copy.web.jar" if="build.jad.required">
<mkdir dir="${src.archive.dir}"/>
<mkdir dir="${codegen.archive.dir}"/>
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/preverify"/>
<arg value="${out.dir}"/>
<arg value="${outv.dir}"/>
</exec>
<jar jarfile="${out.dir}/${jar.name}" manifest="${manifest.mf}">
<fileset dir="${outv.dir}" excludes="${exclude.list}, ${jad.name}"/>
<fileset dir="${src.archive.dir}" includes="**"
excludes="META-INF/MANIFEST.MF, META-INF/${jad.name}, **/CVS/**, ${zipjs}/**"/>
<fileset dir="${codegen.archive.dir}" includes="**"
excludes="META-INF/MANIFEST.MF"/>
</jar>
<!-- generate ${out.dir}/${project-name}.jad -->
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/genjad"/>
<arg value="${out.dir}/${jar.name}"/>
<arg value="${src.archive.dir}/META-INF/${jad.name}"/>
<arg value="${out.dir}/${jad.name}"/>
</exec>
</target>
<!-- copy WEB-relevant resource to jar (into codegen.archive.web.dir) -->
<target name="copy.web.jar" depends="deploy.export" if="copy.web.jar.required">
<mkdir dir="${codegen.archive.web.dir}"/>
<copy todir="${codegen.archive.web.dir}" preservelastmodified="yes"
failonerror="false">
<fileset dir="${dist.export.dir}" includes="${import.libs}"/>
<fileset dir="${dist.lib.ext.dir}" includes="${import.libs}"/>
<fileset dir="${src.export.dir}" includes="${import.libs}"/>
</copy>
</target>
<target name="build.war" depends="compile" if="build.war.required">
<mkdir dir="${out.dir}"/>
<property name="src.web.xml" value="${src.archive.dir}/WEB-INF/web.xml"/>
<!-- to let other targets have a chance to override it -->
<war warfile="${out.dir}/${war.name}" webxml="${src.web.xml}"
manifest="${manifest.mf}">
<fileset dir="${src.archive.dir}" includes="**"
excludes="WEB-INF/web.xml, META-INF/MANIFEST.MF, **/CVS/**, **/_notes/**, **/_raw/**"/>
<fileset dir="${dist.export.dir}" includes="${import.libs}"/>
<fileset dir="${dist.lib.ext.dir}" includes="${import.libs}"/>
<lib dir="${dist.lib.ext.dir}" includes="${war.libs}"/>
<lib dir="${dist.lib.dir}" includes="${war.libs}"/>
<classes dir="${out.dir}" includes="**" excludes="${exclude.list}"/>
</war>
</target>
<target name="build.ear" depends="config.build" if="build.ear.required">
<mkdir dir="${out.dir}"/>
<!-- build ear -->
<ear earfile="${out.dir}/${ear.name}" manifest="${manifest.mf}"
appxml="${application.xml}">
<fileset dir="${dist.lib.dir}" includes="${ear.libs}"/>
<fileset dir="${src.archive.dir}"
includes="META-INF/**"
excludes="META-INF/MANIFEST.MF, META-INF/application.xml, **/CVS/**"/>
</ear>
</target>
<target name="build"
depends="config.build, build.war, build.jad, build.jar, build.ear, deploy">
</target>
<!-- ===== -->
<!-- CLEAN -->
<!-- ===== -->
<target name="clean.all" depends="config" if="clean.all.required">
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${dist.export.dir}" includes="**"/>
</delete>
<delete quiet="true">
<fileset dir="${dist.lib.dir}" includes="*.?ar, *.jad"/>
</delete>
</target>
<target name="clean.bin" depends="config" if="clean.bin.required">
<delete quiet="true" dir="${bin.dir}"/>
</target>
<target name="clean" depends="clean.all">
<delete quiet="true" dir="${out.dir}"/>
<delete quiet="true" dir="${tmp.dir}"/>
<delete quiet="true" dir="${outv.dir}"/>
<delete quiet="true" dir="${codegen.dir}"/>
<delete quiet="true">
<fileset dir="${dist.lib.dir}" includes="${xar.name}, ${jad.name}"/>
<!--fileset dir="${jboss.lib.dir}" includes="${xar.name}"/-->
<fileset dir="${jboss.deploy1.dir}" includes="${xar.name}"/>
<!--fileset dir="${tomcat.lib.dir}" includes="${xar.name}"/-->
<fileset dir="${tomcat.webapps.dir}" includes="${xar.name}"/>
</delete>
</target>
<!-- ========= -->
<!-- UNIT TEST -->
<!-- ========= -->
<target name="deploy.test" depends="config" if="dist.test.dir.exist">
<copy todir="${jboss.app.test.dir}" preservelastmodified="yes">
<fileset dir="${dist.test.dir}" includes="**" excludes="**/CVS/**"/>
</copy>
</target>
<target name="utest" depends="build, deploy.test">
<property name="class.test" value="**/*Test.java"/><!-- test all if not defined -->
<echo message="Test ${class.test}..."/>
<junit fork="yes" haltonerror="${haltonerror}" dir="${out.dir}">
<jvmarg value="-ea"/>
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement path="${java.class.path}"/>
<pathelement location="${out.dir}"/>
</classpath>
<batchtest>
<fileset dir="${src.dir}" includes="${class.test}"/>
</batchtest>
</junit>
</target>
<!-- ============= -->
<!-- MISCELLANEOUS -->
<!-- ============= -->
<target name="javadoc" depends="config.build">
<javadoc packagenames="org.*"
destdir="${working.javadoc.dir}"
author="true" protected="true" version="true" use="true"
windowtitle="${project.name} ${project.version} API"
doctitle="${project.name} ${project.version} API"
additionalparam="-breakiterator -source 1.5"
bottom="Copyright &copy; 2005-2007 Potix Corporation. All Rights Reserved.">
<classpath>
<pathelement path="${javadoc.class.path}"/>
</classpath>
<packageset dir="${src.dir}">
<include name="org/**"/>
</packageset>
<fileset dir="${codegen.dir}">
<include name="org/**"/>
<exclude name="**/*$$*"/>
</fileset>
</javadoc>
<delete quiet="true" dir="${dist.javadoc.dir}"/>
<move todir="${dist.javadoc.dir}">
<fileset dir="${working.javadoc.dir}"/>
</move>
<delete quiet="true" dir="${working.javadoc.dir}"/>
<!-- copy xml and html to the destination since they might be referenced
by package.html -->
<copy todir="${dist.javadoc.dir}" preservelastmodified="yes">
<fileset dir="${src.dir}"
includes="org/**/*.xml, org/**/*.html"
excludes="**/package.html" />
</copy>
</target>
<target name="jsdoc">
<!-- generate JavaScript Doc -->
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/jsdoc"/>
<arg value="${project.name}"/>
</exec>
</target>