blob: 6ed672700cc8423f1f8a706521e29e94f19fc8be [file] [log] [blame]
Fredrik Roubert7935b182014-11-18 20:21:54 -08001<!--
2*******************************************************************************
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +00003* Copyright (C) 1997-2015, International Business Machines Corporation and *
Fredrik Roubert7935b182014-11-18 20:21:54 -08004* others. All Rights Reserved. *
5*******************************************************************************
6-->
7<project name="icu4j" default="jar" basedir="."
8 xmlns:jacoco="antlib:org.jacoco.ant">
9
10 <property file="build-local.properties"/>
11 <property file="build.properties"/>
12
13 <property name="shared.dir" value="main/shared"/>
14 <import file="${shared.dir}/build/common-targets.xml"/>
15
16 <property environment="env"/>
17
18 <!-- icu4j binaries -->
19 <property name="icu4j.jar.file" value="icu4j.jar"/>
20 <property name="icu4jtests.jar.file" value="icu4jtests.jar"/>
21 <property name="icu4j-charset.jar.file" value="icu4j-charset.jar"/>
22 <property name="icu4j-localespi.jar.file" value="icu4j-localespi.jar"/>
23
24 <property name="icu4jdemos.jar.file" value="icu4jdemos.jar"/>
25
26 <!-- icu4j API doc jar file -->
27 <property name="icu4jdocs.jar.file" value="icu4j-docs.jar"/>
28
29 <!-- icu4j src jar files -->
30 <property name="icu4j-src.jar.file" value="icu4j-src.jar"/>
31 <property name="icu4j-charset-src.jar.file" value="icu4j-charset-src.jar"/>
32 <property name="icu4j-localespi-src.jar.file" value="icu4j-localespi-src.jar"/>
33
34 <!-- icu4j source package archive files -->
35 <property name="icu4jsrc.zip.file" value="icu4j.zip"/>
36 <property name="icu4jsrc.tgz.file" value="icu4j.tgz"/>
37
38 <!-- icu4j versioned release files -->
39 <property name="icu4j.jar.versioned.file" value="icu4j-${release.file.ver}.jar"/>
40 <property name="icu4j-charset.jar.versioned.file" value="icu4j-charset-${release.file.ver}.jar"/>
41 <property name="icu4j-localespi.jar.versioned.file" value="icu4j-localespi-${release.file.ver}.jar"/>
42
43 <property name="icu4j-src.jar.versioned.file" value="icu4j-${release.file.ver}-src.jar"/>
44 <property name="icu4j-charset-src.jar.versioned.file" value="icu4j-charset-${release.file.ver}-src.jar"/>
45 <property name="icu4j-localespi-src.jar.versioned.file" value="icu4j-localespi-${release.file.ver}-src.jar"/>
46
47 <property name="icu4jdocs.jar.versioned.file" value="icu4j-${release.file.ver}-docs.jar"/>
48
49 <!-- <property name="icu4jsrc.zip.versioned.file" value="icu4j-${release.file.ver}.zip"/> -->
50 <property name="icu4jsrc.tgz.versioned.file" value="icu4j-${release.file.ver}.tgz"/>
51
52 <!-- API doc -->
53 <property name="icu4j.api.doc.title" value="ICU4J ${api.doc.version} API Specification"/>
54 <property name="icu4j.api.doc.window.title" value="ICU4J ${api.doc.version}"/>
55 <property name="icu4j.api.doc.header" value="ICU4J ${api.doc.version}"/>
56 <property name="icu4j.api.doc.jdk.link" value="http://docs.oracle.com/javase/7/docs/api/"/>
57
58 <!-- directories -->
59 <property name="release.dir" value="release"/>
60 <property name="doc.dir" value="doc"/>
61 <property name="cldr.util.out.dir" value="${out.dir}/cldr_util"/>
62 <property name="cldr.release.dir" value="release_cldr"/>
63
64 <!-- Java version check -->
65 <condition property="is.java6.plus">
66 <or>
67 <contains string="${java.version}" substring="1.6."/>
68 <contains string="${java.version}" substring="1.7."/>
69 <contains string="${java.version}" substring="1.8."/>
70 </or>
71 </condition>
72 <condition property="is.java5">
73 <contains string="${java.version}" substring="1.5."/>
74 </condition>
75 <fail message="The JDK version is too old or unknown.">
76 <condition>
77 <not>
78 <or>
79 <isset property="is.java6.plus"/>
80 <isset property="is.java5"/>
81 </or>
82 </not>
83 </condition>
84 </fail>
85
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +020086 <condition property="is.java7">
87 <contains string="${java.version}" substring="1.7."/>
88 </condition>
89
Fredrik Roubert7935b182014-11-18 20:21:54 -080090 <condition property="is.java7.plus">
91 <or>
92 <contains string="${java.version}" substring="1.7."/>
93 <contains string="${java.version}" substring="1.8."/>
94 </or>
95 </condition>
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +020096 <condition property="is.pre.java8">
97 <or>
98 <contains string="${java.version}" substring="1.5."/>
99 <contains string="${java.version}" substring="1.6."/>
100 <contains string="${java.version}" substring="1.7."/>
101 </or>
102 </condition>
103
Fredrik Roubert7935b182014-11-18 20:21:54 -0800104
105 <!-- Build environment info -->
106 <property name="env.COMPUTERNAME" value="${env.HOSTNAME}"/>
107 <target name="info" description="Display the build environment information">
108 <echo message="----- Build Environment Information -------------------"/>
109 <echo message="Java Home: ${java.home}"/>
110 <echo message="Java Version: ${java.version}"/>
111 <echo message="Ant Home: ${ant.home}"/>
112 <echo message="Ant Version: ${ant.version}"/>
113 <echo message="OS: ${os.name}"/>
114 <echo message="OS Version: ${os.version}"/>
115 <echo message="OS Arch: ${os.arch}"/>
116 <echo message="Host: ${env.COMPUTERNAME}"/>
117 <echo message="-------------------------------------------------------"/>
118 </target>
119
120 <target name="clean" description="Clean up build outputs">
121 <ant dir="${icu4j.core.dir}" target="clean" inheritAll="false"/>
122 <ant dir="${icu4j.collate.dir}" target="clean" inheritAll="false"/>
123 <ant dir="${icu4j.charset.dir}" target="clean" inheritAll="false"/>
124 <ant dir="${icu4j.currdata.dir}" target="clean" inheritAll="false"/>
125 <ant dir="${icu4j.langdata.dir}" target="clean" inheritAll="false"/>
126 <ant dir="${icu4j.localespi.dir}" target="clean" inheritAll="false"/>
127 <ant dir="${icu4j.regiondata.dir}" target="clean" inheritAll="false"/>
128 <ant dir="${icu4j.translit.dir}" target="clean" inheritAll="false"/>
129 <ant dir="${icu4j.test-framework.dir}" target="clean" inheritAll="false"/>
130 <ant dir="${icu4j.core-tests.dir}" target="clean" inheritAll="false"/>
131 <ant dir="${icu4j.collate-tests.dir}" target="clean" inheritAll="false"/>
132 <ant dir="${icu4j.charset-tests.dir}" target="clean" inheritAll="false"/>
133 <ant dir="${icu4j.localespi-tests.dir}" target="clean" inheritAll="false"/>
134 <ant dir="${icu4j.packaging-tests.dir}" target="clean" inheritAll="false"/>
135 <ant dir="${icu4j.translit-tests.dir}" target="clean" inheritAll="false"/>
136 <ant dir="${icu4j.testall.dir}" target="clean" inheritAll="false"/>
137 <ant dir="${icu4j.build-tools.dir}" target="clean" inheritAll="false"/>
138 <ant dir="${icu4j.tools.dir}" target="clean" inheritAll="false"/>
139 <ant dir="${icu4j.demos.dir}" target="clean" inheritAll="false"/>
140 <ant dir="${icu4j.samples.dir}" target="clean" inheritAll="false"/>
141 <ant dir="${icu4j.perf-tests.dir}" target="clean" inheritAll="false"/>
142
143 <!-- delete all .jar files root directory -->
144 <delete>
145 <fileset dir="." includes="icu4j*.jar"/>
146 </delete>
147
148 <delete dir="${release.dir}"/>
149 <delete dir="${doc.dir}"/>
150 <delete dir="${out.dir}"/>
151 <delete dir="${module.dir}"/>
152 <delete dir="${cldr.release.dir}"/>
153
154 <available file="eclipse-build" type="dir" property="eclipse-build.dir.present"/>
155 <antcall target="_clean.eclipse-build"/>
156 </target>
157
158 <target name="_clean.eclipse-build" if="eclipse-build.dir.present">
159 <ant dir="eclipse-build" target="clean" inheritAll="false"/>
160 </target>
161
162 <!-- meta build targets -->
163 <target name="all" depends="info, main, tests, build-tools, tools, demos, samples, perf-tests, jar, docs" description="Build all primary targets"/>
164 <target name="main" depends="info, core, collate, charset, currdata, langdata, regiondata, translit, localespi" description="Build ICU4J runtime library classes"/>
165 <target name="tests" depends="info, core-tests, charset-tests, collate-tests, packaging-tests, translit-tests, testall, localespi-tests" description="Build ICU4J test classes"/>
166
167 <target name="secure" depends="icu4jJar" description="(Deprecated)Build ICU4J API and test classes for running the ICU4J test suite with Java security manager enabled"/>
168
169 <!-- Check to see if JVM_OPTIONS enviroment variable is set. This can be use to set the heap size. -->
170 <property name="env.JVM_OPTIONS" value=""/>
171 <property name="jvm_options" value="${env.JVM_OPTIONS}"/>
172 <target name="check" description="Run the standard ICU4J test suite">
173 <antcall target="_runCheck">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000174 <param name="runcheck.arg" value=""/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800175 <param name="runcheck.jvmarg" value="${jvm_options} -ea"/>
176 </antcall>
177 </target>
178
179 <target name="exhaustiveCheck" description="Run the standard ICU4J test suite in exhaustive mode">
180 <antcall target="_runCheck">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000181 <param name="runcheck.arg" value="-e10"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800182 <param name="runcheck.jvmarg" value="${jvm_options} -ea"/>
183 </antcall>
184 </target>
185
186 <target name="timeZoneCheck" description="Run the complete test for TimeZoneRoundTripAll">
187 <antcall target="_runCheck">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000188 <param name="runcheck.arg" value="-prop:TimeZoneRoundTripAll=true Core/Format/DateFormat/TimeZoneFormatTest -v"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800189 <param name="runcheck.jvmarg" value="${jvm_options}"/>
190 </antcall>
191 </target>
192
193 <target name="jdktzCheck" description="Run the standard ICU4J test suite with JDK TimeZone">
194 <antcall target="_runCheck">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000195 <param name="runcheck.arg" value=""/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800196 <param name="runcheck.jvmarg" value="${jvm_options} -Dcom.ibm.icu.util.TimeZone.DefaultTimeZoneType=JDK"/>
197 </antcall>
198 </target>
199
200 <target name="_runCheck" depends="main, tests">
201 <echo message="JVM argument: ${runcheck.jvmarg} -Djava.awt.headless=true"/>
202 <echo message="Test argument: ${runcheck.arg}"/>
203
204 <java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
205 <arg line="${runcheck.arg}"/>
206 <jvmarg line="${runcheck.jvmarg} -Djava.awt.headless=true"/>
207 <classpath>
208 <pathelement location="${icu4j.core.jar}"/>
209 <pathelement location="${icu4j.collate.jar}"/>
210 <pathelement location="${icu4j.charset.jar}"/>
211 <pathelement location="${icu4j.currdata.jar}"/>
212 <pathelement location="${icu4j.langdata.jar}"/>
213 <pathelement location="${icu4j.regiondata.jar}"/>
214 <pathelement location="${icu4j.translit.jar}"/>
215 <pathelement location="${icu4j.test-framework.jar}"/>
216 <pathelement location="${icu4j.core-tests.jar}"/>
217 <pathelement location="${icu4j.collate-tests.jar}"/>
218 <pathelement location="${icu4j.charset-tests.jar}"/>
219 <pathelement location="${icu4j.translit-tests.jar}"/>
220 <pathelement location="${icu4j.testall.jar}"/>
221 </classpath>
222 </java>
223 </target>
224
225 <target name="_runTestArgCheck" unless="testarg">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000226 <echo message="No test arguments are supplied."/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800227 <echo message="For specifying test arguments, use '-Dtestarg=[test args]' as"/>
228 <echo message="ant command line argument. For example:"/>
229 <echo message=" &#x3E;ant runTest -Dtestarg=&#x22;Core/Format -e10&#x22;"/>
230 <echo message="for running ICU4J core format test suite in exhaustive mode."/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800231 </target>
232
233 <target name="runTest" depends="_runTestArgCheck" description="Run a ICU4J test case, without calling any other build targets">
234 <echo message="JVM argument: ${jvm_options} -Djava.awt.headless=true"/>
235 <echo message="Test argument: ${testarg}"/>
236
237 <java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
238 <arg line="${testarg}"/>
239 <jvmarg line="${jvm_options} -Djava.awt.headless=true"/>
240 <classpath>
241 <pathelement location="${icu4j.core.jar}"/>
242 <pathelement location="${icu4j.collate.jar}"/>
243 <pathelement location="${icu4j.charset.jar}"/>
244 <pathelement location="${icu4j.currdata.jar}"/>
245 <pathelement location="${icu4j.langdata.jar}"/>
246 <pathelement location="${icu4j.regiondata.jar}"/>
247 <pathelement location="${icu4j.translit.jar}"/>
248 <pathelement location="${icu4j.test-framework.jar}"/>
249 <pathelement location="${icu4j.core-tests.jar}"/>
250 <pathelement location="${icu4j.collate-tests.jar}"/>
251 <pathelement location="${icu4j.charset-tests.jar}"/>
252 <pathelement location="${icu4j.translit-tests.jar}"/>
253 <pathelement location="${icu4j.testall.jar}"/>
254 </classpath>
255 </java>
256 </target>
257
258 <target name="packagingCheck" depends="info, core, packaging-tests" description="Run packaging tests">
259 <!-- region data but no language data -->
260 <java classname="com.ibm.icu.dev.test.TestPackaging" fork="yes" failonerror="true">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000261 <arg line="-w"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800262 <classpath>
263 <pathelement location="${icu4j.core.jar}"/>
264 <pathelement location="${icu4j.charset.jar}"/>
265 <pathelement location="${icu4j.test-framework.jar}"/>
266 <pathelement location="${icu4j.packaging-tests.jar}"/>
267 <pathelement location="${icu4j.regiondata.jar}"/>
268 </classpath>
269 </java>
270 <!-- language data but no region data -->
271 <java classname="com.ibm.icu.dev.test.TestPackaging" fork="yes" failonerror="true">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000272 <arg line="-w"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800273 <classpath>
274 <pathelement location="${icu4j.core.jar}"/>
275 <pathelement location="${icu4j.charset.jar}"/>
276 <pathelement location="${icu4j.test-framework.jar}"/>
277 <pathelement location="${icu4j.packaging-tests.jar}"/>
278 <pathelement location="${icu4j.langdata.jar}"/>
279 </classpath>
280 </java>
281 <!-- neither region nor language data -->
282 <java classname="com.ibm.icu.dev.test.TestPackaging" fork="yes" failonerror="true">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000283 <arg line="-w"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800284 <classpath>
285 <pathelement location="${icu4j.core.jar}"/>
286 <pathelement location="${icu4j.charset.jar}"/>
287 <pathelement location="${icu4j.test-framework.jar}"/>
288 <pathelement location="${icu4j.packaging-tests.jar}"/>
289 </classpath>
290 </java>
291 </target>
292
293 <target name="coreCheck" depends="info, core, currdata, langdata, regiondata, core-tests" description="Run only the core tests">
294 <java classname="com.ibm.icu.dev.test.TestAllCore" fork="yes" failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -0800295 <classpath>
296 <pathelement location="${icu4j.core.jar}"/>
297 <pathelement location="${icu4j.currdata.jar}"/>
298 <pathelement location="${icu4j.langdata.jar}"/>
299 <pathelement location="${icu4j.regiondata.jar}"/>
300 <pathelement location="${icu4j.test-framework.jar}"/>
301 <pathelement location="${icu4j.core-tests.jar}"/>
302 </classpath>
303 </java>
304 </target>
305
306 <target name="collateCheck" depends="info, core, collate, currdata, langdata, regiondata, core-tests, collate-tests" description="Run only the collation tests">
307 <java classname="com.ibm.icu.dev.test.TestAllCollate" fork="yes" failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -0800308 <classpath>
309 <pathelement location="${icu4j.core.jar}"/>
310 <pathelement location="${icu4j.collate.jar}"/>
311 <pathelement location="${icu4j.test-framework.jar}"/>
312 <pathelement location="${icu4j.collate-tests.jar}"/>
313
314 <!-- for now, collateCheck needs currdata, langdata and regiondata, because of GlobalizationPreferencesTest" -->
315 <pathelement location="${icu4j.currdata.jar}"/>
316 <pathelement location="${icu4j.langdata.jar}"/>
317 <pathelement location="${icu4j.regiondata.jar}"/>
318 <pathelement location="${icu4j.core-tests.jar}"/>
319 </classpath>
320 </java>
321 </target>
322
323 <target name="translitCheck" depends="info, core, translit, translit-tests" description="Run the ICU4J Translit test suite">
324 <java classname="com.ibm.icu.dev.test.TestAllTranslit" fork="yes" failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -0800325 <classpath>
326 <pathelement location="${icu4j.core.jar}"/>
327 <pathelement location="${icu4j.translit.jar}"/>
328 <pathelement location="${icu4j.test-framework.jar}"/>
329 <pathelement location="${icu4j.translit-tests.jar}"/>
330 </classpath>
331 </java>
332 </target>
333
334 <target name="localespiCheck" if="is.java6.plus" depends="info" description="Run the ICU4J Locale SPI test suite">
335 <antcall target="_runLocalespiCheck"/>
336 </target>
337
338 <target name="_runLocalespiCheck" depends="localespi, localespi-tests">
339 <java classname="com.ibm.icu.dev.test.localespi.TestAll" fork="yes" failonerror="true">
340 <jvmarg line="-Djava.ext.dirs=${icu4j.core.dir}/${jar.dir}${path.separator}${icu4j.localespi.dir}/${jar.dir}${path.separator}${icu4j.collate.dir}/${jar.dir}${path.separator}${icu4j.currdata.dir}/${jar.dir}${path.separator}${icu4j.langdata.dir}/${jar.dir}${path.separator}${icu4j.regiondata.dir}/${jar.dir}${path.separator}${java.ext.dirs}"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800341 <classpath>
342 <pathelement location="${icu4j.localespi-tests.jar}"/>
343 <pathelement location="${icu4j.test-framework.jar}"/>
344 </classpath>
345 </java>
346 </target>
347
348 <target name="secureCheck" depends="main, jar, icu4jtestsJar" description="Run the secure (applet-like) ICU4J test suite">
Yoshito Umaokaa53a69a2015-02-23 13:23:44 +0000349 <property name="securecheck.arg" value="-w"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800350 <property name="securecheck.jvmarg"
351 value="${jvm_options} -Djava.security.manager -Djava.security.policy=${shared.dir}/data/security.policy -Djava.awt.headless=true"/>
352
353 <echo message="JVM argument: ${securecheck.jvmarg}"/>
354 <echo message="Test argument: ${securecheck.arg}"/>
355
356 <java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
357 <arg line="${securecheck.arg}"/>
358 <jvmarg line="${securecheck.jvmarg}"/>
359 <classpath>
360 <pathelement location="${icu4j.jar.file}"/>
361 <pathelement location="${icu4j-charset.jar.file}"/>
362 <pathelement location="${icu4jtests.jar.file}"/>
363 </classpath>
364 </java>
365 </target>
366
367 <!-- jar targets -->
368 <target name="jar" depends="icu4jJar, charset, localespi" description="Build ICU4J runtime library jar files">
369 <copy file="${icu4j.charset.jar}" tofile="${icu4j-charset.jar.file}"/>
370 <copy file="${icu4j.localespi.jar}" tofile="${icu4j-localespi.jar.file}" failonerror="false"/>
371 </target>
372
373 <target name="icu4jJar" depends="info, core, collate, currdata, langdata, regiondata, translit" description="Build ICU4J all-in-one core jar">
374 <mkdir dir="${out.dir}"/>
375
376 <!-- manifest -->
377 <copy file="manifest.stub" todir="${out.dir}">
378 <filterset>
379 <filter token="SPECVERSION" value="${jar.spec.version}"/>
380 <filter token="IMPLVERSION" value="${jar.impl.version}"/>
381 <filter token="COPYRIGHT" value="${jar.copyright.info}"/>
382 <filter token="EXECENV" value="${jar.exec.env}"/>
383 </filterset>
384 </copy>
385
386 <!-- jar -->
387 <jar jarfile="${icu4j.jar.file}"
388 compress="true"
389 manifest="${out.dir}/manifest.stub">
390 <fileset dir="${icu4j.core.dir}/${bin.dir}" includes="**/*"/>
391 <fileset dir="${icu4j.collate.dir}/${bin.dir}" includes="**/*"/>
392 <fileset dir="${icu4j.currdata.dir}/${bin.dir}" includes="**/*"/>
393 <fileset dir="${icu4j.langdata.dir}/${bin.dir}" includes="**/*"/>
394 <fileset dir="${icu4j.regiondata.dir}/${bin.dir}" includes="**/*"/>
395 <fileset dir="${icu4j.translit.dir}/${bin.dir}" includes="**/*"/>
396 <fileset dir="${shared.dir}/licenses">
397 <include name="license.html"/>
398 </fileset>
399 </jar>
400 </target>
401
402 <target name="icu4jSrcJar" description="Build icu4j-src.jar">
403 <jar jarfile="${icu4j-src.jar.file}"
404 compress="true">
405 <fileset dir="${icu4j.core.dir}/${src.dir}" includes="**/*.java"/>
406 <fileset dir="${icu4j.collate.dir}/${src.dir}" includes="**/*.java"/>
407 <fileset dir="${icu4j.currdata.dir}/${src.dir}" includes="**/*.java"/>
408 <fileset dir="${icu4j.langdata.dir}/${src.dir}" includes="**/*.java"/>
409 <fileset dir="${icu4j.regiondata.dir}/${src.dir}" includes="**/*.java"/>
410 <fileset dir="${icu4j.translit.dir}/${src.dir}" includes="**/*.java"/>
411 <fileset dir="${shared.dir}/licenses">
412 <include name="license.html"/>
413 </fileset>
414 </jar>
415 </target>
416
417 <target name="icu4jtestsJar" depends="info, tests" description="Build ICU4J all-in-one test jar">
418 <jar jarfile="${icu4jtests.jar.file}"
419 compress="true">
420 <fileset dir="${icu4j.test-framework.dir}/${bin.dir}" includes="**/*"/>
421 <fileset dir="${icu4j.core-tests.dir}/${bin.dir}" includes="**/*"/>
422 <fileset dir="${icu4j.collate-tests.dir}/${bin.dir}" includes="**/*"/>
423 <fileset dir="${icu4j.translit-tests.dir}/${bin.dir}" includes="**/*"/>
424 <fileset dir="${icu4j.charset-tests.dir}/${bin.dir}" includes="**/*"/>
425 <fileset dir="${icu4j.testall.dir}/${bin.dir}" includes="**/*"/>
426 </jar>
427 </target>
428
429 <target name="jarDemos" depends="icu4jJar, demos" description="Build ICU4J demo jar file">
430 <copy file="${icu4j.demos.jar}" tofile="${icu4jdemos.jar.file}"/>
431 </target>
432
433
434 <!-- release targets -->
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100435 <target name="_check_config_for_release">
436 <condition property="release.build.config.ok">
437 <and>
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +0200438 <isset property="is.java7"/>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100439 <isset property="java5.bootclasspath"/>
440 <isset property="java6.bootclasspath"/>
441 <isset property="jcite.libs"/>
442 </and>
443 </condition>
444 </target>
445
446 <target name="_verify_config_for_release" depends="_check_config_for_release" unless="release.build.config.ok">
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +0200447 <condition property="disp.is.java7" value="${java.version}" else="${java.version} - Must be 1.7!">
448 <isset property="is.java7"/>
449 </condition>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100450 <condition property="disp.java5.bootclasspath" value="${java5.bootclasspath}" else="Not Defined!">
451 <isset property="java5.bootclasspath"/>
452 </condition>
453 <condition property="disp.java6.bootclasspath" value="${java5.bootclasspath}" else="Not Defined!">
454 <isset property="java6.bootclasspath"/>
455 </condition>
456 <condition property="disp.jcite.libs" value="${jcite.libs}" else="Not Defined!">
457 <isset property="jcite.libs"/>
458 </condition>
459
460 <echo message="################################################################"/>
461 <echo message="[WARNING] Insufficient Build Configuration for ICU4J Release"/>
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +0200462 <echo message="JDK Tools Version: ${disp.is.java7}"/>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100463 <echo message="JRE 5 System Library Path: ${disp.java5.bootclasspath}"/>
464 <echo message="JRE 6 System Library Path: ${disp.java6.bootclasspath}"/>
465 <echo message="JCite Library Path: ${disp.jcite.libs}"/>
466 <echo message="################################################################"/>
467 </target>
468
Fredrik Roubert7935b182014-11-18 20:21:54 -0800469 <target name="releaseVer" depends="info, releaseBinaries, releaseSrcJars, releaseDocs, releaseSourceArchiveTgz"
470 description="Build all ICU4J release files for distribution with versioned file names">
471 <!-- binaries -->
472 <move file="${release.dir}/${icu4j.jar.file}" tofile="${release.dir}/${icu4j.jar.versioned.file}"/>
473 <move file="${release.dir}/${icu4j-charset.jar.file}" tofile="${release.dir}/${icu4j-charset.jar.versioned.file}"/>
474 <move file="${release.dir}/${icu4j-localespi.jar.file}" tofile="${release.dir}/${icu4j-localespi.jar.versioned.file}"/>
475
476 <!-- source jars -->
477 <move file="${release.dir}/${icu4j-src.jar.file}" tofile="${release.dir}/${icu4j-src.jar.versioned.file}"/>
478 <move file="${release.dir}/${icu4j-charset-src.jar.file}" tofile="${release.dir}/${icu4j-charset-src.jar.versioned.file}"/>
479 <move file="${release.dir}/${icu4j-localespi-src.jar.file}" tofile="${release.dir}/${icu4j-localespi-src.jar.versioned.file}"/>
480
481 <!-- docs -->
482 <move file="${release.dir}/${icu4jdocs.jar.file}" tofile="${release.dir}/${icu4jdocs.jar.versioned.file}"/>
483
484 <!-- package archive -->
485 <move file="${release.dir}/${icu4jsrc.tgz.file}" tofile="${release.dir}/${icu4jsrc.tgz.versioned.file}"/>
486
487 <!-- md5 checksum file -->
488 <mkdir dir="${out.dir}/checksum"/>
489 <delete dir="${out.dir}/checksum" includes="**/*"/>
490
491 <checksum todir="${out.dir}/checksum" format="MD5SUM">
492 <fileset dir="${release.dir}">
493 <include name="*.jar"/>
494 <include name="*.tgz"/>
495 </fileset>
496 </checksum>
497
498 <concat destfile="${release.dir}/icu4j-${release.file.ver}.md5">
499 <fileset dir="${out.dir}/checksum" includes="*"/>
500 <filterchain>
501 <fixcrlf eol="lf"/>
502 </filterchain>
503 </concat>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100504
505 <antcall target="_verify_config_for_release"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800506 </target>
507
508 <target name="release" depends="info, releaseBinaries, releaseSrcJars, releaseDocs, releaseSourceArchiveTgz" description="Build all ICU4J release files for distribution">
509 <mkdir dir="${out.dir}/checksum"/>
510 <delete dir="${out.dir}/checksum" includes="**/*"/>
511
512 <checksum todir="${out.dir}/checksum" format="MD5SUM">
513 <fileset dir="${release.dir}">
514 <include name="*.jar"/>
515 <include name="*.tgz"/>
516 </fileset>
517 </checksum>
518
519 <concat destfile="${release.dir}/icu4j.md5">
520 <fileset dir="${out.dir}/checksum" includes="*"/>
521 <filterchain>
522 <fixcrlf eol="lf"/>
523 </filterchain>
524 </concat>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100525
526 <antcall target="_verify_config_for_release"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800527 </target>
528
529 <target name="releaseBinaries" depends="icu4jJar, charset, localespi" description="Build ICU4J binary files for distribution">
530 <mkdir dir="${release.dir}"/>
531 <copy file="${icu4j.jar.file}" tofile="${release.dir}/${icu4j.jar.file}"/>
532 <copy file="${icu4j.charset.jar}" tofile="${release.dir}/${icu4j-charset.jar.file}"/>
533 <copy file="${icu4j.localespi.jar}" tofile="${release.dir}/${icu4j-localespi.jar.file}"/>
534 </target>
535
536 <target name="releaseSrcJars" depends="icu4jSrcJar" description="Build ICU4J src jar files for distribution">
537 <mkdir dir="${release.dir}"/>
538
539 <!-- icu4j src-jar -->
540 <copy file="${icu4j-src.jar.file}" tofile="${release.dir}/${icu4j-src.jar.file}"/>
541
542 <!-- charset/localespi src-jar -->
543 <ant dir="${icu4j.charset.dir}" target="src-jar" inheritAll="false"/>
544 <ant dir="${icu4j.localespi.dir}" target="src-jar" inheritAll="false"/>
545
546 <copy file="${icu4j.charset.dir}/${out.dir}/lib/${icu4j-charset-src.jar.file}" tofile="${release.dir}/${icu4j-charset-src.jar.file}"/>
547 <copy file="${icu4j.localespi.dir}/${out.dir}/lib/${icu4j-localespi-src.jar.file}" tofile="${release.dir}/${icu4j-localespi-src.jar.file}"/>
548 </target>
549
550
551 <target name="releaseDocs" depends="docs" description="Build ICU4J API reference doc jar file for distribution">
552 <mkdir dir="${release.dir}"/>
553 <jar jarfile="${release.dir}/${icu4jdocs.jar.file}" compress="true" basedir="${doc.dir}"/>
554 </target>
555
556 <property name="src.release.wrk.dir" value="${out.dir}/tmpsrc"/>
557
558 <target name="releaseSourceArchiveZip" description="Build ICU4J source release archive (.zip)">
559 <delete dir="${src.release.wrk.dir}"/>
560 <delete file="${icu4jsrc.zip.file}"/>
561
562 <mkdir dir="${src.release.wrk.dir}"/>
563
564 <fixcrlf srcdir="."
565 destdir="${src.release.wrk.dir}"
566 encoding="UTF-8"
567 eol="crlf">
568 <include name="demos/**/*"/>
569 <include name="main/**/*"/>
570 <include name="perf-tests/**/*"/>
571 <include name="samples/**/*"/>
572 <include name="tools/**/*"/>
573 <include name="*.html"/>
574 <include name="*.xml"/>
575 <include name="*.properties"/>
576 <include name="*.css"/>
577 <include name="*.stub"/>
578 <exclude name="**/out/**/*"/>
579 <exclude name="**/*.jar"/>
580 <exclude name="**/build-local.properties"/>
581 <exclude name="main/tests/core/src/com/ibm/icu/dev/data/rbbi/english.dict"/>
582 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
583 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
584 <exclude name="tools/build/icu4j*.api*.gz"/>
585 </fixcrlf>
586
587 <mkdir dir="${release.dir}"/>
588 <zip destfile="${release.dir}/${icu4jsrc.zip.file}">
589 <fileset dir="${src.release.wrk.dir}" includes="**/*"/>
590 <fileset dir="${basedir}">
591 <include name="main/shared/data/*.jar"/>
592 <include name="main/tests/core/src/com/ibm/icu/dev/data/rbbi/english.dict"/>
593 <include name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
594 <include name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
595 <include name="tools/build/icu4j*.api*.gz"/>
596 </fileset>
597 </zip>
598
599 <delete dir="${src.release.wrk.dir}"/>
600 </target>
601
602 <target name="releaseSourceArchiveTgz" description="Build ICU4J source release archive (.tgz)">
603 <delete dir="${src.release.wrk.dir}"/>
604 <delete file="${icu4jsrc.tgz.file}"/>
605
606 <mkdir dir="${src.release.wrk.dir}"/>
607
608 <fixcrlf srcdir="."
609 destdir="${src.release.wrk.dir}"
610 encoding="UTF-8"
611 eol="lf">
612 <include name="demos/**/*"/>
613 <include name="main/**/*"/>
614 <include name="perf-tests/**/*"/>
615 <include name="samples/**/*"/>
616 <include name="tools/**/*"/>
617 <include name="*.html"/>
618 <include name="*.xml"/>
619 <include name="*.properties"/>
620 <include name="*.css"/>
621 <include name="*.stub"/>
622 <exclude name="**/out/**/*"/>
623 <exclude name="**/*.jar"/>
624 <exclude name="**/build-local.properties"/>
625 <exclude name="main/tests/core/src/com/ibm/icu/dev/data/rbbi/english.dict"/>
626 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
627 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
628 <exclude name="tools/build/icu4j*.api*.gz"/>
629 </fixcrlf>
630
631 <property name="icu4jsrc.tar" value="${out.dir}/icu4jsrc.tar"/>
632
633 <tar destfile="${icu4jsrc.tar}" longfile="gnu">
634 <fileset dir="${src.release.wrk.dir}" includes="**/*"/>
635 <fileset dir="${basedir}">
636 <include name="main/shared/data/*.jar"/>
637 <include name="main/tests/core/src/com/ibm/icu/dev/data/rbbi/english.dict"/>
638 <include name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
639 <include name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
640 <include name="tools/build/icu4j*.api*.gz"/>
641 </fileset>
642 </tar>
643
644 <mkdir dir="${release.dir}"/>
645 <gzip destfile="${release.dir}/${icu4jsrc.tgz.file}" src="${icu4jsrc.tar}"/>
646
647 <delete dir="${src.release.wrk.dir}"/>
648 <delete file="${icu4jsrc.tar}"/>
649 </target>
650
651 <!-- findbugs targets -->
652
653 <target name="findbugs" description="Run FindBugs on all library sub projects.">
654 <property name="findbugs.out.dir" value="${out.dir}/findbugs"/>
655 <mkdir dir="${findbugs.out.dir}"/>
656
657 <ant dir="${icu4j.core.dir}" inheritAll="false" target="findbugs"/>
658 <copy file="${icu4j.core.dir}/${out.dir}/fb-core.html" todir="${findbugs.out.dir}"/>
659
660 <ant dir="${icu4j.collate.dir}" inheritAll="false" target="findbugs"/>
661 <copy file="${icu4j.collate.dir}/${out.dir}/fb-collate.html" todir="${findbugs.out.dir}"/>
662
663 <ant dir="${icu4j.currdata.dir}" inheritAll="false" target="findbugs"/>
664 <copy file="${icu4j.currdata.dir}/${out.dir}/fb-currdata.html" todir="${findbugs.out.dir}"/>
665
666 <ant dir="${icu4j.langdata.dir}" inheritAll="false" target="findbugs"/>
667 <copy file="${icu4j.langdata.dir}/${out.dir}/fb-langdata.html" todir="${findbugs.out.dir}"/>
668
669 <ant dir="${icu4j.regiondata.dir}" inheritAll="false" target="findbugs"/>
670 <copy file="${icu4j.regiondata.dir}/${out.dir}/fb-regiondata.html" todir="${findbugs.out.dir}"/>
671
672 <ant dir="${icu4j.translit.dir}" inheritAll="false" target="findbugs"/>
673 <copy file="${icu4j.translit.dir}/${out.dir}/fb-translit.html" todir="${findbugs.out.dir}"/>
674
675
676 <ant dir="${icu4j.charset.dir}" inheritAll="false" target="findbugs"/>
677 <copy file="${icu4j.charset.dir}/${out.dir}/fb-charset.html" todir="${findbugs.out.dir}"/>
678
679 <ant dir="${icu4j.localespi.dir}" inheritAll="false" target="findbugs"/>
680 <copy file="${icu4j.localespi.dir}/${out.dir}/fb-localespi.html" todir="${findbugs.out.dir}"/>
681 </target>
682
683 <!-- compile targets -->
684 <target name="core" description="Build core classes">
685 <ant dir="${icu4j.core.dir}" inheritAll="false"/>
686 </target>
687
688 <target name="collate" depends="core" description="Build collation classes">
689 <ant dir="${icu4j.collate.dir}" inheritAll="false"/>
690 </target>
691
692 <target name="charset" depends="core" description="Build charset classes">
693 <ant dir="${icu4j.charset.dir}" inheritAll="false"/>
694 </target>
695
696 <target name="currdata" depends="core" description="Build currency data classes">
697 <ant dir="${icu4j.currdata.dir}" inheritAll="false"/>
698 </target>
699
700 <target name="langdata" depends="core" description="Build language data classes">
701 <ant dir="${icu4j.langdata.dir}" inheritAll="false"/>
702 </target>
703
704 <target name="localespi" if="is.java6.plus" description="Build Locale SPI classes">
705 <antcall target="_build-localespi"/>
706 </target>
707
708 <target name="_build-localespi" depends="core, collate, currdata, langdata, regiondata">
709 <ant dir="${icu4j.localespi.dir}" inheritAll="false"/>
710 </target>
711
712 <target name="regiondata" depends="core" description="Build region data classes">
713 <ant dir="${icu4j.regiondata.dir}" inheritAll="false"/>
714 </target>
715
716 <target name="translit" depends="core" description="Build translit classes">
717 <ant dir="${icu4j.translit.dir}" inheritAll="false"/>
718 </target>
719
720 <target name="test-framework" depends="core" description="Build test framework classes">
721 <ant dir="${icu4j.test-framework.dir}" inheritAll="false"/>
722 </target>
723
724 <target name="core-tests" depends="core, test-framework" description="Build core tests">
725 <ant dir="${icu4j.core-tests.dir}" inheritAll="false"/>
726 </target>
727
728 <target name="collate-tests" depends="collate, test-framework" description="Build core tests">
729 <ant dir="${icu4j.collate-tests.dir}" inheritAll="false"/>
730 </target>
731
732 <target name="charset-tests" depends="charset, test-framework" description="Build charset tests">
733 <ant dir="${icu4j.charset-tests.dir}" inheritAll="false"/>
734 </target>
735
736 <target name="localespi-tests" if="is.java6.plus" description="Build Locale SPI tests">
737 <antcall target="_build-localespi-tests"/>
738 </target>
739
740 <target name="_build-localespi-tests" depends="localespi, test-framework">
741 <ant dir="${icu4j.localespi-tests.dir}" inheritAll="false"/>
742 </target>
743
744 <target name="packaging-tests" depends="test-framework" description="Build packaging tests">
745 <ant dir="${icu4j.packaging-tests.dir}" inheritAll="false"/>
746 </target>
747
748 <target name="translit-tests" depends="translit, test-framework" description="Build translit tests">
749 <ant dir="${icu4j.translit-tests.dir}" inheritAll="false"/>
750 </target>
751
752 <target name="testall" depends="test-framework" description="Build top level TestAll">
753 <ant dir="${icu4j.testall.dir}" inheritAll="false"/>
754 </target>
755
756 <target name="demos" depends="core, charset, translit" description="Build demo classes">
757 <ant dir="${icu4j.demos.dir}" inheritAll="false"/>
758 </target>
759
760 <target name="samples" depends="core, charset, collate, translit" description="Build sample classes">
761 <ant dir="${icu4j.samples.dir}" inheritAll="false"/>
762 </target>
763
764 <target name="build-tools" description="Build build-tool classes">
765 <ant dir="${icu4j.build-tools.dir}" inheritAll="false"/>
766 </target>
767
768 <target name="tools" depends="core, core-tests, collate, translit, translit-tests" description="Build tool classes">
769 <ant dir="${icu4j.tools.dir}" inheritAll="false"/>
770 </target>
771
772 <target name="perf-tests" if="is.java6.plus" depends="core, charset, collate, tools" description="Build performance test classes">
773 <ant dir="${icu4j.perf-tests.dir}" inheritAll="false"/>
774 </target>
775
776 <!-- doc targets -->
777 <target name="docs" depends="info, build-tools, _checkJCite, _docsWithJCite, _docsWithoutJCite" description="Build API documents"/>
778
779 <target name="_checkJCite" if="env.JCITE_DIR">
780 <fileset dir="${env.JCITE_DIR}" id="jcite.files">
781 <include name="build/*.jar"/>
782 <include name="lib/*.jar"/>
783 </fileset>
784 <pathconvert property="jcite.libs" refid="jcite.files"/>
785
786 <dirset dir="${basedir}" id="jcite.src.dirs">
787 <include name="samples/src"/>
788 <include name="demos/src"/>
789 <include name="main/tests/*/src"/>
790 </dirset>
791 <pathconvert property="jcite.addl.src" refid="jcite.src.dirs"/>
792 </target>
793
794 <target name="_docsStyleSheet">
795 <condition property="docs.style.sheet" value="stylesheet7.css" else="stylesheet.css">
796 <isset property="is.java7.plus"/>
797 </condition>
798 </target>
799
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +0200800 <!-- doclint in V8 is too strict to handle existing html in javadoc -->
801 <target name="_setLintV8" unless="is.pre.java8">
802 <property name="lintParam" value="-Xdoclint:-html"/>
803 </target>
804 <target name="_setLintPreV8" if="is.pre.java8">
805 <property name="lintParam" value=""/>
806 </target>
807
808 <target name="_docsWithJCite" depends="_docsStyleSheet, _setLintV8, _setLintPreV8" if="jcite.libs">
Fredrik Roubert7935b182014-11-18 20:21:54 -0800809 <echo message="JCite library path: ${jcite.libs}"/>
810 <echo message="JCite additional source path: ${jcite.addl.src}"/>
811 <echo message="Custom stylesheet: ${docs.style.sheet}"/>
812 <javadoc
813 destdir="${doc.dir}"
814 nodeprecatedlist="true"
815 windowtitle="${icu4j.api.doc.window.title}"
816 doctitle="${icu4j.api.doc.title}"
817 header="${icu4j.api.doc.header}"
818 encoding="${java.src.encoding}"
819 docencoding="UTF-8"
820 charset="UTF-8"
821 bottom="&lt;font size=-1&gt;Copyright (c) ${current.year} IBM Corporation and others.&lt;/font&gt;"
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +0200822 additionalparam="${lintParam} -breakiterator -use -tagletpath ${icu4j.build-tools.jar}${path.separator}${jcite.libs} -taglet com.ibm.icu.dev.tool.docs.ICUTaglet -taglet ch.arrenbrecht.jcite.JCiteTaglet -J-Djcitesourcepath=${jcite.addl.src} -J-Dfile.encoding=UTF-8"
Fredrik Roubert7935b182014-11-18 20:21:54 -0800823 link="${icu4j.api.doc.jdk.link}"
824 source="1.5"
825 stylesheetfile="${docs.style.sheet}">
826 <packageset dir="${icu4j.core.dir}/src">
827 <include name="com/ibm/icu/lang/**"/>
828 <include name="com/ibm/icu/math/**"/>
829 <include name="com/ibm/icu/text/**"/>
830 <include name="com/ibm/icu/util/**"/>
831 </packageset>
832 <packageset dir="${icu4j.collate.dir}/src">
833 <include name="com/ibm/icu/text/**"/>
834 </packageset>
835 <packageset dir="${icu4j.translit.dir}/src">
836 <include name="com/ibm/icu/text/**"/>
837 </packageset>
838 <packageset dir="${icu4j.charset.dir}/src">
839 <include name="com/ibm/icu/charset/**"/>
840 </packageset>
841 </javadoc>
842 </target>
843
844 <target name="_docsWithoutJCite" unless="jcite.libs">
845 <javadoc
846 destdir="${doc.dir}"
847 nodeprecatedlist="true"
848 windowtitle="${icu4j.api.doc.window.title}"
849 doctitle="${icu4j.api.doc.title}"
850 header="${icu4j.api.doc.header}"
851 encoding="${java.src.encoding}"
852 docencoding="UTF-8"
853 charset="UTF-8"
854 bottom="&lt;font size=-1&gt;Copyright (c) ${current.year} IBM Corporation and others.&lt;/font&gt;"
855 additionalparam="-breakiterator -use -tagletpath ${icu4j.build-tools.jar} -taglet com.ibm.icu.dev.tool.docs.ICUTaglet"
856 link="${icu4j.api.doc.jdk.link}"
857 source="1.5">
858 <packageset dir="${icu4j.core.dir}/src">
859 <include name="com/ibm/icu/lang/**"/>
860 <include name="com/ibm/icu/math/**"/>
861 <include name="com/ibm/icu/text/**"/>
862 <include name="com/ibm/icu/util/**"/>
863 </packageset>
864 <packageset dir="${icu4j.collate.dir}/src">
865 <include name="com/ibm/icu/text/**"/>
866 </packageset>
867 <packageset dir="${icu4j.translit.dir}/src">
868 <include name="com/ibm/icu/text/**"/>
869 </packageset>
870 <packageset dir="${icu4j.charset.dir}/src">
871 <include name="com/ibm/icu/charset/**"/>
872 </packageset>
873 </javadoc>
874 </target>
875
876 <!-- JaCoCo code coverage target -->
877 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" onerror="ignore">
878 <classpath path="${env.JACOCO_DIR}/lib/jacocoant.jar"/>
879 </taskdef>
880
881 <target name="coverageJaCoCo" depends="jar, tests" description="Run the ICU4J unit tests and generate code coverage report">
882 <property name="jacoco.out.dir" value="${out.dir}/jacoco"/>
883 <property name="jacoco.exec.data.file" value="${jacoco.out.dir}/jacoco.exec"/>
884 <property name="jacoco.report.html.zip" value="${jacoco.out.dir}/report_html.zip"/>
885 <property name="jacoco.report.xml" value="${jacoco.out.dir}/report.xml"/>
886 <property name="jacoco.report.csv" value="${jacoco.out.dir}/report.csv"/>
887
888 <delete dir="${jacoco.out.dir}"/>
889 <mkdir dir="${jacoco.out.dir}"/>
890
891 <jacoco:coverage destfile="${jacoco.exec.data.file}">
892 <java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -0800893 <jvmarg line="${jvm_options} -ea -Djava.awt.headless=true"/>
894 <classpath>
895 <pathelement location="${icu4j.jar.file}"/>
896 <pathelement location="${icu4j-charset.jar.file}"/>
897 <pathelement location="${icu4j.test-framework.jar}"/>
898 <pathelement location="${icu4j.core-tests.jar}"/>
899 <pathelement location="${icu4j.collate-tests.jar}"/>
900 <pathelement location="${icu4j.charset-tests.jar}"/>
901 <pathelement location="${icu4j.translit-tests.jar}"/>
902 <pathelement location="${icu4j.testall.jar}"/>
903 </classpath>
904 </java>
905 </jacoco:coverage>
906
907 <jacoco:report>
908 <executiondata>
909 <file file="${jacoco.exec.data.file}"/>
910 </executiondata>
911
912 <structure name="ICU4J Project">
913 <classfiles>
914 <fileset dir=".">
915 <include name="${icu4j.jar.file}"/>
916 <include name="${icu4j-charset.jar.file}"/>
917 </fileset>
918 </classfiles>
919 <sourcefiles encoding="UTF-8">
920 <fileset dir="${icu4j.core.dir}/src"/>
921 <fileset dir="${icu4j.collate.dir}/src"/>
922 <fileset dir="${icu4j.currdata.dir}/src"/>
923 <fileset dir="${icu4j.langdata.dir}/src"/>
924 <fileset dir="${icu4j.regiondata.dir}/src"/>
925 <fileset dir="${icu4j.translit.dir}/src"/>
926
927 <fileset dir="${icu4j.charset.dir}/src"/>
928 </sourcefiles>
929 </structure>
930
931 <html destfile="${jacoco.report.html.zip}"/>
932 <xml destfile="${jacoco.report.xml}"/>
933 <csv destfile="${jacoco.report.csv}"/>
934 </jacoco:report>
935 </target>
936
937 <!-- Clover code coverage target -->
938 <property name="clover.out.dir" value="${out.dir}/clover"/>
939 <property name="clover.jar" location="${env.CLOVER_DIR}/clover.jar"/>
940 <taskdef resource="cloverlib.xml" classpath="${clover.jar}" onerror="ignore"/>
941
942 <target name="codeCoverage" depends="clean" description="Generate code coverage report with clover">
943 <!-- Set up clover -->
944 <mkdir dir="${clover.out.dir}"/>
945 <clover-setup initstring="${clover.out.dir}/clover.db">
946 <files>
947 <exclude name="**/dev/**/*.java"/>
948 </files>
949 <methodContext name="API" regexp="(.* )?public .*"/>
950 </clover-setup>
951
952 <!-- Build components with clover instrumentation -->
953 <ant dir="${icu4j.core.dir}" inheritAll="false" inheritRefs="true">
954 <property name="build.compiler" value="${build.compiler}"/>
955 </ant>
956 <ant dir="${icu4j.collate.dir}" inheritAll="false" inheritRefs="true">
957 <property name="build.compiler" value="${build.compiler}"/>
958 </ant>
959 <ant dir="${icu4j.charset.dir}" inheritAll="false" inheritRefs="true">
960 <property name="build.compiler" value="${build.compiler}"/>
961 </ant>
962 <ant dir="${icu4j.currdata.dir}" inheritAll="false" inheritRefs="true">
963 <property name="build.compiler" value="${build.compiler}"/>
964 </ant>
965 <ant dir="${icu4j.langdata.dir}" inheritAll="false" inheritRefs="true">
966 <property name="build.compiler" value="${build.compiler}"/>
967 </ant>
968 <ant dir="${icu4j.regiondata.dir}" inheritAll="false" inheritRefs="true">
969 <property name="build.compiler" value="${build.compiler}"/>
970 </ant>
971 <ant dir="${icu4j.translit.dir}" inheritAll="false" inheritRefs="true">
972 <property name="build.compiler" value="${build.compiler}"/>
973 </ant>
974 <ant dir="${icu4j.test-framework.dir}" inheritAll="false" inheritRefs="true">
975 <property name="build.compiler" value="${build.compiler}"/>
976 </ant>
977 <ant dir="${icu4j.core-tests.dir}" inheritAll="false" inheritRefs="true">
978 <property name="build.compiler" value="${build.compiler}"/>
979 </ant>
980 <ant dir="${icu4j.collate-tests.dir}" inheritAll="false" inheritRefs="true">
981 <property name="build.compiler" value="${build.compiler}"/>
982 </ant>
983 <ant dir="${icu4j.charset-tests.dir}" inheritAll="false" inheritRefs="true">
984 <property name="build.compiler" value="${build.compiler}"/>
985 </ant>
986 <ant dir="${icu4j.translit-tests.dir}" inheritAll="false" inheritRefs="true">
987 <property name="build.compiler" value="${build.compiler}"/>
988 </ant>
989 <ant dir="${icu4j.testall.dir}" inheritAll="false" inheritRefs="true">
990 <property name="build.compiler" value="${build.compiler}"/>
991 </ant>
992
993 <!-- Run the test suites -->
994 <java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -0800995 <classpath>
996 <pathelement location="${icu4j.core.jar}"/>
997 <pathelement location="${icu4j.collate.jar}"/>
998 <pathelement location="${icu4j.charset.jar}"/>
999 <pathelement location="${icu4j.currdata.jar}"/>
1000 <pathelement location="${icu4j.langdata.jar}"/>
1001 <pathelement location="${icu4j.regiondata.jar}"/>
1002 <pathelement location="${icu4j.translit.jar}"/>
1003 <pathelement location="${icu4j.test-framework.jar}"/>
1004 <pathelement location="${icu4j.core-tests.jar}"/>
1005 <pathelement location="${icu4j.collate-tests.jar}"/>
1006 <pathelement location="${icu4j.charset-tests.jar}"/>
1007 <pathelement location="${icu4j.translit-tests.jar}"/>
1008 <pathelement location="${icu4j.testall.jar}"/>
1009 <pathelement location="${clover.jar}"/>
1010 </classpath>
1011 </java>
1012
1013 <!-- Generate HTML coverage report -->
1014 <!-- <clover-html-report outdir="${clover.out.dir}/html" title="ICU4J Code Coverage"/> -->
1015 <clover-report>
1016 <current outfile="${clover.out.dir}/html" title="ICU4J Code Coverage">
1017 <format type="html" filter="assert" />
1018 </current>
1019 </clover-report>
1020 </target>
1021
1022 <!-- Release management targets -->
1023 <target name="checktags" depends="info, build-tools" description="Check API tags before release">
1024 <javadoc source="1.5"
1025 encoding="${java.src.encoding}">
1026 <packageset dir="${icu4j.core.dir}/src">
1027 <include name="com/ibm/icu/lang/**"/>
1028 <include name="com/ibm/icu/math/**"/>
1029 <include name="com/ibm/icu/text/**"/>
1030 <include name="com/ibm/icu/util/**"/>
1031 </packageset>
1032 <packageset dir="${icu4j.collate.dir}/src">
1033 <include name="com/ibm/icu/**"/>
1034 </packageset>
1035 <packageset dir="${icu4j.charset.dir}/src">
1036 <include name="com/ibm/icu/charset/**"/>
1037 </packageset>
1038 <doclet name="com.ibm.icu.dev.tool.docs.CheckTags" path="${icu4j.build-tools.jar}"/>
1039 </javadoc>
1040 </target>
1041
1042 <target name="gatherapi" depends="info, build-tools" description="Run API database generator tool">
1043 <mkdir dir="${out.dir}"/>
1044 <javadoc source="1.5"
1045 encoding="${java.src.encoding}">
1046 <packageset dir="${icu4j.core.dir}/src">
1047 <include name="com/ibm/icu/lang/**"/>
1048 <include name="com/ibm/icu/math/**"/>
1049 <include name="com/ibm/icu/text/**"/>
1050 <include name="com/ibm/icu/util/**"/>
1051 </packageset>
1052 <packageset dir="${icu4j.collate.dir}/src">
1053 <include name="com/ibm/icu/text/**"/>
1054 <include name="com/ibm/icu/util/**"/>
1055 </packageset>
1056 <packageset dir="${icu4j.charset.dir}/src">
1057 <include name="com/ibm/icu/charset/**"/>
1058 </packageset>
1059 <packageset dir="${icu4j.translit.dir}/src">
1060 <include name="com/ibm/icu/text/**"/>
1061 </packageset>
1062 <doclet name="com.ibm.icu.dev.tool.docs.GatherAPIData" path="${icu4j.build-tools.jar}">
1063 <param name="-name" value="ICU4J ${icu4j.impl.version}"/>
1064 <param name="-output" value="${out.dir}/icu4j${api.report.version}.api3"/>
1065 <param name="-internal"/>
1066 <param name="-version"/>
1067 <param name="-gzip"/>
1068 </doclet>
1069 </javadoc>
1070 </target>
1071
1072 <target name="apireport" depends="info, gatherapi" description="Run API report generator tool">
1073 <java classname="com.ibm.icu.dev.tool.docs.ReportAPI"
1074 classpath="${icu4j.build-tools.jar}"
1075 failonerror="true">
1076 <arg value="-old:" />
1077 <arg value="${icu4j.build-tools.dir}/icu4j${api.report.prev.version}.api3.gz" />
1078 <arg value="-new:" />
1079 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1080 <arg value="-html" />
1081 <arg value="-out:" />
1082 <arg value="${out.dir}/icu4j_compare_${api.report.prev.version}_${api.report.version}.html" />
1083 </java>
1084 </target>
1085
1086 <target name="gatherapiOld" depends="info, build-tools" description="Run API database generator tool (Pre Java 5 style)">
1087 <mkdir dir="${out.dir}"/>
1088 <javadoc source="1.5"
1089 encoding="${java.src.encoding}">
1090 <packageset dir="${icu4j.core.dir}/src">
1091 <include name="com/ibm/icu/lang/**"/>
1092 <include name="com/ibm/icu/math/**"/>
1093 <include name="com/ibm/icu/text/**"/>
1094 <include name="com/ibm/icu/util/**"/>
1095 </packageset>
1096 <packageset dir="${icu4j.collate.dir}/src">
1097 <include name="com/ibm/icu/text/**"/>
1098 <include name="com/ibm/icu/util/**"/>
1099 </packageset>
1100 <packageset dir="${icu4j.charset.dir}/src">
1101 <include name="com/ibm/icu/charset/**"/>
1102 </packageset>
1103 <packageset dir="${icu4j.translit.dir}/src">
1104 <include name="com/ibm/icu/text/**"/>
1105 </packageset>
1106 <doclet name="com.ibm.icu.dev.tool.docs.GatherAPIDataOld" path="${icu4j.build-tools.jar}">
1107 <param name="-name" value="ICU4J ${icu4j.impl.version}"/>
1108 <param name="-output" value="${out.dir}/icu4j${api.report.version}.api"/>
1109 <param name="-internal"/>
1110 <param name="-gzip"/>
1111 </doclet>
1112 </javadoc>
1113 </target>
1114
1115 <target name="apireportOld" depends="info, gatherapiOld" description="Run API report generator tool (Pre Java 5 Style)">
1116 <java classname="com.ibm.icu.dev.tool.docs.ReportAPI"
1117 classpath="${icu4j.build-tools.jar}"
1118 failonerror="true">
1119 <arg value="-old:" />
1120 <arg value="${icu4j.build-tools.dir}/icu4j${api.report.prev.version}.api.gz" />
1121 <arg value="-new:" />
1122 <arg value="${out.dir}/icu4j${api.report.version}.api.gz" />
1123 <arg value="-html" />
1124 <arg value="-internal" />
1125 <arg value="-out:" />
1126 <arg value="${out.dir}/icu4j_compare_${api.report.prev.version}_${api.report.version}.html" />
1127 </java>
1128 </target>
1129
1130 <target name="checkDeprecated" depends="info, build-tools, gatherapi, main"
1131 description="Check consistency between javadoc @deprecated and @Deprecated annotation">
1132 <java classname="com.ibm.icu.dev.tool.docs.DeprecatedAPIChecker"
1133 failonerror="true">
1134 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1135 <classpath>
1136 <pathelement location="${icu4j.build-tools.jar}"/>
1137 <pathelement location="${icu4j.core.jar}"/>
1138 <pathelement location="${icu4j.collate.jar}"/>
1139 <pathelement location="${icu4j.charset.jar}"/>
1140 <pathelement location="${icu4j.currdata.jar}"/>
1141 <pathelement location="${icu4j.langdata.jar}"/>
1142 <pathelement location="${icu4j.regiondata.jar}"/>
1143 <pathelement location="${icu4j.translit.jar}"/>
1144 </classpath>
1145 </java>
1146 </target>
1147
1148 <target name="draftAPIs" depends="info, gatherapi" description="Run API collector tool and generate draft API report">
1149 <java classname="com.ibm.icu.dev.tool.docs.CollectAPI"
1150 classpath="${icu4j.build-tools.jar}"
1151 failonerror="true">
1152 <arg value="-f"/>
1153 <arg value="Draft"/>
1154 <arg value="-o"/>
1155 <arg value="${out.dir}/draftAPIs.html"/>
1156 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1157 </java>
1158 </target>
1159
1160 <target name="swatDeprecated" depends="build-tools" description="Convert @deprecated @draft tags to @provisional">
1161 <antcall target="_runSwatDeprecated">
1162 <param name="swat.deprecated.opt" value="-dep"/>
1163 </antcall>
1164 </target>
1165
1166 <target name="swatProvisional" depends="build-tools" description="Convert @provisional tags to @deprecated @draft">
1167 <antcall target="_runSwatDeprecated">
1168 <param name="swat.deprecated.opt" value="-prov"/>
1169 </antcall>
1170 </target>
1171
1172 <target name="_runSwatDeprecated">
1173 <java classname="com.ibm.icu.dev.tool.docs.SwatDeprecated"
1174 classpath="${icu4j.build-tools.jar}"
1175 failonerror="true">
1176 <arg value="${swat.deprecated.opt}"/>
1177 <arg value="-src"/>
1178 <arg value="${icu4j.core.dir}/src"/>
1179 <arg value="-dst"/>
1180 <arg value="${icu4j.core.dir}/src"/>
1181 <arg value="-overwrite"/>
1182 <arg value="-verbose"/>
1183 </java>
1184 <java classname="com.ibm.icu.dev.tool.docs.SwatDeprecated"
1185 classpath="${icu4j.build-tools.jar}"
1186 failonerror="true">
1187 <arg value="${swat.deprecated.opt}"/>
1188 <arg value="-src"/>
1189 <arg value="${icu4j.charset.dir}/src"/>
1190 <arg value="-dst"/>
1191 <arg value="${icu4j.charset.dir}/src"/>
1192 <arg value="-overwrite"/>
1193 <arg value="-verbose"/>
1194 </java>
1195 </target>
1196
1197 <target name="serialTestData" depends="main, tests">
1198 <property name="serial.test.data.dir" value="${out.dir}/serialTestData"/>
1199 <delete dir="${serial.test.data.dir}"/>
1200 <mkdir dir="${serial.test.data.dir}"/>
1201 <java classname="com.ibm.icu.dev.test.serializable.SerializableWriter" fork="yes" failonerror="true">
1202 <arg line="${serial.test.data.dir}"/>
1203 <classpath>
1204 <pathelement location="${icu4j.core.jar}"/>
1205 <pathelement location="${icu4j.collate.jar}"/>
1206 <pathelement location="${icu4j.charset.jar}"/>
1207 <pathelement location="${icu4j.currdata.jar}"/>
1208 <pathelement location="${icu4j.langdata.jar}"/>
1209 <pathelement location="${icu4j.regiondata.jar}"/>
1210 <pathelement location="${icu4j.translit.jar}"/>
1211 <pathelement location="${icu4j.test-framework.jar}"/>
1212 <pathelement location="${icu4j.core-tests.jar}"/>
1213 </classpath>
1214 </java>
1215 <echo message="Note: The serialization compatibility test data files were"/>
1216 <echo message="created in ${serial.test.data.dir}. Once you confirm"/>
1217 <echo message="the test runs clean, you should copy the data file directory to"/>
1218 <echo message="main/tests/core/src/com/ibm/icu/dev/test/serializable/data."/>
1219 </target>
1220
1221 <!-- Special packaging targets -->
1222 <target name="translitIMEJar" depends="info" description="Build transliterator IME 'icutransime.jar' jar file">
1223 <property name="translit.ime.out.dir" value="${out.dir}/translit_ime"/>
1224
1225 <mkdir dir="${translit.ime.out.dir}/bin"/>
1226 <javac destdir="${translit.ime.out.dir}/bin"
1227 source="${javac.source}"
1228 target="${javac.target}"
1229 encoding="${java.src.encoding}"
1230 debug="on" deprecation="off">
1231 <src path="${icu4j.core.dir}/src"/>
1232 <src path="${icu4j.translit.dir}/src"/>
1233 <src path="${icu4j.tools.dir}/src"/>
1234 <include name="com/ibm/icu/dev/tool/ime/translit/*.java"/>
1235 </javac>
1236
1237 <copy file="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/translit/Transliterator.properties"
1238 todir="${translit.ime.out.dir}/bin/com/ibm/icu/dev/tool/ime/translit"/>
1239
1240 <mkdir dir="${translit.ime.out.dir}/lib"/>
1241 <jar jarfile="${translit.ime.out.dir}/lib/icutransime.jar"
1242 compress="true"
1243 basedir="${translit.ime.out.dir}/bin"
1244 includes="com/ibm/icu/dev/tool/ime/translit/**/*"
1245 manifest="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/translit/manifest.stub">
1246 <metainf dir="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/translit" includes="services/*" />
1247 </jar>
1248 </target>
1249
1250 <target name="indicIMEJar" depends="info" description="Build indic IME 'icuindicime.jar' jar file">
1251 <property name="indic.ime.out.dir" value="${out.dir}/indic_ime"/>
1252
1253 <mkdir dir="${indic.ime.out.dir}/bin"/>
1254 <javac destdir="${indic.ime.out.dir}/bin"
1255 source="${javac.source}"
1256 target="${javac.target}"
1257 encoding="${java.src.encoding}"
1258 debug="on" deprecation="off">
1259 <src path="${icu4j.core.dir}/src"/>
1260 <src path="${icu4j.tools.dir}/src"/>
1261 <include name="com/ibm/icu/dev/tool/ime/indic/*.java"/>
1262 </javac>
1263
1264 <copy file="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/indic/DisplayNames.properties"
1265 todir="${indic.ime.out.dir}/bin/com/ibm/icu/dev/tool/ime/indic"/>
1266
1267 <mkdir dir="${indic.ime.out.dir}/lib"/>
1268 <jar jarfile="${indic.ime.out.dir}/lib/icuindicime.jar"
1269 compress="true"
1270 basedir="${indic.ime.out.dir}/bin"
1271 includes="com/ibm/icu/dev/tool/ime/indic/**/*"
1272 manifest="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/indic/manifest.stub">
1273 <metainf dir="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/indic" includes="services/*" />
1274 </jar>
1275 </target>
1276
1277 <target name="cldrUtil" depends="icu4jJar" description="Build Utilities for CLDR tooling">
1278 <mkdir dir="${cldr.util.out.dir}/bin"/>
1279 <javac destdir="${cldr.util.out.dir}/bin"
1280 source="${javac.source}"
1281 target="${javac.target}"
1282 encoding="${java.src.encoding}"
1283 debug="on" deprecation="off"
1284 classpath="${icu4j.jar.file}">
1285
1286 <src path="${icu4j.tools.dir}/src"/>
1287 <src path="${icu4j.translit-tests.dir}/src"/>
1288 <src path="${icu4j.test-framework.dir}/src"/>
1289
1290 <include name="com/ibm/icu/dev/test/TestFmwk.java" />
1291 <include name="com/ibm/icu/dev/util/*.java" />
1292 <include name="com/ibm/icu/dev/tool/UOption.java" />
1293 </javac>
1294
1295 <mkdir dir="${cldr.util.out.dir}/lib"/>
1296 <jar jarfile="${cldr.util.out.dir}/lib/utilities.jar"
1297 compress="true"
1298 basedir="${cldr.util.out.dir}/bin">
1299 <include name="com/ibm/icu/dev/test/*.class"/>
1300 <include name="com/ibm/icu/dev/util/*.class"/>
1301 <include name="com/ibm/icu/dev/tool/UOption*.class"/>
1302 </jar>
1303 </target>
1304
1305 <target name="releaseCLDR" depends="icu4jJar,icu4jSrcJar,cldrUtil" description="Build release files for CLDR tooling">
1306 <mkdir dir="${cldr.release.dir}"/>
1307 <!-- icu4j.jar -->
1308 <copy file="${icu4j.jar.file}" todir="${cldr.release.dir}"/>
1309 <!-- icu4j-src.jar -->
1310 <copy file="${icu4j-src.jar.file}" todir="${cldr.release.dir}"/>
1311 <!-- utilities.jar -->
1312 <copy file="${cldr.util.out.dir}/lib/utilities.jar" todir="${cldr.release.dir}"/>
1313 <!-- utilities-src.jar -->
1314 <jar jarfile="${cldr.release.dir}/utilities-src.jar" compress="true">
1315 <fileset dir="${icu4j.test-framework.dir}/${src.dir}">
1316 <include name="com/ibm/icu/dev/test/TestFmwk.java"/>
1317 <include name="com/ibm/icu/dev/test/*Log*.java"/>
1318 <include name="com/ibm/icu/dev/test/TestUtil.java"/>
1319 <include name="com/ibm/icu/dev/test/UTF16Util.java"/>
1320 </fileset>
1321 <fileset dir="${icu4j.test-framework.dir}/${src.dir}" includes="com/ibm/icu/dev/util/*.java"/>
1322 <fileset dir="${icu4j.translit-tests.dir}/${src.dir}" includes="com/ibm/icu/dev/util/*.java"/>
1323 <fileset dir="${icu4j.tools.dir}/${src.dir}" includes="com/ibm/icu/dev/tool/UOption.java"/>
1324 </jar>
1325 </target>
1326
1327 <target name="xliff" description="Build xliff converter tool">
1328 <property name="xliff.out.dir" value="${out.dir}/xliff"/>
1329
1330 <mkdir dir="${xliff.out.dir}/bin"/>
1331 <javac destdir="${xliff.out.dir}/bin"
1332 source="1.3"
1333 target="1.3"
1334 encoding="${java.src.encoding}"
1335 debug="on" deprecation="off">
1336 <src path="${icu4j.tools.dir}/src"/>
1337 <include name="com/ibm/icu/dev/tool/localeconverter/CalculateCRC32.java"/>
1338 <include name="com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java"/>
1339 <include name="com/ibm/icu/dev/tool/UOption.java"/>
1340 </javac>
1341
1342 <mkdir dir="${xliff.out.dir}/lib"/>
1343
1344 <jar jarfile="${xliff.out.dir}/lib/xliff-src.jar"
1345 compress="true"
1346 basedir="${icu4j.tools.dir}/src">
1347 <include name="com/ibm/icu/dev/tool/localeconverter/CalculateCRC32.java"/>
1348 <include name="com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java"/>
1349 <include name="com/ibm/icu/dev/tool/UOption.java"/>
1350 </jar>
1351
1352 <jar jarfile="${xliff.out.dir}/lib/xliff.jar"
1353 compress="true"
1354 basedir="${xliff.out.dir}/bin"
1355 manifest="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/localeconverter/manifest.stub"/>
1356 </target>
1357
1358
1359 <!-- ICU4J modularization targets -->
1360 <property name="module.dir" value="${out.dir}/module"/>
1361 <property name="module.bin.dir" value="${module.dir}/bin"/>
1362 <property name="module.tests.dir" value="${module.dir}/tests"/>
1363 <property name="module.jar.dir" value="${module.dir}/lib"/>
1364 <property name="module.jar" value="${module.jar.dir}/icu4j-module.jar"/>
1365
1366 <target name="moduleJar" description="Create a ICU4J module jar file">
1367 <mkdir dir="${module.jar.dir}"/>
1368 <jar jarfile="${module.jar}"
1369 compress="true"
1370 basedir="${module.bin.dir}">
1371 <manifest>
1372 <attribute name="Built-By" value="${corp}" />
1373 <section name="com/ibm/icu">
1374 <attribute name="Specification-Title" value="ICU4J Modularized Build" />
1375 <attribute name="Specification-Version" value="${jar.spec.version}" />
1376 <attribute name="Specification-Vendor" value="ICU" />
1377 <attribute name="Implementation-Title" value=" ICU for Java Module" />
1378 <attribute name="Implementation-Version" value="${jar.impl.version}" />
1379 <attribute name="Implementation-Vendor" value="${corp}" />
1380 <attribute name="Implementation-Vendor-Id" value="com.ibm" />
1381 <attribute name="Copyright-Info" value="${jar.copyright.info}" />
1382 <attribute name="Sealed" value="false" />
1383 </section>
1384 </manifest>
1385 </jar>
1386 <copy file="${module.jar}" tofile="icu4j.jar"/>
1387 </target>
1388
1389 <target name="moduleCheck" description="Run tests for a ICU4J module jar">
1390 <java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001391 <arg value="-nodata"/>
1392 <classpath>
1393 <pathelement location="${module.jar}"/>
1394 <pathelement location="${module.tests.dir}"/>
1395 </classpath>
1396 </java>
1397 </target>
1398
1399 <patternset id="common.test.sources">
1400 <include name="com/ibm/icu/dev/test/TestFmwk.java"/>
1401 <include name="com/ibm/icu/dev/test/TestLog.java"/>
1402 <include name="com/ibm/icu/dev/test/TestUtil.java"/>
1403 <include name="com/ibm/icu/dev/test/UTF16Util.java"/>
1404 <include name="com/ibm/icu/dev/test/TestAll.java"/>
1405 <include name="com/ibm/icu/dev/test/TestAllCore.java"/>
1406 </patternset>
1407
1408 <!-- Break Iterator -->
1409 <target name="breakIterator" depends="_copyFullPropsData" description="Modular build of break iterator services">
1410 <mkdir dir="${module.bin.dir}"/>
1411 <javac srcdir="${icu4j.core.dir}/src"
1412 destdir="${module.bin.dir}"
1413 source="${javac.source}"
1414 target="${javac.target}"
1415 encoding="${java.src.encoding}"
1416 debug="on" deprecation="off">
1417 <include name="com/ibm/icu/impl/UCharacterName.java"/>
1418 <include name="com/ibm/icu/impl/data/*Break*.java"/>
1419 <include name="com/ibm/icu/lang/**/*.java"/>
1420 <include name="com/ibm/icu/text/*BreakIterator*.java"/>
1421 <include name="com/ibm/icu/text/UnicodeSetIterator.java"/>
1422 </javac>
1423 </target>
1424
1425 <target name="breakIteratorTests" depends="breakIterator" description="Modular build of break iterator test suite">
1426 <mkdir dir="${module.tests.dir}"/>
1427 <javac destdir="${module.tests.dir}"
1428 source="${javac.source}"
1429 target="${javac.target}"
1430 encoding="${java.src.encoding}"
1431 classpath="${module.bin.dir}"
1432 debug="on" deprecation="off">
1433 <src path="${icu4j.core.dir}/src"/>
1434 <src path="${icu4j.test-framework.dir}/src"/>
1435 <src path="${icu4j.core-tests.dir}/src"/>
1436 <src path="${icu4j.testall.dir}/src"/>
1437
1438 <patternset refid="common.test.sources"/>
1439 <include name="com/ibm/icu/dev/test/rbbi/**/*.java"/>
1440 </javac>
1441
1442 <copy file="${icu4j.core-tests.dir}/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt"
1443 todir="${module.tests.dir}/com/ibm/icu/dev/test/rbbi"/>
1444 </target>
1445
1446 <!-- Calendar -->
1447 <target name="calendar" description="Modular build of calendar services">
1448 <mkdir dir="${module.bin.dir}"/>
1449 <javac srcdir="${icu4j.core.dir}/src"
1450 destdir="${module.bin.dir}"
1451 source="${javac.source}"
1452 target="${javac.target}"
1453 encoding="${java.src.encoding}"
1454 debug="on" deprecation="off">
1455 <include name="com/ibm/icu/impl/data/*Holiday*.java"/>
1456 <include name="com/ibm/icu/impl/TimeZoneNames*.java"/>
1457 <include name="com/ibm/icu/lang/UCharacter.java"/>
1458 <include name="com/ibm/icu/text/UnicodeSetIterator.java"/>
1459 <include name="com/ibm/icu/text/NumberFormatServiceShim.java"/>
1460 <include name="com/ibm/icu/util/*Calendar*.java"/>
1461 </javac>
1462
1463 <!-- Calendar does not require Collation data, BreakIterator data -->
1464 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1465 <patternset>
1466 <include name="**/pnames.icu" />
1467 <include name="**/ucase.icu" />
1468 <include name="**/unorm.icu" />
1469 <include name="**/uprops.icu" />
1470 <include name="**/unames.icu" />
1471 <include name="**/*.res" />
1472 <exclude name="**/coll/*.res" />
1473 <exclude name="**/translit/*.res" />
1474 </patternset>
1475 </unjar>
1476 <unjar src="${icu4j.tzdata.jar}" dest="${module.bin.dir}">
1477 <patternset>
1478 <include name="**/*.res" />
1479 </patternset>
1480 </unjar>
1481 </target>
1482
1483 <target name="calendarTests" depends="calendar" description="Modular build of calendar test suite">
1484 <mkdir dir="${module.tests.dir}"/>
1485 <javac destdir="${module.tests.dir}"
1486 source="${javac.source}"
1487 target="${javac.target}"
1488 encoding="${java.src.encoding}"
1489 classpath="${module.bin.dir}"
1490 debug="on" deprecation="off">
1491 <src path="${icu4j.core.dir}/src"/>
1492 <src path="${icu4j.test-framework.dir}/src"/>
1493 <src path="${icu4j.core-tests.dir}/src"/>
1494 <src path="${icu4j.testall.dir}/src"/>
1495
1496 <patternset refid="common.test.sources"/>
1497 <include name="com/ibm/icu/dev/test/calendar/**/*.java" />
1498 </javac>
1499
1500 <unjar src="${icu4j.testdata.jar}" dest="${module.tests.dir}">
1501 <patternset>
1502 <include name="**/calendar.res"/>
1503 </patternset>
1504 </unjar>
1505 </target>
1506
1507 <!-- Collator -->
1508 <!-- this module will soon be obsolete, use the collate jar -->
1509 <target name="collator" description="Modular build of collator services">
1510 <mkdir dir="${module.bin.dir}"/>
1511 <javac destdir="${module.bin.dir}"
1512 source="${javac.source}"
1513 target="${javac.target}"
1514 encoding="${java.src.encoding}"
1515 debug="on" deprecation="off">
1516 <src path="${icu4j.core.dir}/src"/>
1517 <src path="${icu4j.collate.dir}/src"/>
1518
1519 <include name="com/ibm/icu/impl/coll/*.java"/>
1520 <include name="com/ibm/icu/impl/data/*Break*.java"/>
1521 <include name="com/ibm/icu/text/*BreakIterator*.java"/>
1522 <include name="com/ibm/icu/text/*Collation*.java"/>
1523 <include name="com/ibm/icu/text/*Collator*.java"/>
1524 <include name="com/ibm/icu/text/Normalizer.java"/>
1525 <include name="com/ibm/icu/text/Replaceable.java"/>
1526 <include name="com/ibm/icu/text/ReplaceableString.java"/>
1527 <include name="com/ibm/icu/text/UnicodeFilter.java"/>
1528 <include name="com/ibm/icu/text/UnicodeSetIterator.java"/>
1529 <include name="com/ibm/icu/text/UTF16.java"/>
1530 </javac>
1531
1532 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1533 <patternset>
1534 <include name="**/*.icu"/>
1535 <include name="**/coll/*.res"/>
1536 <include name="**/*.brk"/>
1537 <include name="**/*.nrm"/>
1538 <include name="**/icudt${icu4j.data.version}b/res_index.res"/>
1539 <include name="**/keyTypeData.res"/>
1540 </patternset>
1541 </unjar>
1542 </target>
1543
1544 <target name="collatorTests" depends="collator" description="Modular build of collator test suite">
1545 <mkdir dir="${module.tests.dir}"/>
1546 <javac destdir="${module.tests.dir}"
1547 source="${javac.source}"
1548 target="${javac.target}"
1549 encoding="${java.src.encoding}"
1550 classpath="${module.bin.dir}"
1551 debug="on" deprecation="off">
1552 <src path="${icu4j.core.dir}/src"/>
1553 <src path="${icu4j.test-framework.dir}/src"/>
1554 <src path="${icu4j.collate-tests.dir}/src"/>
1555 <src path="${icu4j.testall.dir}/src"/>
1556
1557 <patternset refid="common.test.sources"/>
1558 <include name="com/ibm/icu/dev/test/TestAllCollate.java"/>
1559 <include name="com/ibm/icu/dev/test/collator/**/*.java"/>
1560 <include name="java,com/ibm/icu/dev/test/search/**/*.java"/>
1561 <exclude name="com/ibm/icu/dev/test/collator/AlphabeticIndexTest.java"/>
1562 <exclude name="com/ibm/icu/dev/test/collator/RandomCollator.java"/>
1563 <exclude name="com/ibm/icu/dev/test/collator/IndexCharactersTest.java"/>
1564 </javac>
1565
1566 <copy todir="${module.tests.dir}">
1567 <fileset dir="${icu4j.collate-tests.dir}/src">
1568 <include name="com/ibm/icu/dev/data/*.txt"/>
1569 </fileset>
1570 </copy>
1571 </target>
1572
1573 <!-- Compression -->
1574 <target name="compression" description="Modular build of compression services">
1575 <mkdir dir="${module.bin.dir}"/>
1576 <javac srcdir="${icu4j.core.dir}/src"
1577 destdir="${module.bin.dir}"
1578 source="${javac.source}"
1579 target="${javac.target}"
1580 encoding="${java.src.encoding}"
1581 debug="on" deprecation="off">
1582 <include name="com/ibm/icu/text/SCSU.java"/>
1583 <include name="com/ibm/icu/text/UnicodeCompressor.java"/>
1584 <include name="com/ibm/icu/text/UnicodeDecompressor.java"/>
1585 </javac>
1586 </target>
1587
1588 <target name="compressionTests" depends="compression" description="Modular build of compression test suite">
1589 <mkdir dir="${module.tests.dir}"/>
1590 <javac destdir="${module.tests.dir}"
1591 source="${javac.source}"
1592 target="${javac.target}"
1593 encoding="${java.src.encoding}"
1594 classpath="${module.bin.dir}"
1595 debug="on" deprecation="off">
1596 <src path="${icu4j.core.dir}/src"/>
1597 <src path="${icu4j.test-framework.dir}/src"/>
1598 <src path="${icu4j.core-tests.dir}/src"/>
1599 <src path="${icu4j.testall.dir}/src"/>
1600
1601 <patternset refid="common.test.sources"/>
1602 <include name="com/ibm/icu/dev/test/compression/**/*.java"/>
1603 </javac>
1604 </target>
1605
1606 <!-- Format -->
1607 <target name="format" description="Modular build of format services">
1608 <mkdir dir="${module.bin.dir}"/>
1609 <javac srcdir="${icu4j.core.dir}/src"
1610 destdir="${module.bin.dir}"
1611 source="${javac.source}"
1612 target="${javac.target}"
1613 encoding="${java.src.encoding}"
1614 debug="on" deprecation="off">
1615 <include name="com/ibm/icu/impl/LocaleDisplayNamesImpl.java"/>
1616 <include name="com/ibm/icu/impl/TimeZoneNames*.java"/>
1617 <include name="com/ibm/icu/lang/UCharacter.java"/>
1618 <include name="com/ibm/icu/text/BreakIteratorFactory.java"/>
1619 <include name="com/ibm/icu/text/*Collator*.java"/>
1620 <include name="com/ibm/icu/text/*Format*.java"/>
1621 <include name="com/ibm/icu/text/UnicodeSetIterator.java"/>
1622 <include name="com/ibm/icu/util/CalendarServiceShim.java"/>
1623 </javac>
1624
1625 <javac srcdir="${icu4j.regiondata.dir}/src"
1626 destdir="${module.bin.dir}"
1627 source="${javac.source}"
1628 target="${javac.target}"
1629 encoding="${java.src.encoding}"
1630 debug="on" deprecation="off"/>
1631
1632 <javac srcdir="${icu4j.currdata.dir}/src"
1633 destdir="${module.bin.dir}"
1634 source="${javac.source}"
1635 target="${javac.target}"
1636 encoding="${java.src.encoding}"
1637 debug="on" deprecation="off"/>
1638
1639 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1640 <patternset>
1641 <include name="**/*.icu"/>
1642 <include name="**/*.brk"/>
1643 <include name="**/*.res"/>
1644 <exclude name="**/translit/*.res"/>
1645 </patternset>
1646 </unjar>
1647 <unjar src="${icu4j.tzdata.jar}" dest="${module.bin.dir}">
1648 <patternset>
1649 <include name="**/*.res" />
1650 </patternset>
1651 </unjar>
1652 </target>
1653
1654 <target name="formatTests" depends="format" description="Modular build of format test suite">
1655 <mkdir dir="${module.tests.dir}"/>
1656 <javac destdir="${module.tests.dir}"
1657 source="${javac.source}"
1658 target="${javac.target}"
1659 encoding="${java.src.encoding}"
1660 classpath="${module.bin.dir}"
1661 debug="on" deprecation="off">
1662 <src path="${icu4j.core.dir}/src"/>
1663 <src path="${icu4j.test-framework.dir}/src"/>
1664 <src path="${icu4j.core-tests.dir}/src"/>
1665 <src path="${icu4j.testall.dir}/src"/>
1666
1667 <patternset refid="common.test.sources"/>
1668 <include name="com/ibm/icu/dev/test/format/**/*.java"/>
1669 <exclude name="com/ibm/icu/dev/test/format/GlobalizationPreferencesTest.java"/>
1670 </javac>
1671
1672 <unjar src="${icu4j.testdata.jar}" dest="${module.tests.dir}">
1673 <patternset>
1674 <include name="**/format.res"/>
1675 </patternset>
1676 </unjar>
1677
1678 <copy file="${icu4j.core-tests.dir}/src/com/ibm/icu/dev/test/format/NumberFormatTestCases.txt"
1679 todir="${module.tests.dir}/com/ibm/icu/dev/test/format"/>
1680
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +02001681 <copy file="${icu4j.core-tests.dir}/src/com/ibm/icu/dev/data/numberformattestspecification.txt"
1682 todir="${module.tests.dir}/com/ibm/icu/dev/data"/>
1683
Fredrik Roubert7935b182014-11-18 20:21:54 -08001684 </target>
1685
1686 <!-- Normalizer -->
1687 <target name="normalizer" description="Modular build of normalizer services">
1688 <mkdir dir="${module.bin.dir}"/>
1689 <javac srcdir="${icu4j.core.dir}/src"
1690 destdir="${module.bin.dir}"
1691 source="${javac.source}"
1692 target="${javac.target}"
1693 encoding="${java.src.encoding}"
1694 debug="on" deprecation="off">
1695 <include name="com/ibm/icu/lang/**/*"/>
1696 <include name="com/ibm/icu/text/CanonicalIterator.java"/>
1697 <include name="com/ibm/icu/text/Normalizer.java"/>
1698 <include name="com/ibm/icu/text/Replaceable.java"/>
1699 <include name="com/ibm/icu/text/ReplaceableString.java"/>
1700 <include name="com/ibm/icu/text/UCharacterIterator.java"/>
1701 <include name="com/ibm/icu/text/UForwardCharacterIterator.java"/>
1702 <include name="com/ibm/icu/text/UnicodeFilter.java"/>
1703 <include name="com/ibm/icu/text/UnicodeSetIterator.java"/>
1704 <include name="com/ibm/icu/text/UTF16.java"/>
1705 </javac>
1706
1707 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1708 <patternset>
1709 <include name="**/ubidi.icu"/>
1710 <include name="**/ucase.icu"/>
1711 <include name="**/unorm.icu"/>
1712 <include name="**/uprops.icu"/>
1713 <include name="**/pnames.icu"/>
1714 <include name="**/unames.icu"/>
1715 <include name="**/*.nrm"/>
1716 </patternset>
1717 </unjar>
1718 </target>
1719
1720 <target name="normalizerTests" depends="normalizer" description="Modular build of normalizer test suite">
1721 <mkdir dir="${module.tests.dir}"/>
1722 <javac destdir="${module.tests.dir}"
1723 source="${javac.source}"
1724 target="${javac.target}"
1725 encoding="${java.src.encoding}"
1726 classpath="${module.bin.dir}"
1727 debug="on" deprecation="off">
1728 <src path="${icu4j.core.dir}/src"/>
1729 <src path="${icu4j.test-framework.dir}/src"/>
1730 <src path="${icu4j.core-tests.dir}/src"/>
1731 <src path="${icu4j.testall.dir}/src"/>
1732
1733 <patternset refid="common.test.sources"/>
1734 <include name="com/ibm/icu/dev/test/normalizer/**/*.java"/>
1735 <exclude name="com/ibm/icu/dev/test/normalizer/TestDeprecatedNormalizerAPI.java"/>
1736 </javac>
1737
1738 <copy todir="${module.tests.dir}">
1739 <fileset dir="${icu4j.core-tests.dir}/src">
1740 <include name="com/ibm/icu/dev/data/unicode/*.txt"/>
1741 </fileset>
1742 </copy>
1743
1744 <unjar src="${icu4j.testdata.jar}" dest="${module.tests.dir}">
1745 <patternset>
1746 <include name="**/testnorm.nrm"/>
1747 </patternset>
1748 </unjar>
1749
1750 </target>
1751
1752 <!-- Character Properties -->
1753 <target name="_copyBasicPropsData">
1754 <mkdir dir="${module.bin.dir}"/>
1755 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1756 <patternset>
1757 <include name="**/unorm.icu"/>
1758 <include name="**/uprops.icu"/>
1759 <include name="**/ubidi.icu"/>
1760 <include name="**/ucase.icu"/>
1761 <include name="**/pnames.icu"/>
1762 <include name="**/unames.icu"/>
1763 <include name="**/*.nrm"/>
1764 </patternset>
1765 </unjar>
1766 </target>
1767
1768 <target name="_copyFullPropsData">
1769 <mkdir dir="${module.bin.dir}"/>
1770 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1771 <patternset>
1772 <include name="**/unorm.icu"/>
1773 <include name="**/uprops.icu"/>
1774 <include name="**/ubidi.icu"/>
1775 <include name="**/ucase.icu"/>
1776 <include name="**/unames.icu"/>
1777 <include name="**/pnames.icu"/>
1778 <include name="**/*.res"/>
1779 <include name="**/*.brk"/>
1780 <include name="**/*.dict"/>
1781 <include name="**/*.nrm"/>
1782 <exclude name="**/coll/*.res"/>
1783 <exclude name="**/translit/*.res"/>
1784 <exclude name="**/rbnf/*.res"/>
1785 </patternset>
1786 </unjar>
1787 <unjar src="${icu4j.tzdata.jar}" dest="${module.bin.dir}">
1788 <patternset>
1789 <include name="**/*.res" />
1790 </patternset>
1791 </unjar>
1792 </target>
1793
1794 <target name="_propertiesClasses">
1795 <mkdir dir="${module.bin.dir}"/>
1796 <javac srcdir="${icu4j.core.dir}/src"
1797 destdir="${module.bin.dir}"
1798 source="${javac.source}"
1799 target="${javac.target}"
1800 encoding="${java.src.encoding}"
1801 debug="on" deprecation="off">
1802 <include name="com/ibm/icu/impl/data/*Break*.java"/>
1803 <include name="com/ibm/icu/lang/**/*"/>
1804 <include name="com/ibm/icu/text/*BreakDictionary*.java"/>
1805 <include name="com/ibm/icu/text/*BreakIterator*.java"/>
1806 <include name="com/ibm/icu/text/UnicodeSetIterator.java"/>
1807 </javac>
1808 </target>
1809
1810 <target name="_propertiesTests">
1811 <mkdir dir="${module.tests.dir}"/>
1812 <javac destdir="${module.tests.dir}"
1813 source="${javac.source}"
1814 target="${javac.target}"
1815 encoding="${java.src.encoding}"
1816 classpath="${module.bin.dir}"
1817 debug="on" deprecation="off">
1818 <src path="${icu4j.core.dir}/src"/>
1819 <src path="${icu4j.test-framework.dir}/src"/>
1820 <src path="${icu4j.core-tests.dir}/src"/>
1821 <src path="${icu4j.testall.dir}/src"/>
1822
1823 <patternset refid="common.test.sources"/>
1824 <include name="com/ibm/icu/dev/test/lang/**/*.java"/>
1825 <exclude name="com/ibm/icu/dev/test/lang/TestUScriptRun.java"/>
1826 </javac>
1827
1828 <copy todir="${module.tests.dir}">
1829 <fileset dir="${icu4j.core-tests.dir}/src">
1830 <include name="com/ibm/icu/dev/data/unicode/SpecialCasing.txt"/>
1831 <include name="com/ibm/icu/dev/data/unicode/UnicodeData.txt"/>
1832 </fileset>
1833 </copy>
1834 </target>
1835
1836 <target name="propertiesBasic" depends="_propertiesClasses, _copyBasicPropsData" description="Modular build of basic character properties"/>
1837
1838 <target name="propertiesBasicTests" depends="propertiesBasic, _propertiesTests" description="Modular build of basic character properties test suite"/>
1839
1840 <target name="propertiesFull" depends="_propertiesClasses, _copyFullPropsData" description="Modular build of full character properties"/>
1841
1842 <target name="propertiesFullTests" depends="propertiesFull, _propertiesTests" description="Modular build of full character properties test suite"/>
1843
1844 <!-- Transliterator -->
1845 <!-- this module will soon be obsolete, use the translit jar -->
1846 <target name="transliterator" depends="_propertiesClasses" description="Modular build of transliterator services">
1847 <mkdir dir="${module.bin.dir}"/>
1848 <javac destdir="${module.bin.dir}"
1849 source="${javac.source}"
1850 target="${javac.target}"
1851 encoding="${java.src.encoding}"
1852 debug="on" deprecation="off">
1853 <src path="${icu4j.core.dir}/src"/>
1854 <src path="${icu4j.translit.dir}/src"/>
1855
1856 <include name="com/ibm/icu/impl/*Iterator*.java"/>
1857 <include name="com/ibm/icu/impl/*Property*.java"/>
1858 <include name="com/ibm/icu/impl/data/ResourceReader.java"/>
1859 <include name="com/ibm/icu/impl/UtilityExtensions.java"/>
1860 <include name="com/ibm/icu/text/*Transliterator*.java"/>
1861 <include name="com/ibm/icu/text/UnicodeSetIterator.java"/>
1862 <include name="com/ibm/icu/text/BreakIteratorFactory.java"/>
1863 </javac>
1864
1865 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1866 <patternset>
1867 <include name="**/unorm.icu"/>
1868 <include name="**/uprops.icu"/>
1869 <include name="**/ubidi.icu"/>
1870 <include name="**/ucase.icu"/>
1871 <include name="**/unames.icu"/>
1872 <include name="**/pnames.icu"/>
1873 <include name="**/*.brk"/>
1874 <include name="**/*.dict"/>
1875 <include name="**/*.nrm"/>
1876 <include name="**/brkitr/*.res"/>
1877 <include name="**/translit/*.res"/>
1878 <include name="**/likelySubtags.res"/>
1879 </patternset>
1880 </unjar>
1881 </target>
1882
1883 <target name="transliteratorTests" depends="transliterator" description="Modular build of transliterator test suite">
1884 <mkdir dir="${module.tests.dir}"/>
1885 <javac destdir="${module.tests.dir}"
1886 source="${javac.source}"
1887 target="${javac.target}"
1888 encoding="${java.src.encoding}"
1889 classpath="${module.bin.dir}"
1890 debug="on" deprecation="off">
1891 <src path="${icu4j.core.dir}/src"/>
1892 <src path="${icu4j.test-framework.dir}/src"/>
1893 <src path="${icu4j.translit-tests.dir}/src"/>
1894 <src path="${icu4j.testall.dir}/src"/>
1895
1896 <patternset refid="common.test.sources"/>
1897 <include name="com/ibm/icu/dev/test/TestAllTranslit.java"/>
1898 <include name="com/ibm/icu/dev/test/translit/**/*.java"/>
1899 <exclude name="com/ibm/icu/dev/test/translit/UnicodeFilterLogic*.java"/>
1900 </javac>
1901
1902 <copy file="${icu4j.translit-tests.dir}/src/com/ibm/icu/dev/test/translit/langtagRegex.txt"
1903 todir="${module.tests.dir}/com/ibm/icu/dev/test/translit"/>
1904 </target>
1905
1906 <!-- StringPrep -->
1907 <target name="stringPrep" depends="normalizer" description="Modular build of stringprep services">
1908 <mkdir dir="${module.bin.dir}"/>
1909 <javac srcdir="${icu4j.core.dir}/src"
1910 destdir="${module.bin.dir}"
1911 source="${javac.source}"
1912 target="${javac.target}"
1913 encoding="${java.src.encoding}"
1914 debug="on" deprecation="off">
1915 <include name="com/ibm/icu/impl/*StringPrep*.java"/>
1916 <include name="com/ibm/icu/text/*IDNA*.java"/>
1917 <include name="com/ibm/icu/text/*StringPrep*.java"/>
1918 </javac>
1919
1920 <unjar src="${icu4j.data.jar}" dest="${module.bin.dir}">
1921 <patternset>
1922 <include name="**/*.spp"/>
1923 <include name="**/ubidi.icu"/>
1924 <include name="**/ucase.icu"/>
1925 <include name="**/unorm.icu"/>
1926 <include name="**/uprops.icu"/>
1927 <include name="**/pnames.icu"/>
1928 <include name="**/unames.icu"/>
1929 </patternset>
1930 </unjar>
1931 </target>
1932
1933 <target name="stringPrepTests" depends="stringPrep" description="Modular build of stringprep test suite">
1934 <mkdir dir="${module.tests.dir}"/>
1935 <javac destdir="${module.tests.dir}"
1936 source="${javac.source}"
1937 target="${javac.target}"
1938 encoding="${java.src.encoding}"
1939 classpath="${module.bin.dir}"
1940 debug="on" deprecation="off">
1941 <src path="${icu4j.core.dir}/src"/>
1942 <src path="${icu4j.test-framework.dir}/src"/>
1943 <src path="${icu4j.core-tests.dir}/src"/>
1944 <src path="${icu4j.testall.dir}/src"/>
1945
1946 <patternset refid="common.test.sources"/>
1947 <include name="com/ibm/icu/dev/test/stringprep/**/*.java"/>
1948 </javac>
1949
1950 <unjar src="${icu4j.testdata.jar}" dest="${module.tests.dir}">
1951 <patternset>
1952 <include name="**/*.spp"/>
1953 <include name="**/idna_rules.res"/>
1954 </patternset>
1955 </unjar>
1956
1957 <copy file="${icu4j.core-tests.dir}/src/com/ibm/icu/dev/data/IDNATestInput.txt"
1958 todir="${module.tests.dir}/com/ibm/icu/dev/data"/>
1959 </target>
1960
1961 <target name="publishToMavenRepo" depends="releaseVer">
1962 <!--
1963 Publish libraries to Maven repositories, snapshot or release depending on current
1964 version in pom.xml.
1965
1966 Prerequisites
1967
1968 1) Apache Maven Ant tasks - http://maven.apache.org/ant-tasks
1969 2) GnuPG
1970 3) Put build-local.properties to specify followings
1971
1972 maven-ant-tasks.jar = [location of maven ant tasks jar file]
1973 gpg.user = ICU Project
1974 gpg.passphrase = [passprase for ICU Project's PGP key]
1975
1976 4) Maven configuration file ~/.m2/settings.xml
1977 <settings>
1978 <servers>
1979 <server>
1980 <id>icu4j-releases</id>
1981 <username>[your JIRA/Nexus ID]</username>
1982 <password>[your JIRA/Nexus password]</password>
1983 </server>
1984 <server>
1985 <id>icu4j-snapshots</id>
1986 <username>[your JIRA/Nexus ID]</username>
1987 <password>[your JIRA/Nexus password]</password>
1988 </server>
1989 </servers>
1990 </settings>
1991
1992 Note: For now, charset.jar and localespi.jar are excluded.
1993 -->
1994 <fail message="Maven Ant Tasks are required to publish libraries. Set maven-ant-tasks.jar property. Maven Ant Tasks URL: http://maven.apache.org/ant-tasks/" unless="maven-ant-tasks.jar"/>
1995 <condition property="no_maven-ant-tasks">
1996 <available file="${maven-ant-tasks.jar}"/>
1997 </condition>
1998 <fail message="Maven Ant Tasks not found at ${maven-ant-tasks.jar}" unless="no_maven-ant-tasks"/>
1999
2000 <path id="maven-ant-tasks.classpath" path="${maven-ant-tasks.jar}"/>
2001 <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
2002 classpathref="maven-ant-tasks.classpath"/>
2003
2004 <xmlproperty file="pom.xml" prefix="pom.xml"/>
2005
2006 <!-- copy release files -->
2007 <property name="maven.release.dir" value="${release.dir}/maven"/>
2008
2009 <property name="maven.icu4j.jar.versioned.file" value="icu4j-${pom.xml.project.version}.jar"/>
2010 <property name="maven.icu4j-src.jar.versioned.file" value="icu4j-${pom.xml.project.version}-src.jar"/>
2011 <property name="maven.icu4jdocs.jar.file" value="icu4j-${pom.xml.project.version}-javadoc.jar"/>
2012
2013 <mkdir dir="${maven.release.dir}"/>
2014
2015 <copy file="${release.dir}/${icu4j.jar.versioned.file}" tofile="${maven.release.dir}/${maven.icu4j.jar.versioned.file}"/>
2016 <copy file="${release.dir}/${icu4j-src.jar.versioned.file}" tofile="${maven.release.dir}/${maven.icu4j-src.jar.versioned.file}"/>
2017 <copy file="${release.dir}/${icu4jdocs.jar.versioned.file}" tofile="${maven.release.dir}/${maven.icu4jdocs.jar.file}"/>
2018
2019 <copy file="pom.xml" todir="${maven.release.dir}"/>
2020
2021 <!-- sign release files-->
2022 <macrodef name="gpg">
2023 <attribute name="file"/>
2024 <sequential>
2025 <delete file="@{file}.asc" failonerror="false"/>
2026 <exec executable="gpg">
2027 <arg value="-u"/>
2028 <arg value="${gpg.user}"/>
2029 <arg value="-ab"/>
2030 <arg value="--passphrase"/>
2031 <arg value="${gpg.passphrase}"/>
2032 <arg value="-o"/>
2033 <arg value="@{file}.asc"/>
2034 <arg value="@{file}"/>
2035 </exec>
2036 </sequential>
2037 </macrodef>
2038
2039 <gpg file="${maven.release.dir}/${maven.icu4j.jar.versioned.file}"/>
2040 <gpg file="${maven.release.dir}/${maven.icu4j-src.jar.versioned.file}"/>
2041 <gpg file="${maven.release.dir}/${maven.icu4jdocs.jar.file}"/>
2042
2043 <gpg file="${maven.release.dir}/pom.xml"/>
2044
2045 <!-- deploy files to the repository -->
2046 <deploy xmlns="urn:maven-artifact-ant" file="${maven.release.dir}/${maven.icu4j.jar.versioned.file}">
2047 <pom file="${maven.release.dir}/pom.xml"/>
2048 <attach file="${maven.release.dir}/pom.xml.asc" type="pom.asc"/>
2049
2050 <attach file="${maven.release.dir}/${maven.icu4j.jar.versioned.file}.asc" type="jar.asc"/>
2051 <attach file="${maven.release.dir}/${maven.icu4j-src.jar.versioned.file}" classifier="sources"/>
2052 <attach file="${maven.release.dir}/${maven.icu4j-src.jar.versioned.file}.asc" classifier="sources" type="jar.asc"/>
2053 <attach file="${maven.release.dir}/${maven.icu4jdocs.jar.file}" classifier="javadoc"/>
2054 <attach file="${maven.release.dir}/${maven.icu4jdocs.jar.file}.asc" classifier="javadoc" type="jar.asc"/>
2055 </deploy>
Fredrik Roubertf716bda2015-03-18 22:28:34 +01002056
2057 <antcall target="_verify_config_for_release"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08002058 </target>
2059
2060</project>