-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.xml
277 lines (250 loc) · 14.4 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Ant 1.5 OpenMPI v1.2 core build script for the Verified@ONCE Product Suite
Author: [email protected]
Author: Andrew Whitehead
-->
<project name="OpenMPI v1.2" default="build-all" basedir=".">
<!-- *****************************************************************************************
* Initilization of all property settings
***************************************************************************************** -->
<target name="init">
<tstamp />
<!-- =======================================================================================
+ General properties
======================================================================================= -->
<property file="build.properties" />
<echo message="Executing ANT build script for platform: ${target.platform}/${target.database}" />
</target>
<!-- *****************************************************************************************
* prepare folder structure
***************************************************************************************** -->
<target name="prepare" depends="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.dir}/installer" />
<mkdir dir="${report.dir}" />
</target>
<!-- *****************************************************************************************
* Check if sub-components are present
***************************************************************************************** -->
<target name="check-subproject" depends="init">
<!-- =======================================================================================
+ core build scripts
======================================================================================= -->
<available file="${core.source.dir}/${core.package}/build.xml" type="file" property="core.source.present" />
<available file="${core.source.descriptor.dir}/web.xml" type="file" property="core.source.web.present" />
<available file="${core.junit.dir}/${core.package}/build.xml" type="file" property="core.junit.present" />
<!-- =======================================================================================
+ bridge build scripts
======================================================================================= -->
<available file="${bridge.source.dir}/${bridge.package}/build.xml" type="file" property="bridge.source.present" />
<available file="${bridge.source.descriptor.dir}/web.xml" type="file" property="bridge.source.web.present" />
<available file="${bridge.junit.dir}/${bridge.package}/build.xml" type="file" property="bridge.junit.present" />
<!-- =======================================================================================
+ 3rd party libraries
======================================================================================= -->
<available file="${lib.dir}" type="dir" property="lib.present" />
</target>
<!-- *****************************************************************************************
* Build Verified@ONCE Core component v1.1
*
* Only build when the source build.xml is present
***************************************************************************************** -->
<target name="build-core-source"
depends="prepare, check-subproject"
if="core.source.present"
>
<ant dir="${core.source.dir}/${core.package}" target="core-source-build" />
</target>
<!-- *****************************************************************************************
* Run Verified@ONCE Core v1.1 Junit tests
*
* Only build when the source build.xml is present
***************************************************************************************** -->
<target name="run-core-junit"
depends="check-subproject, prepare"
if="enable.testing"> <!-- core.junit.present? -->
<ant dir="${core.junit.dir}/${core.package}" target="core-junit-run" />
</target>
<!-- *****************************************************************************************
* Build common JAR files used by all component of the Verified@ONCE product Suite
***************************************************************************************** -->
<target name="build-common-jar"
depends="build-core-source, build-bridge-source">
<echo message="Creating COMMON JAR file for all Verified@ONCE Core components..." />
<mkdir dir="${dist.common.dir}" />
<mkdir dir="${core.source.class.dir}" />
<jar destfile="${dist.common.dir}/MPICommon.jar"
basedir="${core.source.class.dir}"
includes="com/oncecorp/visa3d/mpi/configuration/Config.class,
com/oncecorp/visa3d/mpi/configuration/CoreConfigInfo.class,
com/oncecorp/visa3d/mpi/configuration/MerchantMetaInfo.class,
com/oncecorp/visa3d/mpi/configuration/MPIConfigDefinition.class,
com/oncecorp/visa3d/mpi/configuration/ValidationInfo.class,
com/oncecorp/visa3d/mpi/messaging/MsgTypeStatisticResult.class,
com/oncecorp/visa3d/mpi/messaging/MsgStatusStatisticResult.class,
com/oncecorp/visa3d/mpi/messaging/MsgMerchantIDStatisticResult.class,
com/oncecorp/visa3d/mpi/messaging/StatusCategoryID.class
com/oncecorp/visa3d/mpi/messaging/Message.class,
com/oncecorp/visa3d/mpi/utility/Utils.class,
com/oncecorp/visa3d/mpi/utility/XMLSerializable.class,
com/oncecorp/visa3d/mpi/utility/XMLUtil.class" />
<jar destfile="${dist.common.dir}/BridgeBeans.jar" >
<fileset dir="${bridge.source.class.dir}" includes="com/oncecorp/visa3d/bridge/beans/**" />
<fileset dir="${bridge.source.class.dir}" includes="com/oncecorp/visa3d/bridge/utility/**" />
</jar>
</target>
<!-- *****************************************************************************************
* Build WAR files for Verified@ONCE Core
***************************************************************************************** -->
<target name="build-core-war"
depends="build-core-source, build-common-jar"
if="core.source.web.present">
<echo message="Creating WAR file for all Verified@ONCE Core components..." />
<war destfile="${dist.dir}/CoreServer.war" webxml="${core.source.descriptor.dir}/web-${target.platform}-${target.database}.xml">
<!-- <lib dir="${lib.dir}/common" />
<lib dir="${lib.dir}/core" /> -->
<fileset dir="${root.dir}" includes="${core.libs}" />
<classes dir="${core.source.class.dir}" />
</war>
</target>
<!-- *****************************************************************************************
* Build Installer-ready WAR files for Verified@ONCE Core Server Component
***************************************************************************************** -->
<target name="build-core-installer-war"
depends="build-core-source, build-common-jar"
if="core.source.web.present">
<echo message="Creating Installer-compliant WAR file for all Verified@ONCE Core components..." />
<war destfile="${dist.dir}/installer/CoreServer.war" webxml="${core.source.descriptor.dir}/web-installer.xml">
<!-- <lib dir="${lib.dir}/common" />
<lib dir="${lib.dir}/core" /> -->
<fileset dir="${root.dir}" includes="${core.libs}" />
<classes dir="${core.source.class.dir}" />
</war>
</target>
<!-- *****************************************************************************************
* Build everything associated with Verified@ONCE Core
***************************************************************************************** -->
<target name="build-core" depends="build-core-war,
build-core-installer-war,
build-core-source,
run-core-junit" />
<!-- *****************************************************************************************
* Build Verified@ONCE DataBridge component
*
* Only build when the source build.xml is present
***************************************************************************************** -->
<target name="build-bridge-source"
depends="check-subproject, prepare"
if="bridge.source.present"
>
<ant dir="${bridge.source.dir}/${bridge.package}" target="bridge-source-build" />
</target>
<!-- *****************************************************************************************
* Run Verified@ONCE DataBridge Junit tests
*
* Only build when the source build.xml is present
***************************************************************************************** -->
<target name="run-bridge-junit"
depends="build-bridge-source, check-subproject, prepare"
if="enable.testing"
> <!-- bridge.junit.present? -->
<ant dir="${bridge.junit.dir}/${bridge.package}" target="bridge-junit-run" />
</target>
<!-- *****************************************************************************************
* Build WAR files for Verified@ONCE DataBridge
***************************************************************************************** -->
<target name="build-bridge-war"
depends="build-bridge-source"
if="bridge.source.web.present"
>
<echo message="Creating WAR file for all Verified@ONCE DataBridge components..." />
<war destfile="${dist.dir}/DataBridge.war" webxml="${bridge.source.descriptor.dir}/web-${target.platform}-${target.database}.xml">
<!-- <lib dir="${lib.dir}/common" />
<lib dir="${lib.dir}/bridge" /> -->
<fileset dir="${root.dir}" includes="${bridge.libs}" />
<classes dir="${bridge.source.class.dir}" />
</war>
</target>
<!-- *****************************************************************************************
* Build Installer-compliant WAR files for Verified@ONCE DataBridge
***************************************************************************************** -->
<target name="build-bridge-installer-war"
depends="build-bridge-source"
if="bridge.source.web.present"
>
<echo message="Creating Installer-compliant WAR file for all Verified@ONCE DataBridge components..." />
<war destfile="${dist.dir}/installer/DataBridge.war" webxml="${bridge.source.descriptor.dir}/web-installer.xml">
<!-- <lib dir="${lib.dir}/common" />
<lib dir="${lib.dir}/bridge" /> -->
<fileset dir="${root.dir}" includes="${bridge.libs}" />
<classes dir="${bridge.source.class.dir}" />
</war>
</target>
<!-- *****************************************************************************************
* Build everything associated with Verified@ONCE DataBridge
***************************************************************************************** -->
<target name="build-bridge" depends="build-bridge-source,
build-bridge-installer-war,
run-bridge-junit,
build-bridge-war" />
<!-- *****************************************************************************************
* Build everything
***************************************************************************************** -->
<target name="build-all-installer" depends="build-core-installer-war,
build-bridge-installer-war">
<!-- Copy the latest build to the "latest" directory. Easier for installer -->
<copy todir="${dist.latest.dir}" >
<fileset dir="${dist.dir}" >
<include name="**/*"/>
</fileset>
</copy>
</target>
<!-- *****************************************************************************************
* Build everything
***************************************************************************************** -->
<target name="build-all" depends="build-core, build-bridge" />
<!-- *****************************************************************************************
* Clean everything associated with Core
***************************************************************************************** -->
<target name="clean-core" depends="init, check-subproject">
<ant dir="${core.source.dir}/${core.package}" target="core-source-clean" />
<ant dir="${core.junit.dir}/${core.package}" target="core-junit-clean" />
</target>
<!-- *****************************************************************************************
* Clean everything associated with DataBridge
***************************************************************************************** -->
<target name="clean-bridge" depends="init, check-subproject">
<ant dir="${bridge.junit.dir}/${bridge.package}" target="bridge-junit-clean" />
<ant dir="${bridge.source.dir}/${bridge.package}" target="bridge-source-clean" />
</target>
<!-- *****************************************************************************************
* Clean everything
***************************************************************************************** -->
<target name="clean-all" depends="clean-core, clean-bridge" />
<target name="clean-all-dist" depends="init">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${build.dir}" />
</delete>
</target>
<!-- *****************************************************************************************
* Alternate build targets
***************************************************************************************** -->
<target name="test">
<antcall target="build-all">
<param name="enable.testing" value="1" />
</antcall>
</target>
<target name="docs">
<antcall target="build-all">
<param name="enable.javadoc" value="1" />
</antcall>
</target>
<target name="all">
<antcall target="build-all">
<param name="enable.testing" value="1" />
<param name="enable.javadoc" value="1" />
</antcall>
</target>
</project>