-
Notifications
You must be signed in to change notification settings - Fork 144
/
build.xml
executable file
·281 lines (232 loc) · 9.41 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
<?xml version="1.0"?>
<!DOCTYPE project [
<!--
Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!ENTITY commonSetup SYSTEM "./../../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../../../config/common.xml">
<!ENTITY run SYSTEM "./../../../../../config/run.xml">
<!ENTITY testProperties SYSTEM "./build.properties">
]>
<project name="cci" basedir="." default="usage">
&commonSetup;
&commonBuild;
&testProperties;
&run;
<target name="all" depends="build,setup,deploy,run,undeploy,unsetup" />
<target name="run-test" depends="build,deploy,run,undeploy" />
<target name="clean" depends="init-common">
<delete dir="${build.classes.dir}" />
<delete dir="${assemble.dir}" />
<delete dir="${assemble.dir}/rar" />
<delete file="${assemble.dir}/${rarname}.rar" />
<antcall target="create-dboutfile" />
</target>
<target name="compile" depends="clean">
<antcall target="compile-cci">
<param name="src" value="ejb" />
</antcall>
<antcall target="compile-cci">
<param name="src" value="client" />
</antcall>
<antcall target="compile-cci">
<param name="src" value="servlet" />
</antcall>
<javac srcdir="."
classpath="${mvn.lib.dir}/reporter.jar"
includes="client/WebTest.java"
destdir="."
/>
</target>
<target name="create-pool">
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="connector-embedded-cciApp#cciblackbox-${tx.mode}" />
<param name="connection.defname" value="jakarta.resource.cci.ConnectionFactory" />
<param name="connector.conpool.name" value="EMBEDDED-CCI-CONNPOOL" />
</antcall>
</target>
<target name="create-resource">
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="EMBEDDED-CCI-CONNPOOL" />
<param name="connector.jndi.name" value="eis/EMBEDDEDCCIEIS" />
</antcall>
</target>
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="EMBEDDED-CCI-CONNPOOL" />
</antcall>
</target>
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="eis/EMBEDDEDCCIEIS" />
</antcall>
</target>
<!--
Custom target for compilation with local libraries for connector
-->
<target name="compile-cci" depends="init-common">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="${src}"
destdir="${build.classes.dir}"
classpath="${s1astest.classpath}:${mvn.lib.dir}/cciblackbox-tx.jar"
failonerror="true"
/>
</target>
<target name="create-pb-proc" depends="init-common">
<jar destfile="${build.classes.dir}/cci-pb-proc.jar"
update="true"
includes="${build.classes.dir}/client/*SampleExternalMethods.class*"
/>
</target>
<target name="build">
<antcall target="build-embedded-ear" />
</target>
<target name="package-embedded-ejb">
<antcall target="package-ejbjar-common">
<param name="ejb-jar.xml" value="descriptor/ejb-jar.xml" />
<param name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml" />
<param name="ejbjar.classes" value="**/*Local*.class, **/*Remote*.class, **/*Bean*.class" />
<param name="ejbjar.files" value="${build.classes.dir}" />
<param name="ejb.jar" value="${assemble.dir}/cci-embedded-ejb.jar" />
</antcall>
</target>
<target name="build-embedded-ear" depends="compile">
<delete file="${assemble.dir}/connector-embeddedApp.ear" />
<mkdir dir="${assemble.dir}" />
<copy file="descriptor/application.xml" tofile="${assemble.dir}/application.xml" />
<mkdir dir="${build.classes.dir}/META-INF" />
<antcall target="package-embedded-ejb" />
<antcall target="package-rar" />
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes" />
<param name="appname" value="cci-embedded" />
<param name="web.xml" value="descriptor/web.xml" />
<param name="sun-web.xml" value="descriptor/sun-web.xml" />
<param name="webclient.war.classes" value="servlet/*.class, beans/*.class" />
</antcall>
<ear earfile="${assemble.dir}/${appname}App.ear" appxml="${assemble.dir}/application.xml">
<fileset dir="${assemble.dir}">
<include name="cci-embedded-ejb.jar" />
<include name="cciblackbox-tx.rar" />
<include name="cci-embedded-client.jar" />
<include name="cci-embedded-web.war" />
</fileset>
<fileset dir="${mvn.lib.dir}" includes="reporter.jar" />
</ear>
</target>
<target name="deploy" depends="init-common">
<antcall target="deploy-common" />
</target>
<target name="undeploy">
<antcall target="undeploy-common" />
</target>
<target name="run" depends="init-common">
<java classname="client.WebTest">
<arg value="${http.host}" />
<arg value="${http.port}" />
<arg value="${contextroot}" />
<arg value=" 1 " />
<classpath>
<pathelement location="${mvn.lib.dir}/reporter.jar" />
<pathelement location="." />
</classpath>
</java>
</target>
<target name="usage">
<antcall target="usage-common" />
</target>
<!-- ================================================================ -->
<!-- Target to create the appclient jar file with custom classes-->
<!-- ================================================================ -->
<target name="appclient-jar" depends="init-common">
<property name="appclientjar.classes"
value="**/*Local*.class,**/*Remote*.class,**/*Home*.class,**/*Client*.class"
/>
<antcall target="package-appclientjar-common">
<param name="appclientjar.files" value="${build.classes.dir}" />
<param name="appclient.jar" value="${assemble.dir}/${appname}-client.jar" />
</antcall>
</target>
<!-- ======================================================= -->
<!-- JVM options -->
<!-- ======================================================= -->
<target name="create-JVM-options">
<exec executable="${ASADMIN}" failonerror="false">
<arg line="create-jvm-options" />
<arg line="--user ${admin.user}" />
<arg line="--passwordfile ${env.APS_HOME}/devtests/connector/config/password.txt" />
<arg line="--host ${admin.host}" />
<arg line="--port ${admin.port}" />
<arg line=":-Djdbc.drivers=${jdbc.drivers}" />
</exec>
<!--<antcall target="reconfig-common" />-->
</target>
<target name="delete-JVM-options">
<exec executable="${ASADMIN}" failonerror="false">
<arg line="delete-jvm-options" />
<arg line="--user ${admin.user}" />
<arg line="--passwordfile ${env.APS_HOME}/devtests/connector/config/password.txt" />
<arg line="--host ${admin.host}" />
<arg line="--port ${admin.port}" />
<arg line=":-Djdbc.drivers=${jdbc.drivers}" />
</exec>
<!--<antcall target="reconfig-common" />-->
</target>
<target name="create-rar">
<copy file="descriptor/ra.xml" tofile="${assemble.dir}/rar/META-INF/ra.xml" />
<copy file="descriptor/sun-ra.xml" tofile="${assemble.dir}/rar/META-INF/sun-ra.xml" />
<copy file="${mvn.lib.dir}/cciblackbox-tx.jar" tofile="${assemble.dir}/rar/cciblackbox-tx.jar"
/>
<copy file="${env.APS_HOME}/sqetests/connector/lib/cci-derby-proc.jar"
tofile="${assemble.dir}/rar/cci-derby-proc.jar"
/>
<replace file="${assemble.dir}/rar/META-INF/ra.xml" token="DBURL" value="${db.url}" />
</target>
<target name="package-rar" depends="init-common">
<mkdir dir="${assemble.dir}/rar" />
<mkdir dir="${assemble.dir}/rar/META-INF" />
<antcall target="create-rar" />
<jar destfile="${assemble.dir}/${rarname}.rar" update="true">
<fileset dir="${assemble.dir}/rar">
</fileset>
<metainf dir="${assemble.dir}/rar/META-INF">
</metainf>
</jar>
</target>
<!-- db setup -->
<target name="create-sql">
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/cci-pb.sql" />
</antcall>
</target>
<target name="drop-sql">
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/cci-pb-drop.sql" />
</antcall>
</target>
<!-- Set classpath-suffix for pointbase -->
<!-- setup -->
<target name="setup" depends="init-common">
<antcall target="drop-sql" />
<antcall target="create-sql" />
</target>
<!-- unsetup -->
<target name="unsetup" depends="init-common">
<antcall target="drop-sql" />
</target>
<target name="create-dboutfile" depends="init-common">
<mkdir dir="${build.classes.dir}" />
<exec executable="touch">
<arg line="${build.classes.dir}/setupDBTables.out" />
</exec>
</target>
</project>