-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.target.xml
executable file
·205 lines (185 loc) · 6.39 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
<!-- 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="${src.dir}"/>
</exec>
</target>
<!-- ======= -->
<!-- COMPILE -->
<!-- ======= -->
<target name="compile" depends="codegen.mesg" if="compile.required">
<mkdir dir="${out.dir}"/>
<available file="srcdpc" property="srcdpc.dir" value="srcdpc"/>
<property name="srcdpc.dir" value=""/>
<javac srcdir="${src.dir}:${codegen.dir}:${srcdpc.dir}" destdir="${out.dir}"
debug="${debug}" optimize="${optimize}" encoding="UTF-8"
target="${target.version}" deprecation="${deprecation}" source="${source.version}">
<compilerarg value="-Xlint:unchecked"/>
</javac>
</target>
<!-- ====== -->
<!-- DEPLOY -->
<!-- ====== -->
<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}"/>
</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="${unzip.files}"/>
<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>
</target>
<target name="deploy.tomcat"
depends="config.build, stop.service, deploy.tomcat.files, start.service"
if="deploy.tomcat.required">
</target>
<target name="deploy" depends="deploy.lib, deploy.tomcat">
</target>
<!-- ===== -->
<!-- BUILD -->
<!-- ===== -->
<target name="build.jar" depends="gentime, compile" if="build.jar.required">
<mkdir dir="${src.archive.dir}"/>
<mkdir dir="${codegen.archive.dir}"/>
<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"/>
<fileset dir="${codegen.archive.dir}" includes="**"
excludes="META-INF/MANIFEST.MF"/>
</jar>
</target>
<target name="gentime" depends="config" if="gentime.required">
<exec executable="bash" dir="." failonerror="true">
<arg value="${bin.dir}/gentime"/>
<arg value="${codegen.dir}/${gentime}"/>
</exec>
</target>
<target name="build.war" depends="compile" if="build.war.required">
<mkdir dir="${out.dir}"/>
<property name="src.web.xml" value="${war.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="${war.dir}/META-INF/MANIFEST.MF">
<fileset dir="${war.dir}" includes="**"
excludes="WEB-INF/web.xml, META-INF/MANIFEST.MF"/>
<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"
depends="config.build, build.war, build.jar, deploy">
</target>
<!-- ===== -->
<!-- CLEAN -->
<!-- ===== -->
<target name="clean">
<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}"/>
<!--fileset dir="${tomcat.lib.dir}" includes="${xar.name}"/-->
<fileset dir="${tomcat.webapps.dir}" includes="${xar.name}"/>
</delete>
</target>
<!-- ========= -->
<!-- UNIT TEST -->
<!-- ========= -->
<target name="utest" depends="build">
<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
destdir="${working.javadoc.dir}"
sourcepath="${src.dir}:${codegen.dir}"
author="true" protected="true" version="true" use="true"
windowtitle="${project.title} ${project.version} API"
doctitle="${project.title} ${project.version} API"
additionalparam="-breakiterator -source ${source.version}">
<bottom><![CDATA[Copyright © 2005-2010 Potix Corporation. All Rights Reserved.
<!--{{JAVASCRIPT_OUTPUT}}-->
]]></bottom>
<classpath>
<pathelement path="${javadoc.class.path}"/>
</classpath>
</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}"/>
<delete quiet="true" dir="${working.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/zkoss/**/*.xml, org/zkoss/**/*.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>