forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-common.xml
472 lines (420 loc) · 23.7 KB
/
build-common.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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<?xml version="1.0"?>
<project name="common" xmlns:antelope="antlib:ise.antelope.tasks">
<property name="project.dir" value=".." />
<property name="test.properties" value="com/liferay/portal/tools/dependencies/portal-tools.properties" />
<property environment="env" />
<property file="${project.dir}/app.server.${user.name}.properties" />
<property file="${project.dir}/app.server.${env.COMPUTERNAME}.properties" />
<property file="${project.dir}/app.server.${env.HOST}.properties" />
<property file="${project.dir}/app.server.${env.HOSTNAME}.properties" />
<property file="${project.dir}/app.server.properties" />
<property file="${project.dir}/build.${user.name}.properties" />
<property file="${project.dir}/build.${env.COMPUTERNAME}.properties" />
<property file="${project.dir}/build.${env.HOST}.properties" />
<property file="${project.dir}/build.${env.HOSTNAME}.properties" />
<property file="${project.dir}/build.properties" />
<property file="${project.dir}/release.${user.name}.properties" />
<property file="${project.dir}/release.${env.COMPUTERNAME}.properties" />
<property file="${project.dir}/release.${env.HOST}.properties" />
<property file="${project.dir}/release.${env.HOSTNAME}.properties" />
<property file="${project.dir}/release.properties" />
<property file="${project.dir}/benchmarks/benchmarks.${user.name}.properties" />
<property file="${project.dir}/benchmarks/benchmarks.${env.COMPUTERNAME}.properties" />
<property file="${project.dir}/benchmarks/benchmarks.${env.HOST}.properties" />
<property file="${project.dir}/benchmarks/benchmarks.${env.HOSTNAME}.properties" />
<property file="${project.dir}/benchmarks/benchmarks.properties" />
<property file="${project.dir}/sql/sql.${user.name}.properties" />
<property file="${project.dir}/sql/sql.${env.COMPUTERNAME}.properties" />
<property file="${project.dir}/sql/sql.${env.HOST}.properties" />
<property file="${project.dir}/sql/sql.${env.HOSTNAME}.properties" />
<property file="${project.dir}/sql/sql.properties" />
<property name="liferay.home" value="${app.server.parent.dir}" />
<path id="lib.classpath">
<fileset dir="${project.dir}/lib/development" includes="*.jar" />
<fileset dir="${project.dir}/lib/global" includes="*.jar" />
<fileset dir="${project.dir}/lib/portal" includes="*.jar" />
</path>
<path id="project.classpath">
<pathelement path="${classpath}" />
<path refid="lib.classpath" />
</path>
<path id="test.classpath">
<pathelement path="${classpath}" />
<fileset dir="${project.dir}/lib/development" includes="*.jar" excludes="jetty*.jar,selenium-server.jar,tomcat*.jar" />
<fileset dir="${project.dir}/lib/global" includes="*.jar" />
<fileset dir="${project.dir}/lib/portal" includes="*.jar" excludes="ant.jar" />
</path>
<path id="web.classpath">
<pathelement location="${project.dir}/portal-service/classes" />
<fileset dir="${project.dir}/lib/development" includes="jsp-api.jar,mail.jar,servlet-api.jar" />
<fileset dir="${project.dir}/lib/global" includes="*.jar" />
<path refid="web-lib.classpath" />
</path>
<taskdef classpathref="lib.classpath" resource="net/sf/antcontrib/antlib.xml" />
<taskdef classpathref="lib.classpath" resource="axis-tasks.properties" />
<taskdef classpathref="lib.classpath" resource="ise/antelope/tasks/antlib.xml" uri="antlib:ise.antelope.tasks" />
<taskdef classpathref="lib.classpath" resource="com/orangevolt/tools/ant/taskdefs.properties" />
<taskdef classpathref="lib.classpath" resource="tasks.properties" />
<property name="doc.dir" value="${project.dir}/api" />
<propertycopy name="app.server.version" from="app.server.${app.server.type}.version" silent="true" />
<propertycopy name="app.server.dir" from="app.server.${app.server.type}.dir" />
<propertycopy name="app.server.bin.dir" from="app.server.${app.server.type}.bin.dir" />
<propertycopy name="app.server.classes.global.dir" from="app.server.${app.server.type}.classes.global.dir" />
<propertycopy name="app.server.classes.portal.dir" from="app.server.${app.server.type}.classes.portal.dir" />
<propertycopy name="app.server.deploy.dir" from="app.server.${app.server.type}.deploy.dir" />
<propertycopy name="app.server.instance.dir" from="app.server.${app.server.type}.instance.dir" silent="true" />
<propertycopy name="app.server.lib.endorsed.dir" from="app.server.${app.server.type}.lib.endorsed.dir" silent="true" />
<propertycopy name="app.server.lib.global.dir" from="app.server.${app.server.type}.lib.global.dir" />
<propertycopy name="app.server.lib.portal.dir" from="app.server.${app.server.type}.lib.portal.dir" />
<propertycopy name="app.server.lib.support.dir" from="app.server.${app.server.type}.lib.support.dir" silent="true" />
<propertycopy name="app.server.portal.dir" from="app.server.${app.server.type}.portal.dir" />
<propertycopy name="app.server.log.dir" from="app.server.${app.server.type}.log.dir" />
<propertycopy name="app.server.temp.dir" from="app.server.${app.server.type}.temp.dir" />
<propertycopy name="app.server.work.dir" from="app.server.${app.server.type}.work.dir" />
<antelope:stringutil string="${basedir}" property="basedir.unix">
<antelope:replace regex="\\" replacement="/" />
</antelope:stringutil>
<condition property="file.suffix.bat" value=".bat" else=".sh">
<contains string="${os.name}" substring="Windows" casesensitive="false"/>
</condition>
<condition property="file.suffix.exe" value=".exe" else="">
<contains string="${os.name}" substring="Windows" casesensitive="false"/>
</condition>
<property name="definitions.dir" value="${project.dir}/definitions" />
<xmlcatalog id="dtd.catalog">
<dtd publicId="datatypes" location="datatypes.dtd" />
<dtd publicId="-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" location="${definitions.dir}/facelet-taglib_1_0.dtd" />
<dtd publicId="-//Liferay//DTD DISPLAY 2.0.0//EN" location="${definitions.dir}/liferay-display_2_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Display 3.5.0//EN" location="${definitions.dir}/liferay-display_3_5_0.dtd" />
<dtd publicId="-//Liferay//DTD Display 4.0.0//EN" location="${definitions.dir}/liferay-display_4_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Display 5.0.0//EN" location="${definitions.dir}/liferay-display_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Display 5.1.0//EN" location="${definitions.dir}/liferay-display_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Display 5.2.0//EN" location="${definitions.dir}/liferay-display_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Display 6.0.0//EN" location="${definitions.dir}/liferay-display_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Display 6.1.0//EN" location="${definitions.dir}/liferay-display_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Friendly URL Routes 6.0.0//EN" location="${definitions.dir}/liferay-friendly-url-routes_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Friendly URL Routes 6.1.0//EN" location="${definitions.dir}/liferay-friendly-url-routes_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Hook 5.1.0//EN" location="${definitions.dir}/liferay-hook_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Hook 5.2.0//EN" location="${definitions.dir}/liferay-hook_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Hook 6.0.0//EN" location="${definitions.dir}/liferay-hook_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Hook 6.1.0//EN" location="${definitions.dir}/liferay-hook_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 3.6.0//EN" location="${definitions.dir}/liferay-layout-templates_3_6_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 4.0.0//EN" location="${definitions.dir}/liferay-layout-templates_4_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 4.3.0//EN" location="${definitions.dir}/liferay-layout-templates_4_3_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 5.0.0//EN" location="${definitions.dir}/liferay-layout-templates_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 5.1.0//EN" location="${definitions.dir}/liferay-layout-templates_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 5.2.0//EN" location="${definitions.dir}/liferay-layout-templates_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 6.0.0//EN" location="${definitions.dir}/liferay-layout-templates_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Layout Templates 6.1.0//EN" location="${definitions.dir}/liferay-layout-templates_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 3.5.0//EN" location="${definitions.dir}/liferay-look-and-feel_3_5_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 4.0.0//EN" location="${definitions.dir}/liferay-look-and-feel_4_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 4.3.0//EN" location="${definitions.dir}/liferay-look-and-feel_4_3_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 5.0.0//EN" location="${definitions.dir}/liferay-look-and-feel_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 5.1.0//EN" location="${definitions.dir}/liferay-look-and-feel_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 5.2.0//EN" location="${definitions.dir}/liferay-look-and-feel_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 6.0.0//EN" location="${definitions.dir}/liferay-look-and-feel_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Look and Feel 6.1.0//EN" location="${definitions.dir}/liferay-look-and-feel_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Package 4.3.0//EN" location="${definitions.dir}/liferay-plugin-package_4_3_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Package 5.0.0//EN" location="${definitions.dir}/liferay-plugin-package_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Package 5.1.0//EN" location="${definitions.dir}/liferay-plugin-package_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Package 5.2.0//EN" location="${definitions.dir}/liferay-plugin-package_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Package 6.0.0//EN" location="${definitions.dir}/liferay-plugin-package_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Package 6.1.0//EN" location="${definitions.dir}/liferay-plugin-package_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Repository 4.3.0//EN" location="${definitions.dir}/liferay-plugin-repository_4_3_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Repository 5.0.0//EN" location="${definitions.dir}/liferay-plugin-repository_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Repository 5.1.0//EN" location="${definitions.dir}/liferay-plugin-repository_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Repository 5.2.0//EN" location="${definitions.dir}/liferay-plugin-repository_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Repository 6.0.0//EN" location="${definitions.dir}/liferay-plugin-repository_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Plugin Repository 6.1.0//EN" location="${definitions.dir}/liferay-plugin-repository_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD PORTLET 2.0.0//EN" location="${definitions.dir}/liferay-portlet_2_0_0.dtd" />
<dtd publicId="-//Liferay//DTD PORTLET 2.2.0//EN" location="${definitions.dir}/liferay-portlet_2_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 3.5.0//EN" location="${definitions.dir}/liferay-portlet-app_3_5_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.0.0//EN" location="${definitions.dir}/liferay-portlet-app_4_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.1.0//EN" location="${definitions.dir}/liferay-portlet-app_4_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.2.0//EN" location="${definitions.dir}/liferay-portlet-app_4_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.3.0//EN" location="${definitions.dir}/liferay-portlet-app_4_3_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.3.1//EN" location="${definitions.dir}/liferay-portlet-app_4_3_1.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.3.2//EN" location="${definitions.dir}/liferay-portlet-app_4_3_2.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.3.3//EN" location="${definitions.dir}/liferay-portlet-app_4_3_3.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 4.4.0//EN" location="${definitions.dir}/liferay-portlet-app_4_4_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 5.0.0//EN" location="${definitions.dir}/liferay-portlet-app_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 5.1.0//EN" location="${definitions.dir}/liferay-portlet-app_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 5.2.0//EN" location="${definitions.dir}/liferay-portlet-app_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 6.0.0//EN" location="${definitions.dir}/liferay-portlet-app_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Portlet Application 6.1.0//EN" location="${definitions.dir}/liferay-portlet-app_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Resource Action Mapping 6.0.0//EN" location="${definitions.dir}/liferay-resource-action-mapping_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Resource Action Mapping 6.1.0//EN" location="${definitions.dir}/liferay-resource-action-mapping_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 3.5.0//EN" location="${definitions.dir}/liferay-service-builder_3_5_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 3.6.1//EN" location="${definitions.dir}/liferay-service-builder_3_6_1.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 4.0.0//EN" location="${definitions.dir}/liferay-service-builder_4_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 4.2.0//EN" location="${definitions.dir}/liferay-service-builder_4_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 4.3.0//EN" location="${definitions.dir}/liferay-service-builder_4_3_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 4.3.3//EN" location="${definitions.dir}/liferay-service-builder_4_3_3.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 4.4.0//EN" location="${definitions.dir}/liferay-service-builder_4_4_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 5.0.0//EN" location="${definitions.dir}/liferay-service-builder_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 5.1.0//EN" location="${definitions.dir}/liferay-service-builder_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 5.2.0//EN" location="${definitions.dir}/liferay-service-builder_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 6.0.0//EN" location="${definitions.dir}/liferay-service-builder_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Service Builder 6.1.0//EN" location="${definitions.dir}/liferay-service-builder_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD SKIN 2.0.0//EN" location="${definitions.dir}/liferay-skin_2_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Social 6.1.0//EN" location="${definitions.dir}/liferay-social_6_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Theme Loader 4.3.0//EN" location="${definitions.dir}/liferay-theme-loader_4_3_0.dtd" />
<dtd publicId="-//Liferay//DTD Theme Loader 5.0.0//EN" location="${definitions.dir}/liferay-theme-loader_5_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Theme Loader 5.1.0//EN" location="${definitions.dir}/liferay-theme-loader_5_1_0.dtd" />
<dtd publicId="-//Liferay//DTD Theme Loader 5.2.0//EN" location="${definitions.dir}/liferay-theme-loader_5_2_0.dtd" />
<dtd publicId="-//Liferay//DTD Theme Loader 6.0.0//EN" location="${definitions.dir}/liferay-theme-loader_6_0_0.dtd" />
<dtd publicId="-//Liferay//DTD Theme Loader 6.1.0//EN" location="${definitions.dir}/liferay-theme-loader_6_1_0.dtd" />
<dtd publicId="-//MuleSource //DTD mule-configuration XML V1.0//EN" location="${definitions.dir}/mule-configuration.dtd" />
<dtd publicId="-//SPRING//DTD BEAN//EN" location="${definitions.dir}/spring-beans.dtd" />
<dtd publicId="-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" location="${definitions.dir}/struts-config_1_2.dtd" />
<dtd publicId="-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" location="${definitions.dir}/tiles-config_1_1.dtd" />
<dtd publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" location="${definitions.dir}/web-app_2_3.dtd" />
<dtd publicId="-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" location="${definitions.dir}/web-facesconfig_1_0.dtd" />
<dtd publicId="-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" location="${definitions.dir}/web-facesconfig_1_1.dtd" />
<dtd publicId="-//W3C//DTD XMLSCHEMA 200102//EN" location="${definitions.dir}/XMLSchema.dtd" />
</xmlcatalog>
<condition property="correct.ant.version">
<antversion atleast="1.7.0" />
</condition>
<if>
<not>
<equals arg1="${correct.ant.version}" arg2="true" />
</not>
<then>
<fail>Please use Ant 1.7.0 or above.</fail>
</then>
</if>
<whichresource resource="/org/eclipse/jdt/core/JDTCompilerAdapter.class" property="ecj.compiler" />
<if>
<and>
<equals arg1="${javac.compiler}" arg2="org.eclipse.jdt.core.JDTCompilerAdapter" />
<not>
<isset property="ecj.compiler" />
</not>
</and>
<then>
<trycatch>
<try>
<copy file="${project.dir}/lib/development/ecj.jar" todir="${ant.home}/lib" />
</try>
<catch>
<fail>
.
Please manually copy ${project.dir}/lib/development/ecj.jar to ${ant.home}/lib
to install ECJ. Then rerun your task.
</fail>
</catch>
</trycatch>
<if>
<available file="${ant.home}/lib/ecj.jar" />
<then>
<fail>
.
Task cannot continue because ECJ is not installed.
ECJ was automatically installed. Please rerun your task.
</fail>
</then>
</if>
</then>
</if>
<if>
<not>
<isset property="env.ANT_OPTS" />
</not>
<then>
<fail>
.
Please set the environment variable ANT_OPTS to the recommended value of
"-Xmx1024m -XX:MaxPermSize=256m".
</fail>
</then>
</if>
<if>
<and>
<not>
<isset property="jdk.6.home" />
</not>
<equals arg1="${java.specification.version}" arg2="1.6" />
</and>
<then>
<property name="jdk.6.home" value="${env.JAVA_HOME}" />
</then>
</if>
<if>
<not>
<equals arg1="${junit.debug}" arg2="true" />
</not>
<then>
<var name="junit.debug.jpda" value="" />
</then>
</if>
<target name="compile">
</target>
<target name="compile-test">
<mkdir dir="test-classes" />
<mkdir dir="test-results" />
<copy todir="test-classes">
<fileset dir="test" includes="**/*.properties,**/dependencies/**" />
</copy>
<javac
classpathref="project.classpath"
compiler="${javac.compiler}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
destdir="test-classes"
encoding="${javac.encoding}"
includeAntRuntime="false"
nowarn="${javac.nowarn}"
srcdir="test"
/>
</target>
<target name="format-javadoc">
<echo message="Run "ant compile-test" in portal-impl before using format-javadoc to generate @Override tags." />
<java
classname="com.liferay.portal.tools.JavadocFormatter"
classpathref="project.classpath"
fork="true"
newenvironment="true"
>
<arg line="--limit ${limit} --init ${init}" />
</java>
</target>
<target name="instrument">
<delete dir="test-coverage" />
<if>
<equals arg1="${junit.code.coverage}" arg2="true" />
<then>
<cobertura-instrument datafile="test-coverage/cobertura.ser" todir="test-coverage">
<fileset dir="${project.dir}/portal-impl/classes">
<include name="**/*.class" />
</fileset>
<fileset dir="${project.dir}/portal-service/classes">
<include name="**/*.class" />
</fileset>
<fileset dir="${project.dir}/util-java/classes">
<include name="**/*.class" />
</fileset>
<fileset dir="${project.dir}/util-taglib/classes">
<include name="**/*.class" />
</fileset>
</cobertura-instrument>
</then>
</if>
</target>
<target name="print-current-time">
<tstamp>
<format property="current.time" pattern="MMMM d, yyyy 'at' hh:mm aa" />
</tstamp>
<echo message="${current.time}" />
</target>
<target name="setproxy" if="setproxy.proxy.host">
<setproxy proxyhost="${setproxy.proxy.host}" proxyport="${setproxy.proxy.port}" />
</target>
<target name="test">
<delete dir="test-classes" />
<delete dir="test-results" />
<antcall target="compile" />
<antcall target="instrument" />
<antcall target="compile-test" />
<fileset dir="test-classes" id="test.suite.classes">
<include name="**/*TestSuite.class" />
</fileset>
<pathconvert
property="test.suite.classes.available"
refid="test.suite.classes"
setonempty="false"
/>
<if>
<not>
<isset property="test.suite.classes.available" />
</not>
<then>
<junit dir="${project.dir}" fork="on" forkmode="once" printsummary="on">
<sysproperty key="net.sourceforge.cobertura.datafile" file="test-coverage/cobertura.ser" />
<jvmarg line="${junit.debug.jpda}" />
<jvmarg value="-Xmx512m" />
<jvmarg value="-Duser.timezone=GMT" />
<jvmarg value="-Dexternal-properties=${test.properties}" />
<classpath location="test-coverage" />
<classpath refid="test.classpath" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="test-results">
<fileset dir="test-classes" includes="**/*Test.class" />
</batchtest>
</junit>
</then>
<else>
<junit dir="${project.dir}" fork="on" forkmode="once" printsummary="on">
<sysproperty key="net.sourceforge.cobertura.datafile" file="test-coverage/cobertura.ser" />
<jvmarg line="${junit.debug.jpda}" />
<jvmarg value="-Xmx512m" />
<jvmarg value="-Duser.timezone=GMT" />
<jvmarg value="-Dexternal-properties=${test.properties}" />
<classpath location="test-coverage" />
<classpath refid="test.classpath" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="test-results">
<fileset dir="test-classes" includes="**/*TestSuite.class" />
</batchtest>
</junit>
</else>
</if>
<if>
<equals arg1="${junit.code.coverage}" arg2="true" />
<then>
<cobertura-report format="html" datafile="test-coverage/cobertura.ser" destdir="test-coverage" >
<fileset dir="${project.dir}/portal-impl/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${project.dir}/portal-service/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${project.dir}/util-java/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${project.dir}/util-taglib/src">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</then>
</if>
</target>
<target name="test-class" depends="compile,instrument,compile-test" if="class">
<junit dir="${project.dir}" fork="on" forkmode="once" outputtoformatters="false" printsummary="on" showoutput="true">
<sysproperty key="net.sourceforge.cobertura.datafile" file="test-coverage/cobertura.ser" />
<jvmarg line="${junit.debug.jpda}" />
<jvmarg value="-Xmx1024m" />
<jvmarg value="-XX:MaxPermSize=256m" />
<jvmarg value="-Duser.timezone=GMT" />
<jvmarg value="-Dexternal-properties=${test.properties}" />
<classpath location="test-coverage" />
<classpath refid="test.classpath" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="test-results">
<fileset dir="test-classes" includes="**/${class}.class" />
</batchtest>
</junit>
<if>
<equals arg1="${junit.code.coverage}" arg2="true" />
<then>
<cobertura-report format="html" datafile="test-coverage/cobertura.ser" destdir="test-coverage" >
<fileset dir="${project.dir}/portal-impl/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${project.dir}/portal-service/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${project.dir}/util-java/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${project.dir}/util-taglib/src">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</then>
</if>
</target>
</project>