blob: d7c2cb2cc586ce6b729bbd07058793518873063e [file] [log] [blame]
Fredrik Roubert7935b182014-11-18 20:21:54 -08001<!--
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02002* © 2016 and later: Unicode, Inc. and others.
3* License & terms of use: http://www.unicode.org/copyright.html#License
Fredrik Roubert7935b182014-11-18 20:21:54 -08004*******************************************************************************
Fredrik Roubert87255a32016-03-10 13:15:46 +01005* Copyright (C) 1997-2016, International Business Machines Corporation and *
Fredrik Roubert7935b182014-11-18 20:21:54 -08006* others. All Rights Reserved. *
7*******************************************************************************
8-->
9<project name="icu4j" default="jar" basedir="."
Fredrik Roubertfe77e722017-11-27 19:43:43 +010010 xmlns:ivy="antlib:org.apache.ivy.ant"
11 xmlns:jacoco="antlib:org.jacoco.ant">
Fredrik Roubert7935b182014-11-18 20:21:54 -080012
13 <property file="build-local.properties"/>
14 <property file="build.properties"/>
15
16 <property name="shared.dir" value="main/shared"/>
17 <import file="${shared.dir}/build/common-targets.xml"/>
18
19 <property environment="env"/>
20
21 <!-- icu4j binaries -->
22 <property name="icu4j.jar.file" value="icu4j.jar"/>
23 <property name="icu4jtests.jar.file" value="icu4jtests.jar"/>
24 <property name="icu4j-charset.jar.file" value="icu4j-charset.jar"/>
25 <property name="icu4j-localespi.jar.file" value="icu4j-localespi.jar"/>
26
27 <property name="icu4jdemos.jar.file" value="icu4jdemos.jar"/>
28
29 <!-- icu4j API doc jar file -->
30 <property name="icu4jdocs.jar.file" value="icu4j-docs.jar"/>
31
32 <!-- icu4j src jar files -->
33 <property name="icu4j-src.jar.file" value="icu4j-src.jar"/>
34 <property name="icu4j-charset-src.jar.file" value="icu4j-charset-src.jar"/>
35 <property name="icu4j-localespi-src.jar.file" value="icu4j-localespi-src.jar"/>
36
37 <!-- icu4j source package archive files -->
38 <property name="icu4jsrc.zip.file" value="icu4j.zip"/>
39 <property name="icu4jsrc.tgz.file" value="icu4j.tgz"/>
40
41 <!-- icu4j versioned release files -->
42 <property name="icu4j.jar.versioned.file" value="icu4j-${release.file.ver}.jar"/>
43 <property name="icu4j-charset.jar.versioned.file" value="icu4j-charset-${release.file.ver}.jar"/>
44 <property name="icu4j-localespi.jar.versioned.file" value="icu4j-localespi-${release.file.ver}.jar"/>
45
46 <property name="icu4j-src.jar.versioned.file" value="icu4j-${release.file.ver}-src.jar"/>
47 <property name="icu4j-charset-src.jar.versioned.file" value="icu4j-charset-${release.file.ver}-src.jar"/>
48 <property name="icu4j-localespi-src.jar.versioned.file" value="icu4j-localespi-${release.file.ver}-src.jar"/>
49
50 <property name="icu4jdocs.jar.versioned.file" value="icu4j-${release.file.ver}-docs.jar"/>
51
52 <!-- <property name="icu4jsrc.zip.versioned.file" value="icu4j-${release.file.ver}.zip"/> -->
53 <property name="icu4jsrc.tgz.versioned.file" value="icu4j-${release.file.ver}.tgz"/>
54
55 <!-- API doc -->
56 <property name="icu4j.api.doc.title" value="ICU4J ${api.doc.version} API Specification"/>
57 <property name="icu4j.api.doc.window.title" value="ICU4J ${api.doc.version}"/>
58 <property name="icu4j.api.doc.header" value="ICU4J ${api.doc.version}"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +010059
Nikita Iashchenkoac597cb2018-10-17 19:47:35 -070060 <property name="icu4j.api.doc.jdk.link" value="https://docs.oracle.com/javase/8/docs/api/"/>
Fredrik Roubertd1ab31b2017-04-18 21:38:54 +020061 <property name="icu4j.api.doc.copyright.footer" value="&lt;font size=-1&gt;Copyright &#x00A9; 2016 Unicode, Inc. and others.&lt;/font&gt;"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -080062
Fredrik Roubertfe77e722017-11-27 19:43:43 +010063 <!-- API docs for maven repo -->
64 <property name="icu4jdocs.main.jar.versioned.file" value="icu4j-${release.file.ver}-docs.jar"/>
65 <property name="icu4j.main.api.doc.title" value="ICU4J (com.ibm.icu:icu4j) ${api.doc.version} API Specification"/>
66 <property name="icu4j.main.api.doc.window.title" value="ICU4J (com.ibm.icu:icu4j) ${api.doc.version}"/>
67 <property name="icu4j.main.api.doc.header" value="ICU4J (com.ibm.icu:icu4j) ${api.doc.version}"/>
68
69 <property name="icu4jdocs.charset.jar.versioned.file" value="icu4j-charset-${release.file.ver}-docs.jar"/>
70 <property name="icu4j.charset.api.doc.title" value="ICU4J Charset (com.ibm.icu:icu4j-charset) ${api.doc.version} API Specification"/>
71 <property name="icu4j.charset.api.doc.window.title" value="ICU4J Charset (com.ibm.icu:icu4j-charset) ${api.doc.version}"/>
72 <property name="icu4j.charset.api.doc.header" value="ICU4J Charset (com.ibm.icu:icu4j-charset) ${api.doc.version}"/>
73
74 <property name="icu4jdocs.localespi.jar.versioned.file" value="icu4j-localespi-${release.file.ver}-docs.jar"/>
75 <property name="icu4j.locspi.api.doc.title" value="ICU4J Locale SPI Provider (com.ibm.icu:icu4j-localespi) ${api.doc.version} API Specification"/>
76 <property name="icu4j.locspi.api.doc.window.title" value="ICU4J Locale SPI Provider (com.ibm.icu:icu4j-localespi) ${api.doc.version}"/>
77 <property name="icu4j.locspi.api.doc.header" value="ICU4J Locale SPI Provider (com.ibm.icu:icu4j-localespi) ${api.doc.version}"/>
78
79
Fredrik Roubert7935b182014-11-18 20:21:54 -080080 <!-- directories -->
81 <property name="release.dir" value="release"/>
82 <property name="doc.dir" value="doc"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +010083 <property name="maven.doc.base.dir" value="${out.dir}/mavendoc"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -080084 <property name="cldr.util.out.dir" value="${out.dir}/cldr_util"/>
85 <property name="cldr.release.dir" value="release_cldr"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +020086 <property name="external-jars" value="lib"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -080087
88 <!-- Java version check -->
Fredrik Roubertfe77e722017-11-27 19:43:43 +010089 <condition property="is.java7">
90 <matches string="${java.version}" pattern="1\.7\.\d.*"/>
91 </condition>
92
93 <condition property="is.java8">
94 <matches string="${java.version}" pattern="1\.8\.\d.*"/>
95 </condition>
96
97 <condition property="is.java9">
98 <matches string="${java.version}" pattern="9((-.|\.\d).*)?"/>
99 </condition>
100
Fredrik Roubert1ac15792018-03-26 20:56:58 +0200101 <condition property="is.java10">
102 <matches string="${java.version}" pattern="10((-.|\.\d).*)?"/>
103 </condition>
104
105 <condition property="is.java11">
106 <matches string="${java.version}" pattern="11((-.|\.\d).*)?"/>
107 </condition>
108
109 <condition property="is.java12">
110 <matches string="${java.version}" pattern="12((-.|\.\d).*)?"/>
111 </condition>
112
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100113 <condition property="is.java8.plus">
114 <or>
115 <isset property="is.java8"/>
116 <isset property="is.java9"/>
Fredrik Roubert1ac15792018-03-26 20:56:58 +0200117 <isset property="is.java10"/>
118 <isset property="is.java11"/>
119 <isset property="is.java12"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100120 </or>
121 </condition>
122
123 <condition property="is.java7.plus">
124 <or>
125 <isset property="is.java7"/>
126 <isset property="is.java8.plus"/>
127 </or>
128 </condition>
129
Fredrik Roubert7935b182014-11-18 20:21:54 -0800130 <fail message="The JDK version is too old or unknown.">
131 <condition>
132 <not>
Victor Chang4578a1c2018-10-22 04:26:58 +0100133 <isset property="is.java7.plus"/>
Fredrik Roubert87255a32016-03-10 13:15:46 +0100134 </not>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800135 </condition>
136 </fail>
137
Fredrik Roubert7935b182014-11-18 20:21:54 -0800138
139 <!-- Build environment info -->
140 <property name="env.COMPUTERNAME" value="${env.HOSTNAME}"/>
141 <target name="info" description="Display the build environment information">
142 <echo message="----- Build Environment Information -------------------"/>
143 <echo message="Java Home: ${java.home}"/>
144 <echo message="Java Version: ${java.version}"/>
145 <echo message="Ant Home: ${ant.home}"/>
146 <echo message="Ant Version: ${ant.version}"/>
147 <echo message="OS: ${os.name}"/>
148 <echo message="OS Version: ${os.version}"/>
149 <echo message="OS Arch: ${os.arch}"/>
150 <echo message="Host: ${env.COMPUTERNAME}"/>
151 <echo message="-------------------------------------------------------"/>
152 </target>
153
154 <target name="clean" description="Clean up build outputs">
155 <ant dir="${icu4j.core.dir}" target="clean" inheritAll="false"/>
156 <ant dir="${icu4j.collate.dir}" target="clean" inheritAll="false"/>
157 <ant dir="${icu4j.charset.dir}" target="clean" inheritAll="false"/>
158 <ant dir="${icu4j.currdata.dir}" target="clean" inheritAll="false"/>
159 <ant dir="${icu4j.langdata.dir}" target="clean" inheritAll="false"/>
160 <ant dir="${icu4j.localespi.dir}" target="clean" inheritAll="false"/>
161 <ant dir="${icu4j.regiondata.dir}" target="clean" inheritAll="false"/>
162 <ant dir="${icu4j.translit.dir}" target="clean" inheritAll="false"/>
163 <ant dir="${icu4j.test-framework.dir}" target="clean" inheritAll="false"/>
164 <ant dir="${icu4j.core-tests.dir}" target="clean" inheritAll="false"/>
165 <ant dir="${icu4j.collate-tests.dir}" target="clean" inheritAll="false"/>
166 <ant dir="${icu4j.charset-tests.dir}" target="clean" inheritAll="false"/>
167 <ant dir="${icu4j.localespi-tests.dir}" target="clean" inheritAll="false"/>
168 <ant dir="${icu4j.packaging-tests.dir}" target="clean" inheritAll="false"/>
169 <ant dir="${icu4j.translit-tests.dir}" target="clean" inheritAll="false"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800170 <ant dir="${icu4j.build-tools.dir}" target="clean" inheritAll="false"/>
171 <ant dir="${icu4j.tools.dir}" target="clean" inheritAll="false"/>
172 <ant dir="${icu4j.demos.dir}" target="clean" inheritAll="false"/>
173 <ant dir="${icu4j.samples.dir}" target="clean" inheritAll="false"/>
174 <ant dir="${icu4j.perf-tests.dir}" target="clean" inheritAll="false"/>
175
176 <!-- delete all .jar files root directory -->
177 <delete>
178 <fileset dir="." includes="icu4j*.jar"/>
179 </delete>
180
181 <delete dir="${release.dir}"/>
182 <delete dir="${doc.dir}"/>
183 <delete dir="${out.dir}"/>
184 <delete dir="${module.dir}"/>
185 <delete dir="${cldr.release.dir}"/>
186
187 <available file="eclipse-build" type="dir" property="eclipse-build.dir.present"/>
188 <antcall target="_clean.eclipse-build"/>
189 </target>
190
191 <target name="_clean.eclipse-build" if="eclipse-build.dir.present">
192 <ant dir="eclipse-build" target="clean" inheritAll="false"/>
193 </target>
194
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200195 <target name="ivy-clean">
196 <ivy:cleancache/>
197 </target>
198
199 <!-- Ivy Targets -->
200 <property name="ivy.install.version" value="2.1.0-rc2" />
201 <condition property="ivy.home" value="${env.IVY_HOME}">
202 <isset property="env.IVY_HOME" />
203 </condition>
204 <property name="ivy.home" value="${user.home}/.ant" />
205 <property name="ivy.jar.dir" value="${ivy.home}/lib" />
206 <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
207
208 <target name="download-ivy" unless="offline">
209 <mkdir dir="${ivy.jar.dir}"/>
210 <!-- download Ivy from web site so that it can be used even without any special installation -->
211 <get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
212 dest="${ivy.jar.file}" usetimestamp="true"/>
213 </target>
214
215 <target name="init-ivy" depends="download-ivy">
216 <!-- try to load ivy here from ivy home, in case the user has not already dropped
217 it into ant's lib dir (note that the latter copy will always take precedence).
218 We will not fail as long as local lib dir exists (it may be empty) and
219 ivy is in at least one of ant's lib dir or the local lib dir. -->
220 <path id="ivy.lib.path">
221 <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
222 </path>
223 <taskdef resource="org/apache/ivy/ant/antlib.xml"
224 uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
225 </target>
226
227 <target name="test-init-junit-dependency" depends="init-ivy">
228 <ivy:retrieve/>
229 </target>
230
231 <target name="init" depends="test-init-junit-dependency"
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100232 description="Initialize the environment for build and test. May require internet access."/>
233
234 <target name="_classifytests">
235 <condition property="testaction.run">
236 <isset property="testclass"/>
237 </condition>
238 <condition property="testaction.class">
239 <and>
240 <isset property="testclass"/>
241 <not><isset property="testnames"/></not>
242 </and>
243 </condition>
244 <condition property="testaction.tests">
245 <and>
246 <isset property="testclass"/>
247 <isset property="testnames"/>
248 </and>
249 </condition>
250 <condition property="testaction.error">
251 <and>
252 <not><isset property="testclass"/></not>
253 <isset property="testnames"/>
254 </and>
255 </condition>
256 <condition property="testaction.all">
257 <and>
258 <not><isset property="testclass"/></not>
259 <not><isset property="testnames"/></not>
260 </and>
261 </condition>
262 </target>
263
264 <target name="checkTest" depends="_classifytests, tests, runallTests, noTests" if="testaction.run" description="Run only the specified tests of the specified test class or, if no arguments are given, the standard ICU4J test suite.">
265 <sequential>
266 <delete dir="${junit.out.dir}/checkTest"/>
267 <mkdir dir="${junit.out.dir}/checkTest"/>
268
269 <junit printsummary="yes">
270 <classpath>
271 <path refid="junit.jars"/>
272 <path refid="junit.icu.jars"/>
273 </classpath>
274 <test name="${testclass}" todir="${junit.out.dir}/checkTest" outfile="checkTest" methods="${testnames}" if="testaction.tests">
275 <formatter type="xml"/>
276 </test>
277 <test name="${testclass}" todir="${junit.out.dir}/checkTest" outfile="checkTest" if="testaction.class">
278 <formatter type="xml"/>
279 </test>
280 </junit>
281
282 <junitreport todir="${junit.out.dir}/checkTest">
283 <fileset dir="${junit.out.dir}/checkTest">
284 <include name="checkTest.xml"/>
285 </fileset>
286 <report format="frames" todir="${junit.out.dir}/checkTest/html"/>
287 </junitreport>
288
289 <fail message="test failed: @{testdir}" if="@{failure-status}" />
290 </sequential>
291 </target>
292
293 <target name="runallTests" if="testaction.all">
294 <antcall target="allTests"/>
295 </target>
296
297 <target name="allTests" depends="check"/>
298
299 <target name="noTests" if="testaction.error">
300 <echo>Execute JUnit testing using -Dtestclass='class-name' -Dtestnames='test-name1>, test-name2, ...'</echo>
301 </target>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200302
303 <!-- Junit Targets -->
304 <macrodef name="icu-junit">
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100305 <attribute name="test-name"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200306 <attribute name="jvm-options" default=""/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200307 <attribute name="classpath" default="junit.icu.jars"/>
308 <attribute name="failure-status" default="ignore"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100309 <element name="junit-fileset"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200310 <element name="junit-parameters" optional="true"/>
311 <sequential>
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100312 <echo message="@{jvm-options}"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200313 <!--set the property - if it was set before it won't override-->
314 <property name="user-jvm-options" value=""/>
315 <property name="internal-jvm-options" value=""/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100316 <delete dir="${junit.out.dir}/@{test-name}"/>
317 <mkdir dir="${junit.out.dir}/@{test-name}"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200318
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100319 <junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="no"
320 failureproperty="@{failure-status}" tempdir="${junit.out.dir}">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200321 <jvmarg value="-Xss4m"/>
322 <jvmarg value="-ea"/>
323 <jvmarg value="-Djava.awt.headless=true"/>
324 <jvmarg line="${user-jvm-options}"/>
325 <jvmarg line="@{jvm-options}"/>
326 <jvmarg line="${internal-jvm-options}"/>
327 <junit-parameters/>
328 <classpath>
329 <path refid="junit.jars"/>
330 <path refid="@{classpath}"/>
331 </classpath>
332 <formatter type="plain"/>
333 <formatter type="xml"/>
334
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100335 <batchtest todir="${junit.out.dir}/@{test-name}">
336 <junit-fileset/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200337 </batchtest>
338 </junit>
339
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100340 <junitreport tofile="@{test-name}-TestSuite.xml" todir="${junit.out.dir}/@{test-name}">
341 <fileset dir="${junit.out.dir}/@{test-name}">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200342 <include name="*.xml"/>
343 </fileset>
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100344 <report format="frames" todir="${junit.out.dir}/@{test-name}/html"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200345 </junitreport>
346
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100347 <fail message="test failed: @{test-name}" if="@{failure-status}" />
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200348
349 </sequential>
350 </macrodef>
351
352 <property name="junit.out.dir" value="${out.dir}/junit-results"/>
353 <property name="junit.core.jar" value="${external-jars}/junit-4.12.jar"/>
354 <property name="junit.hamcrest.jar" value="${external-jars}/hamcrest-core-1.3.jar"/>
355 <property name="junit.junitparams.jar" value="${external-jars}/JUnitParams-1.0.5.jar"/>
356 <path id="junit.jars">
357 <pathelement path="${junit.core.jar}"/>
358 <pathelement path="${junit.hamcrest.jar}"/>
359 <pathelement path="${junit.junitparams.jar}"/>
360 </path>
361
362 <path id="junit.icu.jars">
363 <pathelement location="${icu4j.core.jar}"/>
364 <pathelement location="${icu4j.collate.jar}"/>
365 <pathelement location="${icu4j.charset.jar}"/>
366 <pathelement location="${icu4j.currdata.jar}"/>
367 <pathelement location="${icu4j.langdata.jar}"/>
368 <pathelement location="${icu4j.regiondata.jar}"/>
369 <pathelement location="${icu4j.translit.jar}"/>
370 <pathelement location="${icu4j.test-framework.jar}"/>
371 <pathelement location="${icu4j.core-tests.jar}"/>
372 <pathelement location="${icu4j.collate-tests.jar}"/>
373 <pathelement location="${icu4j.charset-tests.jar}"/>
374 <pathelement location="${icu4j.translit-tests.jar}"/>
375 <pathelement location="${icu4j.localespi-tests.jar}"/>
376 <pathelement location="${icu4j.packaging-tests.jar}"/>
377 <pathelement location="${icu4j.regiondata.jar}"/>
378 </path>
379
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100380 <path id="junit.icu.release.jars">
381 <pathelement location="${icu4j.jar.file}"/>
382 <pathelement location="${icu4j.charset.jar}"/>
383 <pathelement location="${icu4jtests.jar.file}"/>
384 </path>
385
386 <path id="junit.icu.localespi-tests.jars">
387 <pathelement location="${icu4j.test-framework.jar}"/>
388 <pathelement location="${icu4j.localespi-tests.jar}"/>
389 </path>
390
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200391 <!--Class names that will be included/excluded as tests-->
392 <patternset id="test-classes-patternset">
393 <include name="**/*Test*"/>
394 <exclude name="**/*Fmwk*"/>
395 <exclude name="**/*TestUtility*"/>
Fredrik Roubertd1ab31b2017-04-18 21:38:54 +0200396 <exclude name="**/*TestHelper*"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200397 <exclude name="**/*TestCase*"/>
398 <exclude name="**/*TestData*"/>
399 <exclude name="**/*TestSample*"/>
400 <exclude name="**/*$*.class"/>
401 <exclude name="**/data/**"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100402 <exclude name="com/ibm/icu/dev/test/*"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200403 </patternset>
404
405 <!--Class names that will be included/excluded as tests for time zone check-->
406 <patternset id="timeZoneCheck-patternset">
407 <include name="**/TimeZoneFormatTest*"/>
408 <exclude name="**/*$*.class"/>
409 </patternset>
410
411 <!--Class names that will be included/excluded as tests for packaging check-->
412 <patternset id="packagingCheck-patternset">
413 <include name="**/TestLocaleNamePackaging*"/>
414 <exclude name="**/*$*.class"/>
415 </patternset>
416
417 <!--Class names that will be included/excluded as tests for locale SPI check-->
418 <patternset id="localespiCheck-patternset">
419 <include name="**/*Test*"/>
420 <exclude name="com/ibm/icu/dev/test/localespi/TestUtil.*"/>
421 <exclude name="**/*$*.class"/>
422 </patternset>
423
Fredrik Roubert7935b182014-11-18 20:21:54 -0800424 <!-- meta build targets -->
425 <target name="all" depends="info, main, tests, build-tools, tools, demos, samples, perf-tests, jar, docs" description="Build all primary targets"/>
426 <target name="main" depends="info, core, collate, charset, currdata, langdata, regiondata, translit, localespi" description="Build ICU4J runtime library classes"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200427 <target name="tests" depends="info, core-tests, charset-tests, collate-tests, packaging-tests, translit-tests, localespi-tests" description="Build ICU4J test classes"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800428
429 <target name="secure" depends="icu4jJar" description="(Deprecated)Build ICU4J API and test classes for running the ICU4J test suite with Java security manager enabled"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200430
Fredrik Roubert7935b182014-11-18 20:21:54 -0800431 <!-- Check to see if JVM_OPTIONS enviroment variable is set. This can be use to set the heap size. -->
432 <property name="env.JVM_OPTIONS" value=""/>
433 <property name="jvm_options" value="${env.JVM_OPTIONS}"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200434
435 <target name="_check">
Fredrik Roubertd1ab31b2017-04-18 21:38:54 +0200436 <parallel>
437 <antcall target="_charsetCheck"/>
438 <antcall target="_collateCheck"/>
439 <antcall target="_coreCheck"/>
440 <antcall target="_translitCheck"/>
441 </parallel>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800442 </target>
443
444 <target name="exhaustiveCheck" description="Run the standard ICU4J test suite in exhaustive mode">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200445 <antcall target="check">
446 <param name="internal-jvm-options" value="-DICU.exhaustive=10"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800447 </antcall>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200448 <fail message="test failed" if="icu-junit-failure" />
449 </target>
450
451 <target name="check" depends="main, tests" description="Run the standard ICU4J test suite">
452 <antcall target="_check"/>
453 <fail message="test failed" if="icu-junit-failure" />
454 </target>
455
456 <target name="runTest" description="Run the standard ICU4J test suite without calling any other build targets">
457 <antcall target="_check"/>
458 <fail message="test failed" if="icu-junit-failure" />
Fredrik Roubert7935b182014-11-18 20:21:54 -0800459 </target>
460
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100461 <target name="releaseJarCheck" depends="jar, icu4jtestsJar" description="Run the ICU4J test suite with ICU4J release jar files">
462 <icu-junit test-name="releaseJarCheck"
463 classpath="junit.icu.release.jars"
464 failure-status="icu-junit-failure">
465 <junit-fileset>
466 <zipfileset src="${icu4jtests.jar.file}">
467 <patternset refid="test-classes-patternset"/>
468 </zipfileset>
469 </junit-fileset>
470 </icu-junit>
471 <fail message="test failed - icu4j/icu4j-charset" if="icu-junit-failure" />
472
473 <property name="test.java.ext.dir" value="${out.dir}/localespi-ext"/>
474 <delete dir="${test.java.ext.dir}"/>
475 <mkdir dir="${test.java.ext.dir}"/>
476 <copy file="${icu4j-localespi.jar.file}" todir="${test.java.ext.dir}"/>
477 <copy file="${icu4j.jar.file}" todir="${test.java.ext.dir}"/>
478
479 <icu-junit test-name="releaseJarCheck-localespi"
480 classpath="junit.icu.localespi-tests.jars"
481 jvm-options="-Djava.ext.dirs=${test.java.ext.dir}${path.separator}${java.ext.dirs}"
482 failure-status="icu-junit-failure">
483 <junit-fileset>
484 <fileset dir="${icu4j.localespi-tests.dir}/${bin.dir}">
485 <patternset refid="localespiCheck-patternset"/>
486 </fileset>
487 </junit-fileset>
488 </icu-junit>
489 <fail message="test failed - icu4j-localespi" if="icu-junit-failure" />
490 </target>
491
492 <target name="timeZoneCheck" depends="main, tests" description="Run the complete test for TimeZoneRoundTripAll">
493 <icu-junit test-name="timeZoneCheck"
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200494 jvm-options="-DTimeZoneRoundTripAll=true"
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100495 failure-status="icu-junit-failure">
496 <junit-fileset>
497 <fileset dir="${icu4j.core-tests.dir}/${bin.dir}">
498 <patternset refid="timeZoneCheck-patternset"/>
499 </fileset>
500 </junit-fileset>
501 </icu-junit>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200502 <fail message="test failed" if="icu-junit-failure" />
Fredrik Roubert7935b182014-11-18 20:21:54 -0800503 </target>
504
505 <target name="jdktzCheck" description="Run the standard ICU4J test suite with JDK TimeZone">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200506 <antcall target="check">
507 <param name="internal-jvm-options" value="-Dcom.ibm.icu.util.TimeZone.DefaultTimeZoneType=JDK"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800508 </antcall>
509 </target>
510
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200511 <path id="junit.icu.jars.PackagingCheckNoLangData">
512 <pathelement location="${icu4j.core.jar}"/>
513 <pathelement location="${icu4j.charset.jar}"/>
514 <pathelement location="${icu4j.test-framework.jar}"/>
515 <pathelement location="${icu4j.packaging-tests.jar}"/>
516 <pathelement location="${icu4j.regiondata.jar}"/>
517 </path>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800518
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200519 <path id="junit.icu.jars.PackagingCheckNoRegionData">
520 <pathelement location="${icu4j.core.jar}"/>
521 <pathelement location="${icu4j.charset.jar}"/>
522 <pathelement location="${icu4j.test-framework.jar}"/>
523 <pathelement location="${icu4j.packaging-tests.jar}"/>
524 <pathelement location="${icu4j.langdata.jar}"/>
525 </path>
526
527 <path id="junit.icu.jars.PackagingCheckNoLangNorRegionData">
528 <pathelement location="${icu4j.core.jar}"/>
529 <pathelement location="${icu4j.charset.jar}"/>
530 <pathelement location="${icu4j.test-framework.jar}"/>
531 <pathelement location="${icu4j.packaging-tests.jar}"/>
532 </path>
533
534 <target name="_packagingCheckNoLangData">
535 <!-- region data but no language data -->
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100536 <icu-junit test-name="packaging-NoLangData"
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200537 classpath="junit.icu.jars.PackagingCheckNoLangData"
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100538 failure-status="icu-junit-failure">
539 <junit-fileset>
540 <fileset dir="${icu4j.packaging-tests.dir}/${bin.dir}">
541 <patternset refid="packagingCheck-patternset"/>
542 </fileset>
543 </junit-fileset>
544 </icu-junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800545 </target>
546
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200547 <target name="_packagingCheckNoRegionData">
548 <!-- language data but no region data -->
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100549 <icu-junit test-name="packaging-NoRegionData"
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200550 classpath="junit.icu.jars.PackagingCheckNoRegionData"
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100551 failure-status="icu-junit-failure">
552 <junit-fileset>
553 <fileset dir="${icu4j.packaging-tests.dir}/${bin.dir}">
554 <patternset refid="packagingCheck-patternset"/>
555 </fileset>
556 </junit-fileset>
557 </icu-junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800558 </target>
559
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200560 <target name="_packagingCheckNoLangNorRegionData">
561 <!-- neither region nor language data -->
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100562 <icu-junit test-name="packaging-NoLangNorRegionData"
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200563 classpath="junit.icu.jars.PackagingCheckNoLangNorRegionData"
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100564 failure-status="icu-junit-failure">
565 <junit-fileset>
566 <fileset dir="${icu4j.packaging-tests.dir}/${bin.dir}">
567 <patternset refid="packagingCheck-patternset"/>
568 </fileset>
569 </junit-fileset>
570 </icu-junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800571 </target>
572
573 <target name="packagingCheck" depends="info, core, packaging-tests" description="Run packaging tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200574 <antcall target="_packagingCheckNoLangData"/>
575 <antcall target="_packagingCheckNoRegionData"/>
576 <antcall target="_packagingCheckNoLangNorRegionData"/>
577 <fail message="test failed" if="icu-junit-failure" />
578 </target>
579
580 <target name="_coreCheck">
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100581 <icu-junit test-name="core" failure-status="icu-junit-failure">
582 <junit-fileset>
583 <fileset dir="${icu4j.core-tests.dir}/${bin.dir}">
584 <patternset refid="test-classes-patternset"/>
585 </fileset>
586 </junit-fileset>
587 </icu-junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800588 </target>
589
590 <target name="coreCheck" depends="info, core, currdata, langdata, regiondata, core-tests" description="Run only the core tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200591 <antcall target="_coreCheck"/>
592 <fail message="test failed" if="icu-junit-failure" />
593 </target>
594
595 <target name="_charsetCheck">
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100596 <icu-junit test-name="charset" failure-status="icu-junit-failure">
597 <junit-fileset>
598 <fileset dir="${icu4j.charset-tests.dir}/${bin.dir}">
599 <patternset refid="test-classes-patternset"/>
600 </fileset>
601 </junit-fileset>
602 </icu-junit>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200603 </target>
604
605 <target name="charsetCheck" depends="info, core, charset, currdata, langdata, regiondata, core-tests, charset-tests" description="Run only the charset tests">
606 <antcall target="_charsetCheck"/>
607 <fail message="test failed" if="icu-junit-failure" />
608 </target>
609
610 <target name="_collateCheck">
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100611 <icu-junit test-name="collate" failure-status="icu-junit-failure">
612 <junit-fileset>
613 <fileset dir="${icu4j.collate-tests.dir}/${bin.dir}">
614 <patternset refid="test-classes-patternset"/>
615 </fileset>
616 </junit-fileset>
617 </icu-junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800618 </target>
619
620 <target name="collateCheck" depends="info, core, collate, currdata, langdata, regiondata, core-tests, collate-tests" description="Run only the collation tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200621 <antcall target="_collateCheck"/>
622 <fail message="test failed" if="icu-junit-failure" />
623 </target>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800624
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200625 <target name="_translitCheck">
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100626 <icu-junit test-name="translit" failure-status="icu-junit-failure">
627 <junit-fileset>
628 <fileset dir="${icu4j.translit-tests.dir}/${bin.dir}">
629 <patternset refid="test-classes-patternset"/>
630 </fileset>
631 </junit-fileset>
632 </icu-junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800633 </target>
634
635 <target name="translitCheck" depends="info, core, translit, translit-tests" description="Run the ICU4J Translit test suite">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200636 <antcall target="_translitCheck"/>
637 <fail message="test failed" if="icu-junit-failure" />
Fredrik Roubert7935b182014-11-18 20:21:54 -0800638 </target>
639
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200640 <target name="_localespiCheck">
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100641 <icu-junit test-name="localespi"
642 classpath="junit.icu.localespi-tests.jars"
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200643 jvm-options="-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 Roubertfe77e722017-11-27 19:43:43 +0100644 failure-status="icu-junit-failure">
645 <junit-fileset>
646 <fileset dir="${icu4j.localespi-tests.dir}/${bin.dir}">
647 <patternset refid="localespiCheck-patternset"/>
648 </fileset>
649 </junit-fileset>
650 </icu-junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800651 </target>
652
Victor Chang4578a1c2018-10-22 04:26:58 +0100653 <target name="localespiCheck" depends="info, localespi, localespi-tests" description="Run the ICU4J Locale SPI test suite">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200654 <antcall target="_localespiCheck"/>
655 <fail message="test failed" if="icu-junit-failure" />
Fredrik Roubert7935b182014-11-18 20:21:54 -0800656 </target>
657
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100658 <target name="secureCheck" depends="jar, icu4jtestsJar" description="Run the ICU4J test suite with Java security manager enabled">
659 <icu-junit test-name="secureCheck"
660 classpath="junit.icu.release.jars"
661 jvm-options="-Djava.security.manager -Djava.security.policy=${user.dir}/${shared.dir}/data/security.policy"
662 failure-status="icu-junit-failure">
663 <junit-fileset>
664 <zipfileset src="${icu4jtests.jar.file}">
665 <patternset refid="test-classes-patternset"/>
666 </zipfileset>
667 </junit-fileset>
668 </icu-junit>
669 <fail message="test failed" if="icu-junit-failure" />
Fredrik Roubert7935b182014-11-18 20:21:54 -0800670 </target>
671
672 <!-- jar targets -->
673 <target name="jar" depends="icu4jJar, charset, localespi" description="Build ICU4J runtime library jar files">
674 <copy file="${icu4j.charset.jar}" tofile="${icu4j-charset.jar.file}"/>
675 <copy file="${icu4j.localespi.jar}" tofile="${icu4j-localespi.jar.file}" failonerror="false"/>
676 </target>
677
678 <target name="icu4jJar" depends="info, core, collate, currdata, langdata, regiondata, translit" description="Build ICU4J all-in-one core jar">
679 <mkdir dir="${out.dir}"/>
680
681 <!-- manifest -->
682 <copy file="manifest.stub" todir="${out.dir}">
683 <filterset>
684 <filter token="SPECVERSION" value="${jar.spec.version}"/>
685 <filter token="IMPLVERSION" value="${jar.impl.version}"/>
686 <filter token="COPYRIGHT" value="${jar.copyright.info}"/>
687 <filter token="EXECENV" value="${jar.exec.env}"/>
688 </filterset>
689 </copy>
690
691 <!-- jar -->
692 <jar jarfile="${icu4j.jar.file}"
693 compress="true"
694 manifest="${out.dir}/manifest.stub">
695 <fileset dir="${icu4j.core.dir}/${bin.dir}" includes="**/*"/>
696 <fileset dir="${icu4j.collate.dir}/${bin.dir}" includes="**/*"/>
697 <fileset dir="${icu4j.currdata.dir}/${bin.dir}" includes="**/*"/>
698 <fileset dir="${icu4j.langdata.dir}/${bin.dir}" includes="**/*"/>
699 <fileset dir="${icu4j.regiondata.dir}/${bin.dir}" includes="**/*"/>
700 <fileset dir="${icu4j.translit.dir}/${bin.dir}" includes="**/*"/>
701 <fileset dir="${shared.dir}/licenses">
Fredrik Roubert87255a32016-03-10 13:15:46 +0100702 <include name="LICENSE"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800703 </fileset>
704 </jar>
705 </target>
706
707 <target name="icu4jSrcJar" description="Build icu4j-src.jar">
708 <jar jarfile="${icu4j-src.jar.file}"
709 compress="true">
710 <fileset dir="${icu4j.core.dir}/${src.dir}" includes="**/*.java"/>
711 <fileset dir="${icu4j.collate.dir}/${src.dir}" includes="**/*.java"/>
712 <fileset dir="${icu4j.currdata.dir}/${src.dir}" includes="**/*.java"/>
713 <fileset dir="${icu4j.langdata.dir}/${src.dir}" includes="**/*.java"/>
714 <fileset dir="${icu4j.regiondata.dir}/${src.dir}" includes="**/*.java"/>
715 <fileset dir="${icu4j.translit.dir}/${src.dir}" includes="**/*.java"/>
716 <fileset dir="${shared.dir}/licenses">
Fredrik Roubert87255a32016-03-10 13:15:46 +0100717 <include name="LICENSE"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800718 </fileset>
719 </jar>
720 </target>
721
722 <target name="icu4jtestsJar" depends="info, tests" description="Build ICU4J all-in-one test jar">
723 <jar jarfile="${icu4jtests.jar.file}"
724 compress="true">
725 <fileset dir="${icu4j.test-framework.dir}/${bin.dir}" includes="**/*"/>
726 <fileset dir="${icu4j.core-tests.dir}/${bin.dir}" includes="**/*"/>
727 <fileset dir="${icu4j.collate-tests.dir}/${bin.dir}" includes="**/*"/>
728 <fileset dir="${icu4j.translit-tests.dir}/${bin.dir}" includes="**/*"/>
729 <fileset dir="${icu4j.charset-tests.dir}/${bin.dir}" includes="**/*"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800730 </jar>
731 </target>
732
733 <target name="jarDemos" depends="icu4jJar, demos" description="Build ICU4J demo jar file">
734 <copy file="${icu4j.demos.jar}" tofile="${icu4jdemos.jar.file}"/>
735 </target>
736
737
738 <!-- release targets -->
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200739 <target name="_check_config_for_release" depends="_checkJCite">
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100740 <condition property="release.build.config.ok">
741 <and>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200742 <isset property="is.java8"/>
Victor Chang4578a1c2018-10-22 04:26:58 +0100743 <isset property="java7.bootclasspath"/>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100744 <isset property="jcite.libs"/>
745 </and>
746 </condition>
747 </target>
748
749 <target name="_verify_config_for_release" depends="_check_config_for_release" unless="release.build.config.ok">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +0200750 <condition property="disp.is.java8" value="${java.version}" else="${java.version} - Must be 1.8!">
751 <isset property="is.java8"/>
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +0200752 </condition>
Victor Chang4578a1c2018-10-22 04:26:58 +0100753 <condition property="disp.java7.bootclasspath" value="${java7.bootclasspath}" else="Not Defined!">
754 <isset property="java7.bootclasspath"/>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100755 </condition>
756 <condition property="disp.jcite.libs" value="${jcite.libs}" else="Not Defined!">
757 <isset property="jcite.libs"/>
758 </condition>
759
760 <echo message="################################################################"/>
761 <echo message="[WARNING] Insufficient Build Configuration for ICU4J Release"/>
Victor Chang4578a1c2018-10-22 04:26:58 +0100762 <echo message="JDK 8 Tools: ${disp.is.java8}"/>
763 <echo message="JRE 7 System Library Path: ${disp.java7.bootclasspath}"/>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100764 <echo message="JCite Library Path: ${disp.jcite.libs}"/>
765 <echo message="################################################################"/>
766 </target>
767
Fredrik Roubertfe77e722017-11-27 19:43:43 +0100768 <target name="_final_release_check" depends="_verify_config_for_release">
769 <fail message="Insufficient Build Configuration for ICU4J Release" unless="release.build.config.ok"/>
770
771 <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"/>
772 <condition property="no_maven-ant-tasks">
773 <available file="${maven-ant-tasks.jar}"/>
774 </condition>
775 <fail message="Maven Ant Tasks not found at ${maven-ant-tasks.jar}" unless="no_maven-ant-tasks"/>
776 </target>
777
778 <!--
779 The ant target releaseFinal is used for ICU official release.
780 This target builds ICU4J library jars, source jars and API document jars.
781 Also, this target publishes ICU4J artifacts to OSSRH staging repository.
782
783 Prerequisites
784
785 1) Apache Maven Ant tasks - http://maven.apache.org/ant-tasks
786
787 Note: Apache Maven Ant tasks was already deprecated. You can still
788 download the latest version from Maven Central
789 http://central.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
790
791 TODO: Because mavne-ant-tasks was already deprecated and no longer maintained,
792 we should look for alternative solution.
793
794 2) GnuPG
795
796 3) Put build-local.properties to specify followings
797
798 maven-ant-tasks.jar = [location of maven ant tasks jar file]
799 gpg.user = ICU Project
800
801 4) Maven configuration file ~/.m2/settings.xml
802 <settings>
803 <servers>
804 <server>
805 <id>icu4j-releases</id>
806 <username>[oss.sonatype.org Nexus account ID]</username>
807 <password>[oss.sonatype.org Nexus account password]</password>
808 </server>
809 <server>
810 <id>icu4j-snapshots</id>
811 <username>[oss.sonatype.org Nexus account ID]</username>
812 <password>[oss.sonatype.org Nexus account password]</password>
813 </server>
814 </servers>
815 </settings>
816 -->
817 <target name="releaseFinal" depends="info, _final_release_check, releaseVer, docsMaven"
818 description="Build all ICU4J release files for distribution and upload them to the OSSRH staging repository">
819
820 <property name="maven.pom.dir" value="maven"/>
821 <property name="maven.icu4j.release.dir" value="${release.dir}/maven/icu4j"/>
822 <property name="maven.charset.release.dir" value="${release.dir}/maven/icu4j-charset"/>
823 <property name="maven.localespi.release.dir" value="${release.dir}/maven/icu4j-localespi"/>
824
825 <property name="maven.icu4j.jar.file" value="icu4j-${maven.pom.ver}.jar"/>
826 <property name="maven.icu4j.src.jar.file" value="icu4j-${maven.pom.ver}-sources.jar"/>
827 <property name="maven.icu4j.doc.jar.file" value="icu4j-${maven.pom.ver}-javadoc.jar"/>
828
829 <property name="maven.charset.jar.file" value="icu4j-charset-${maven.pom.ver}.jar"/>
830 <property name="maven.charset.src.jar.file" value="icu4j-charset-${maven.pom.ver}-sources.jar"/>
831 <property name="maven.charset.doc.jar.file" value="icu4j-charset-${maven.pom.ver}-javadoc.jar"/>
832
833 <property name="maven.localespi.jar.file" value="icu4j-localespi-${maven.pom.ver}.jar"/>
834 <property name="maven.localespi.src.jar.file" value="icu4j-localespi-${maven.pom.ver}-sources.jar"/>
835 <property name="maven.localespi.doc.jar.file" value="icu4j-localespi-${maven.pom.ver}-javadoc.jar"/>
836
837
838 <delete dir="${release.dir}/maven"/>
839 <mkdir dir="${maven.icu4j.release.dir}"/>
840 <mkdir dir="${maven.charset.release.dir}"/>
841 <mkdir dir="${maven.localespi.release.dir}"/>
842
843
844 <!-- copy pom.xml with version -->
845 <copy file="${maven.pom.dir}/icu4j/pom.xml" todir="${maven.icu4j.release.dir}">
846 <filterset>
847 <filter token="POMVERSION" value="${maven.pom.ver}"/>
848 </filterset>
849 </copy>
850 <copy file="${maven.pom.dir}/icu4j-charset/pom.xml" todir="${maven.charset.release.dir}">
851 <filterset>
852 <filter token="POMVERSION" value="${maven.pom.ver}"/>
853 </filterset>
854 </copy>
855 <copy file="${maven.pom.dir}/icu4j-localespi/pom.xml" todir="${maven.localespi.release.dir}">
856 <filterset>
857 <filter token="POMVERSION" value="${maven.pom.ver}"/>
858 </filterset>
859 </copy>
860
861 <!-- copy ICU release binaries and source archive to the maven release directory -->
862 <copy file="${release.dir}/${icu4j.jar.versioned.file}"
863 tofile="${maven.icu4j.release.dir}/${maven.icu4j.jar.file}"/>
864 <copy file="${release.dir}/${icu4j-charset.jar.versioned.file}"
865 tofile="${maven.charset.release.dir}/${maven.charset.jar.file}"/>
866 <copy file="${release.dir}/${icu4j-localespi.jar.versioned.file}"
867 tofile="${maven.localespi.release.dir}/${maven.localespi.jar.file}"/>
868
869 <copy file="${release.dir}/${icu4j-src.jar.versioned.file}"
870 tofile="${maven.icu4j.release.dir}/${maven.icu4j.src.jar.file}"/>
871 <copy file="${release.dir}/${icu4j-charset-src.jar.versioned.file}"
872 tofile="${maven.charset.release.dir}/${maven.charset.src.jar.file}"/>
873 <copy file="${release.dir}/${icu4j-localespi-src.jar.versioned.file}"
874 tofile="${maven.localespi.release.dir}/${maven.localespi.src.jar.file}"/>
875
876 <!-- javadoc jar for maven release -->
877 <jar jarfile="${maven.icu4j.release.dir}/${maven.icu4j.doc.jar.file}"
878 compress="true"
879 basedir="${maven.doc.base.dir}/icu4j"/>
880 <jar jarfile="${maven.charset.release.dir}/${maven.charset.doc.jar.file}"
881 compress="true"
882 basedir="${maven.doc.base.dir}/charset"/>
883 <jar jarfile="${maven.localespi.release.dir}/${maven.localespi.doc.jar.file}"
884 compress="true"
885 basedir="${maven.doc.base.dir}/localespi"/>
886
887 <!-- sign release files-->
888 <macrodef name="gpg">
889 <attribute name="file"/>
890 <sequential>
891 <delete file="@{file}.asc" failonerror="false"/>
892 <exec executable="gpg">
893 <arg value="-u"/>
894 <arg value="${gpg.user}"/>
895 <arg value="-ab"/>
896 <arg value="-o"/>
897 <arg value="@{file}.asc"/>
898 <arg value="@{file}"/>
899 </exec>
900 </sequential>
901 </macrodef>
902
903 <gpg file="${maven.icu4j.release.dir}/pom.xml"/>
904 <gpg file="${maven.icu4j.release.dir}/${maven.icu4j.jar.file}"/>
905 <gpg file="${maven.icu4j.release.dir}/${maven.icu4j.src.jar.file}"/>
906 <gpg file="${maven.icu4j.release.dir}/${maven.icu4j.doc.jar.file}"/>
907
908 <gpg file="${maven.charset.release.dir}/pom.xml"/>
909 <gpg file="${maven.charset.release.dir}/${maven.charset.jar.file}"/>
910 <gpg file="${maven.charset.release.dir}/${maven.charset.src.jar.file}"/>
911 <gpg file="${maven.charset.release.dir}/${maven.charset.doc.jar.file}"/>
912
913 <gpg file="${maven.localespi.release.dir}/pom.xml"/>
914 <gpg file="${maven.localespi.release.dir}/${maven.localespi.jar.file}"/>
915 <gpg file="${maven.localespi.release.dir}/${maven.localespi.src.jar.file}"/>
916 <gpg file="${maven.localespi.release.dir}/${maven.localespi.doc.jar.file}"/>
917
918 <!-- deploy ICU4J artifacts to the OSSRH staging repository -->
919 <path id="maven-ant-tasks.classpath" path="${maven-ant-tasks.jar}"/>
920 <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
921 classpathref="maven-ant-tasks.classpath"/>
922
923 <deploy xmlns="urn:maven-artifact-ant" file="${maven.icu4j.release.dir}/${maven.icu4j.jar.file}">
924 <pom file="${maven.icu4j.release.dir}/pom.xml"/>
925 <attach file="${maven.icu4j.release.dir}/pom.xml.asc" type="pom.asc"/>
926 <attach file="${maven.icu4j.release.dir}/${maven.icu4j.jar.file}.asc" type="jar.asc"/>
927 <attach file="${maven.icu4j.release.dir}/${maven.icu4j.src.jar.file}" classifier="sources"/>
928 <attach file="${maven.icu4j.release.dir}/${maven.icu4j.src.jar.file}.asc" classifier="sources" type="jar.asc"/>
929 <attach file="${maven.icu4j.release.dir}/${maven.icu4j.doc.jar.file}" classifier="javadoc"/>
930 <attach file="${maven.icu4j.release.dir}/${maven.icu4j.doc.jar.file}.asc" classifier="javadoc" type="jar.asc"/>
931 </deploy>
932
933 <deploy xmlns="urn:maven-artifact-ant" file="${maven.charset.release.dir}/${maven.charset.jar.file}">
934 <pom file="${maven.charset.release.dir}/pom.xml"/>
935 <attach file="${maven.charset.release.dir}/pom.xml.asc" type="pom.asc"/>
936 <attach file="${maven.charset.release.dir}/${maven.charset.jar.file}.asc" type="jar.asc"/>
937 <attach file="${maven.charset.release.dir}/${maven.charset.src.jar.file}" classifier="sources"/>
938 <attach file="${maven.charset.release.dir}/${maven.charset.src.jar.file}.asc" classifier="sources" type="jar.asc"/>
939 <attach file="${maven.charset.release.dir}/${maven.charset.doc.jar.file}" classifier="javadoc"/>
940 <attach file="${maven.charset.release.dir}/${maven.charset.doc.jar.file}.asc" classifier="javadoc" type="jar.asc"/>
941 </deploy>
942
943 <deploy xmlns="urn:maven-artifact-ant" file="${maven.localespi.release.dir}/${maven.localespi.jar.file}">
944 <pom file="${maven.localespi.release.dir}/pom.xml"/>
945 <attach file="${maven.localespi.release.dir}/pom.xml.asc" type="pom.asc"/>
946 <attach file="${maven.localespi.release.dir}/${maven.localespi.jar.file}.asc" type="jar.asc"/>
947 <attach file="${maven.localespi.release.dir}/${maven.localespi.src.jar.file}" classifier="sources"/>
948 <attach file="${maven.localespi.release.dir}/${maven.localespi.src.jar.file}.asc" classifier="sources" type="jar.asc"/>
949 <attach file="${maven.localespi.release.dir}/${maven.localespi.doc.jar.file}" classifier="javadoc"/>
950 <attach file="${maven.localespi.release.dir}/${maven.localespi.doc.jar.file}.asc" classifier="javadoc" type="jar.asc"/>
951 </deploy>
952 </target>
953
954 <target name="releaseVer" depends="info, releaseBinaries, releaseJarCheck, releaseSrcJars, releaseDocs, releaseSourceArchiveTgz"
Fredrik Roubert7935b182014-11-18 20:21:54 -0800955 description="Build all ICU4J release files for distribution with versioned file names">
956 <!-- binaries -->
957 <move file="${release.dir}/${icu4j.jar.file}" tofile="${release.dir}/${icu4j.jar.versioned.file}"/>
958 <move file="${release.dir}/${icu4j-charset.jar.file}" tofile="${release.dir}/${icu4j-charset.jar.versioned.file}"/>
959 <move file="${release.dir}/${icu4j-localespi.jar.file}" tofile="${release.dir}/${icu4j-localespi.jar.versioned.file}"/>
960
961 <!-- source jars -->
962 <move file="${release.dir}/${icu4j-src.jar.file}" tofile="${release.dir}/${icu4j-src.jar.versioned.file}"/>
963 <move file="${release.dir}/${icu4j-charset-src.jar.file}" tofile="${release.dir}/${icu4j-charset-src.jar.versioned.file}"/>
964 <move file="${release.dir}/${icu4j-localespi-src.jar.file}" tofile="${release.dir}/${icu4j-localespi-src.jar.versioned.file}"/>
965
966 <!-- docs -->
967 <move file="${release.dir}/${icu4jdocs.jar.file}" tofile="${release.dir}/${icu4jdocs.jar.versioned.file}"/>
968
969 <!-- package archive -->
970 <move file="${release.dir}/${icu4jsrc.tgz.file}" tofile="${release.dir}/${icu4jsrc.tgz.versioned.file}"/>
971
972 <!-- md5 checksum file -->
973 <mkdir dir="${out.dir}/checksum"/>
974 <delete dir="${out.dir}/checksum" includes="**/*"/>
975
976 <checksum todir="${out.dir}/checksum" format="MD5SUM">
977 <fileset dir="${release.dir}">
978 <include name="*.jar"/>
979 <include name="*.tgz"/>
980 </fileset>
981 </checksum>
982
983 <concat destfile="${release.dir}/icu4j-${release.file.ver}.md5">
984 <fileset dir="${out.dir}/checksum" includes="*"/>
985 <filterchain>
986 <fixcrlf eol="lf"/>
987 </filterchain>
988 </concat>
Fredrik Roubertf716bda2015-03-18 22:28:34 +0100989
990 <antcall target="_verify_config_for_release"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -0800991 </target>
992
993 <target name="release" depends="info, releaseBinaries, releaseSrcJars, releaseDocs, releaseSourceArchiveTgz" description="Build all ICU4J release files for distribution">
994 <mkdir dir="${out.dir}/checksum"/>
995 <delete dir="${out.dir}/checksum" includes="**/*"/>
996
997 <checksum todir="${out.dir}/checksum" format="MD5SUM">
998 <fileset dir="${release.dir}">
999 <include name="*.jar"/>
1000 <include name="*.tgz"/>
1001 </fileset>
1002 </checksum>
1003
1004 <concat destfile="${release.dir}/icu4j.md5">
1005 <fileset dir="${out.dir}/checksum" includes="*"/>
1006 <filterchain>
1007 <fixcrlf eol="lf"/>
1008 </filterchain>
1009 </concat>
Fredrik Roubertf716bda2015-03-18 22:28:34 +01001010
1011 <antcall target="_verify_config_for_release"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001012 </target>
1013
1014 <target name="releaseBinaries" depends="icu4jJar, charset, localespi" description="Build ICU4J binary files for distribution">
1015 <mkdir dir="${release.dir}"/>
1016 <copy file="${icu4j.jar.file}" tofile="${release.dir}/${icu4j.jar.file}"/>
1017 <copy file="${icu4j.charset.jar}" tofile="${release.dir}/${icu4j-charset.jar.file}"/>
1018 <copy file="${icu4j.localespi.jar}" tofile="${release.dir}/${icu4j-localespi.jar.file}"/>
1019 </target>
1020
1021 <target name="releaseSrcJars" depends="icu4jSrcJar" description="Build ICU4J src jar files for distribution">
1022 <mkdir dir="${release.dir}"/>
1023
1024 <!-- icu4j src-jar -->
1025 <copy file="${icu4j-src.jar.file}" tofile="${release.dir}/${icu4j-src.jar.file}"/>
1026
1027 <!-- charset/localespi src-jar -->
1028 <ant dir="${icu4j.charset.dir}" target="src-jar" inheritAll="false"/>
1029 <ant dir="${icu4j.localespi.dir}" target="src-jar" inheritAll="false"/>
1030
1031 <copy file="${icu4j.charset.dir}/${out.dir}/lib/${icu4j-charset-src.jar.file}" tofile="${release.dir}/${icu4j-charset-src.jar.file}"/>
1032 <copy file="${icu4j.localespi.dir}/${out.dir}/lib/${icu4j-localespi-src.jar.file}" tofile="${release.dir}/${icu4j-localespi-src.jar.file}"/>
1033 </target>
1034
1035
1036 <target name="releaseDocs" depends="docs" description="Build ICU4J API reference doc jar file for distribution">
1037 <mkdir dir="${release.dir}"/>
1038 <jar jarfile="${release.dir}/${icu4jdocs.jar.file}" compress="true" basedir="${doc.dir}"/>
1039 </target>
1040
1041 <property name="src.release.wrk.dir" value="${out.dir}/tmpsrc"/>
1042
1043 <target name="releaseSourceArchiveZip" description="Build ICU4J source release archive (.zip)">
1044 <delete dir="${src.release.wrk.dir}"/>
1045 <delete file="${icu4jsrc.zip.file}"/>
1046
1047 <mkdir dir="${src.release.wrk.dir}"/>
1048
1049 <fixcrlf srcdir="."
1050 destdir="${src.release.wrk.dir}"
1051 encoding="UTF-8"
1052 eol="crlf">
1053 <include name="demos/**/*"/>
1054 <include name="main/**/*"/>
1055 <include name="perf-tests/**/*"/>
1056 <include name="samples/**/*"/>
1057 <include name="tools/**/*"/>
1058 <include name="*.html"/>
1059 <include name="*.xml"/>
1060 <include name="*.properties"/>
1061 <include name="*.css"/>
1062 <include name="*.stub"/>
1063 <exclude name="**/out/**/*"/>
1064 <exclude name="**/*.jar"/>
1065 <exclude name="**/build-local.properties"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001066 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
1067 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
1068 <exclude name="tools/build/icu4j*.api*.gz"/>
1069 </fixcrlf>
1070
1071 <mkdir dir="${release.dir}"/>
1072 <zip destfile="${release.dir}/${icu4jsrc.zip.file}">
1073 <fileset dir="${src.release.wrk.dir}" includes="**/*"/>
1074 <fileset dir="${basedir}">
1075 <include name="main/shared/data/*.jar"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001076 <include name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
1077 <include name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
1078 <include name="tools/build/icu4j*.api*.gz"/>
1079 </fileset>
1080 </zip>
1081
1082 <delete dir="${src.release.wrk.dir}"/>
1083 </target>
1084
1085 <target name="releaseSourceArchiveTgz" description="Build ICU4J source release archive (.tgz)">
1086 <delete dir="${src.release.wrk.dir}"/>
1087 <delete file="${icu4jsrc.tgz.file}"/>
1088
1089 <mkdir dir="${src.release.wrk.dir}"/>
1090
1091 <fixcrlf srcdir="."
1092 destdir="${src.release.wrk.dir}"
1093 encoding="UTF-8"
1094 eol="lf">
1095 <include name="demos/**/*"/>
1096 <include name="main/**/*"/>
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +01001097 <include name="maven/**/*"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001098 <include name="perf-tests/**/*"/>
1099 <include name="samples/**/*"/>
1100 <include name="tools/**/*"/>
1101 <include name="*.html"/>
1102 <include name="*.xml"/>
1103 <include name="*.properties"/>
1104 <include name="*.css"/>
1105 <include name="*.stub"/>
1106 <exclude name="**/out/**/*"/>
1107 <exclude name="**/*.jar"/>
1108 <exclude name="**/build-local.properties"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001109 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
1110 <exclude name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
1111 <exclude name="tools/build/icu4j*.api*.gz"/>
1112 </fixcrlf>
1113
1114 <property name="icu4jsrc.tar" value="${out.dir}/icu4jsrc.tar"/>
1115
1116 <tar destfile="${icu4jsrc.tar}" longfile="gnu">
1117 <fileset dir="${src.release.wrk.dir}" includes="**/*"/>
1118 <fileset dir="${basedir}">
1119 <include name="main/shared/data/*.jar"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001120 <include name="main/tests/core/src/com/ibm/icu/dev/test/serializable/data/**/*.dat"/>
1121 <include name="main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.*.tri2"/>
1122 <include name="tools/build/icu4j*.api*.gz"/>
1123 </fileset>
1124 </tar>
1125
1126 <mkdir dir="${release.dir}"/>
1127 <gzip destfile="${release.dir}/${icu4jsrc.tgz.file}" src="${icu4jsrc.tar}"/>
1128
1129 <delete dir="${src.release.wrk.dir}"/>
1130 <delete file="${icu4jsrc.tar}"/>
1131 </target>
1132
1133 <!-- findbugs targets -->
1134
1135 <target name="findbugs" description="Run FindBugs on all library sub projects.">
1136 <property name="findbugs.out.dir" value="${out.dir}/findbugs"/>
1137 <mkdir dir="${findbugs.out.dir}"/>
1138
1139 <ant dir="${icu4j.core.dir}" inheritAll="false" target="findbugs"/>
1140 <copy file="${icu4j.core.dir}/${out.dir}/fb-core.html" todir="${findbugs.out.dir}"/>
1141
1142 <ant dir="${icu4j.collate.dir}" inheritAll="false" target="findbugs"/>
1143 <copy file="${icu4j.collate.dir}/${out.dir}/fb-collate.html" todir="${findbugs.out.dir}"/>
1144
1145 <ant dir="${icu4j.currdata.dir}" inheritAll="false" target="findbugs"/>
1146 <copy file="${icu4j.currdata.dir}/${out.dir}/fb-currdata.html" todir="${findbugs.out.dir}"/>
1147
1148 <ant dir="${icu4j.langdata.dir}" inheritAll="false" target="findbugs"/>
1149 <copy file="${icu4j.langdata.dir}/${out.dir}/fb-langdata.html" todir="${findbugs.out.dir}"/>
1150
1151 <ant dir="${icu4j.regiondata.dir}" inheritAll="false" target="findbugs"/>
1152 <copy file="${icu4j.regiondata.dir}/${out.dir}/fb-regiondata.html" todir="${findbugs.out.dir}"/>
1153
1154 <ant dir="${icu4j.translit.dir}" inheritAll="false" target="findbugs"/>
1155 <copy file="${icu4j.translit.dir}/${out.dir}/fb-translit.html" todir="${findbugs.out.dir}"/>
1156
1157
1158 <ant dir="${icu4j.charset.dir}" inheritAll="false" target="findbugs"/>
1159 <copy file="${icu4j.charset.dir}/${out.dir}/fb-charset.html" todir="${findbugs.out.dir}"/>
1160
1161 <ant dir="${icu4j.localespi.dir}" inheritAll="false" target="findbugs"/>
1162 <copy file="${icu4j.localespi.dir}/${out.dir}/fb-localespi.html" todir="${findbugs.out.dir}"/>
1163 </target>
1164
1165 <!-- compile targets -->
1166 <target name="core" description="Build core classes">
1167 <ant dir="${icu4j.core.dir}" inheritAll="false"/>
1168 </target>
1169
1170 <target name="collate" depends="core" description="Build collation classes">
1171 <ant dir="${icu4j.collate.dir}" inheritAll="false"/>
1172 </target>
1173
1174 <target name="charset" depends="core" description="Build charset classes">
1175 <ant dir="${icu4j.charset.dir}" inheritAll="false"/>
1176 </target>
1177
1178 <target name="currdata" depends="core" description="Build currency data classes">
1179 <ant dir="${icu4j.currdata.dir}" inheritAll="false"/>
1180 </target>
1181
1182 <target name="langdata" depends="core" description="Build language data classes">
1183 <ant dir="${icu4j.langdata.dir}" inheritAll="false"/>
1184 </target>
1185
Victor Chang4578a1c2018-10-22 04:26:58 +01001186 <target name="localespi" depends="core, collate, currdata, langdata, regiondata" description="Build Locale SPI classes">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001187 <ant dir="${icu4j.localespi.dir}" inheritAll="false"/>
1188 </target>
1189
1190 <target name="regiondata" depends="core" description="Build region data classes">
1191 <ant dir="${icu4j.regiondata.dir}" inheritAll="false"/>
1192 </target>
1193
1194 <target name="translit" depends="core" description="Build translit classes">
1195 <ant dir="${icu4j.translit.dir}" inheritAll="false"/>
1196 </target>
1197
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001198 <target name="test-framework" depends="core, init" description="Build test framework classes">
1199 <ant dir="${icu4j.test-framework.dir}" inheritAll="false">
1200 <reference refid="junit.jars"/>
1201 </ant>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001202 </target>
1203
1204 <target name="core-tests" depends="core, test-framework" description="Build core tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001205 <ant dir="${icu4j.core-tests.dir}" inheritAll="false">
1206 <reference refid="junit.jars"/>
1207 </ant>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001208 </target>
1209
1210 <target name="collate-tests" depends="collate, test-framework" description="Build core tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001211 <ant dir="${icu4j.collate-tests.dir}" inheritAll="false">
1212 <reference refid="junit.jars"/>
1213 </ant>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001214 </target>
1215
1216 <target name="charset-tests" depends="charset, test-framework" description="Build charset tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001217 <ant dir="${icu4j.charset-tests.dir}" inheritAll="false">
1218 <reference refid="junit.jars"/>
1219 </ant>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001220 </target>
1221
Victor Chang4578a1c2018-10-22 04:26:58 +01001222 <target name="localespi-tests" depends="localespi, test-framework" description="Build Locale SPI tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001223 <ant dir="${icu4j.localespi-tests.dir}" inheritAll="false">
1224 <reference refid="junit.jars"/>
1225 </ant>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001226 </target>
1227
1228 <target name="packaging-tests" depends="test-framework" description="Build packaging tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001229 <ant dir="${icu4j.packaging-tests.dir}" inheritAll="false">
1230 <reference refid="junit.jars"/>
1231 </ant>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001232 </target>
1233
1234 <target name="translit-tests" depends="translit, test-framework" description="Build translit tests">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001235 <ant dir="${icu4j.translit-tests.dir}" inheritAll="false">
1236 <reference refid="junit.jars"/>
1237 </ant>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001238 </target>
1239
1240 <target name="demos" depends="core, charset, translit" description="Build demo classes">
1241 <ant dir="${icu4j.demos.dir}" inheritAll="false"/>
1242 </target>
1243
1244 <target name="samples" depends="core, charset, collate, translit" description="Build sample classes">
1245 <ant dir="${icu4j.samples.dir}" inheritAll="false"/>
1246 </target>
1247
1248 <target name="build-tools" description="Build build-tool classes">
1249 <ant dir="${icu4j.build-tools.dir}" inheritAll="false"/>
1250 </target>
1251
1252 <target name="tools" depends="core, core-tests, collate, translit, translit-tests" description="Build tool classes">
1253 <ant dir="${icu4j.tools.dir}" inheritAll="false"/>
1254 </target>
1255
Victor Chang4578a1c2018-10-22 04:26:58 +01001256 <target name="perf-tests" depends="core, charset, collate, tools" description="Build performance test classes">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001257 <ant dir="${icu4j.perf-tests.dir}" inheritAll="false"/>
1258 </target>
1259
1260 <!-- doc targets -->
1261 <target name="docs" depends="info, build-tools, _checkJCite, _docsWithJCite, _docsWithoutJCite" description="Build API documents"/>
1262
Fredrik Roubert87255a32016-03-10 13:15:46 +01001263 <target name="docsStrict" description="Build API documents with all doclint check enabled">
1264 <condition property="doclint.option" value="-Xdoclint:all">
1265 <isset property="is.java8.plus"/>
1266 </condition>
1267 <antcall target="docs"/>
1268 </target>
1269
Fredrik Roubert7935b182014-11-18 20:21:54 -08001270 <target name="_checkJCite" if="env.JCITE_DIR">
1271 <fileset dir="${env.JCITE_DIR}" id="jcite.files">
1272 <include name="build/*.jar"/>
1273 <include name="lib/*.jar"/>
1274 </fileset>
1275 <pathconvert property="jcite.libs" refid="jcite.files"/>
1276
1277 <dirset dir="${basedir}" id="jcite.src.dirs">
1278 <include name="samples/src"/>
1279 <include name="demos/src"/>
1280 <include name="main/tests/*/src"/>
1281 </dirset>
1282 <pathconvert property="jcite.addl.src" refid="jcite.src.dirs"/>
1283 </target>
1284
1285 <target name="_docsStyleSheet">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001286 <condition property="docs.style.sheet" value="stylesheet7.css">
1287 <isset property="is.java7"/>
1288 </condition>
1289 <!-- all other cases -->
1290 <property name="docs.style.sheet" value="stylesheet8.css"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001291 </target>
1292
Fredrik Roubert87255a32016-03-10 13:15:46 +01001293 <target name="_docsLintOption" unless="doclint.options">
1294 <!-- syntax check is disabled because JCite tag name "@.jcite" is invalidated -->
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001295 <condition property="doclint.option" value="-Xdoclint:reference,html" else="">
Fredrik Roubert87255a32016-03-10 13:15:46 +01001296 <isset property="is.java8.plus"/>
1297 </condition>
Fredrik Roubertbd1cbb62015-09-28 21:14:09 +02001298 </target>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001299
Fredrik Roubert87255a32016-03-10 13:15:46 +01001300 <target name="_docsWithJCite" depends="_docsStyleSheet, _docsLintOption" if="jcite.libs">
1301 <echo message="Javadoc lint option: ${doclint.option}"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001302 <echo message="JCite library path: ${jcite.libs}"/>
1303 <echo message="JCite additional source path: ${jcite.addl.src}"/>
1304 <echo message="Custom stylesheet: ${docs.style.sheet}"/>
1305 <javadoc
1306 destdir="${doc.dir}"
1307 nodeprecatedlist="true"
1308 windowtitle="${icu4j.api.doc.window.title}"
1309 doctitle="${icu4j.api.doc.title}"
1310 header="${icu4j.api.doc.header}"
1311 encoding="${java.src.encoding}"
1312 docencoding="UTF-8"
1313 charset="UTF-8"
Fredrik Roubertd1ab31b2017-04-18 21:38:54 +02001314 bottom="${icu4j.api.doc.copyright.footer}"
Fredrik Roubert87255a32016-03-10 13:15:46 +01001315 additionalparam="${doclint.option} -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 -08001316 link="${icu4j.api.doc.jdk.link}"
Victor Chang4578a1c2018-10-22 04:26:58 +01001317 source="1.7"
Fredrik Roubert87255a32016-03-10 13:15:46 +01001318 stylesheetfile="${docs.style.sheet}"
1319 failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001320 <packageset dir="${icu4j.core.dir}/src">
1321 <include name="com/ibm/icu/lang/**"/>
1322 <include name="com/ibm/icu/math/**"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001323 <include name="com/ibm/icu/number/**"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001324 <include name="com/ibm/icu/text/**"/>
1325 <include name="com/ibm/icu/util/**"/>
1326 </packageset>
1327 <packageset dir="${icu4j.collate.dir}/src">
1328 <include name="com/ibm/icu/text/**"/>
1329 </packageset>
1330 <packageset dir="${icu4j.translit.dir}/src">
1331 <include name="com/ibm/icu/text/**"/>
1332 </packageset>
1333 <packageset dir="${icu4j.charset.dir}/src">
1334 <include name="com/ibm/icu/charset/**"/>
1335 </packageset>
1336 </javadoc>
1337 </target>
1338
Fredrik Roubert87255a32016-03-10 13:15:46 +01001339 <target name="_docsWithoutJCite" depends="_docsStyleSheet, _docsLintOption" unless="jcite.libs">
1340 <echo message="Javadoc lint option: ${doclint.option}"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001341 <javadoc
1342 destdir="${doc.dir}"
1343 nodeprecatedlist="true"
1344 windowtitle="${icu4j.api.doc.window.title}"
1345 doctitle="${icu4j.api.doc.title}"
1346 header="${icu4j.api.doc.header}"
1347 encoding="${java.src.encoding}"
1348 docencoding="UTF-8"
1349 charset="UTF-8"
Fredrik Roubertd1ab31b2017-04-18 21:38:54 +02001350 bottom="${icu4j.api.doc.copyright.footer}"
Fredrik Roubert87255a32016-03-10 13:15:46 +01001351 additionalparam="${doclint.option} -breakiterator -use -tagletpath ${icu4j.build-tools.jar} -taglet com.ibm.icu.dev.tool.docs.ICUTaglet"
Fredrik Roubert7935b182014-11-18 20:21:54 -08001352 link="${icu4j.api.doc.jdk.link}"
Victor Chang4578a1c2018-10-22 04:26:58 +01001353 source="1.7"
Fredrik Roubert87255a32016-03-10 13:15:46 +01001354 failonerror="true">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001355 <packageset dir="${icu4j.core.dir}/src">
1356 <include name="com/ibm/icu/lang/**"/>
1357 <include name="com/ibm/icu/math/**"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001358 <include name="com/ibm/icu/number/**"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001359 <include name="com/ibm/icu/text/**"/>
1360 <include name="com/ibm/icu/util/**"/>
1361 </packageset>
1362 <packageset dir="${icu4j.collate.dir}/src">
1363 <include name="com/ibm/icu/text/**"/>
1364 </packageset>
1365 <packageset dir="${icu4j.translit.dir}/src">
1366 <include name="com/ibm/icu/text/**"/>
1367 </packageset>
1368 <packageset dir="${icu4j.charset.dir}/src">
1369 <include name="com/ibm/icu/charset/**"/>
1370 </packageset>
1371 </javadoc>
1372 </target>
1373
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001374 <!-- Component document targets, only used for Maven repository releases -->
1375 <target name="docsMaven" depends="info, build-tools, _checkJCite, _docsStyleSheet, _docsLintOption, _mavenIcu4jDoc, _mavenCharsetDoc, _mavenLocalespiDoc"
1376 description="Build API docs for each ICU4J maven artifact"/>
1377
1378 <target name="_mavenIcu4jDoc">
1379 <fail message="JCite must be configured." unless="jcite.libs"/>
1380 <delete dir="${maven.doc.base.dir}/icu4j"/>
1381
1382 <echo message="Javadoc lint option: ${doclint.option}"/>
1383 <echo message="JCite library path: ${jcite.libs}"/>
1384 <echo message="JCite additional source path: ${jcite.addl.src}"/>
1385 <echo message="Custom stylesheet: ${docs.style.sheet}"/>
1386 <javadoc
1387 destdir="${maven.doc.base.dir}/icu4j"
1388 nodeprecatedlist="true"
1389 windowtitle="${icu4j.main.api.doc.window.title}"
1390 doctitle="${icu4j.main.api.doc.title}"
1391 header="${icu4j.main.api.doc.header}"
1392 encoding="${java.src.encoding}"
1393 docencoding="UTF-8"
1394 charset="UTF-8"
1395 bottom="${icu4j.api.doc.copyright.footer}"
1396 additionalparam="${doclint.option} -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"
1397 link="${icu4j.api.doc.jdk.link}"
Victor Chang4578a1c2018-10-22 04:26:58 +01001398 source="1.7"
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001399 stylesheetfile="${docs.style.sheet}"
1400 failonerror="true">
1401 <packageset dir="${icu4j.core.dir}/src">
1402 <include name="com/ibm/icu/lang/**"/>
1403 <include name="com/ibm/icu/math/**"/>
1404 <include name="com/ibm/icu/number/**"/>
1405 <include name="com/ibm/icu/text/**"/>
1406 <include name="com/ibm/icu/util/**"/>
1407 </packageset>
1408 <packageset dir="${icu4j.collate.dir}/src">
1409 <include name="com/ibm/icu/text/**"/>
1410 </packageset>
1411 <packageset dir="${icu4j.translit.dir}/src">
1412 <include name="com/ibm/icu/text/**"/>
1413 </packageset>
1414 </javadoc>
1415 </target>
1416
1417 <target name="_mavenCharsetDoc">
1418 <fail message="JCite must be configured." unless="jcite.libs"/>
1419 <delete dir="${maven.doc.base.dir}/charset"/>
1420
1421 <echo message="Javadoc lint option: ${doclint.option}"/>
1422 <echo message="JCite library path: ${jcite.libs}"/>
1423 <echo message="JCite additional source path: ${jcite.addl.src}"/>
1424 <echo message="Custom stylesheet: ${docs.style.sheet}"/>
1425 <javadoc
1426 destdir="${maven.doc.base.dir}/charset"
1427 nodeprecatedlist="true"
1428 windowtitle="${icu4j.charset.api.doc.window.title}"
1429 doctitle="${icu4j.charset.api.doc.title}"
1430 header="${icu4j.charset.api.doc.header}"
1431 encoding="${java.src.encoding}"
1432 docencoding="UTF-8"
1433 charset="UTF-8"
1434 bottom="${icu4j.api.doc.copyright.footer}"
1435 additionalparam="${doclint.option} -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"
1436 link="${icu4j.api.doc.jdk.link}"
Victor Chang4578a1c2018-10-22 04:26:58 +01001437 source="1.7"
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001438 stylesheetfile="${docs.style.sheet}"
1439 failonerror="true"
1440 classpath="${icu4j.jar.file}">
1441 <packageset dir="${icu4j.charset.dir}/src">
1442 <include name="com/ibm/icu/charset/**"/>
1443 </packageset>
1444 </javadoc>
1445 </target>
1446
1447 <target name="_mavenLocalespiDoc">
1448 <delete dir="${maven.doc.base.dir}/localespi"/>
1449
1450 <echo message="Javadoc lint option: ${doclint.option}"/>
1451 <echo message="Custom stylesheet: ${docs.style.sheet}"/>
1452 <javadoc
1453 destdir="${maven.doc.base.dir}/localespi"
1454 nodeprecatedlist="true"
1455 windowtitle="${icu4j.localespi.api.doc.window.title}"
1456 doctitle="${icu4j.localespi.api.doc.title}"
1457 header="${icu4j.localespi.api.doc.header}"
1458 encoding="${java.src.encoding}"
1459 docencoding="UTF-8"
1460 charset="UTF-8"
1461 bottom="${icu4j.api.doc.copyright.footer}"
1462 additionalparam="${doclint.option} -breakiterator -use"
1463 link="${icu4j.api.doc.jdk.link}"
Victor Chang4578a1c2018-10-22 04:26:58 +01001464 source="1.7"
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001465 failonerror="true"
1466 classpath="${icu4j.jar.file}">
1467 <packageset dir="${icu4j.localespi.dir}/src">
1468 <include name="com/ibm/icu/impl/javaspi"/>
1469 </packageset>
1470 </javadoc>
1471
1472 </target>
1473
1474
Fredrik Roubert7935b182014-11-18 20:21:54 -08001475 <!-- JaCoCo code coverage target -->
1476 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" onerror="ignore">
1477 <classpath path="${env.JACOCO_DIR}/lib/jacocoant.jar"/>
1478 </taskdef>
1479
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001480 <target name="coverageJaCoCo" depends="build-tools, jar, tests" description="Run the ICU4J unit tests and generate code coverage report">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001481 <property name="jacoco.out.dir" value="${out.dir}/jacoco"/>
1482 <property name="jacoco.exec.data.file" value="${jacoco.out.dir}/jacoco.exec"/>
1483 <property name="jacoco.report.html.zip" value="${jacoco.out.dir}/report_html.zip"/>
1484 <property name="jacoco.report.xml" value="${jacoco.out.dir}/report.xml"/>
1485 <property name="jacoco.report.csv" value="${jacoco.out.dir}/report.csv"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001486 <property name="jacoco.exclusion.txt" value="coverage-exclusion.txt"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001487
1488 <delete dir="${jacoco.out.dir}"/>
1489 <mkdir dir="${jacoco.out.dir}"/>
1490
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001491 <!-- core -->
Fredrik Roubert7935b182014-11-18 20:21:54 -08001492 <jacoco:coverage destfile="${jacoco.exec.data.file}">
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001493 <junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="no">
1494 <jvmarg value="-ea"/>
1495 <jvmarg value="-Djava.awt.headless=true"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001496 <classpath>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001497 <path refid="junit.jars"/>
1498 <path refid="junit.icu.jars"/>
1499 </classpath>
1500
1501 <batchtest todir="${junit.out.dir}/core">
1502 <fileset dir="${icu4j.core-tests.dir}/${bin.dir}">
1503 <patternset refid="test-classes-patternset"/>
1504 </fileset>
1505 </batchtest>
1506 </junit>
1507 </jacoco:coverage>
1508
1509 <!-- charset -->
1510 <jacoco:coverage destfile="${jacoco.exec.data.file}">
1511 <junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="no">
1512 <jvmarg value="-ea"/>
1513 <jvmarg value="-Djava.awt.headless=true"/>
1514 <classpath>
1515 <path refid="junit.jars"/>
1516 <path refid="junit.icu.jars"/>
1517 </classpath>
1518
1519 <batchtest todir="${junit.out.dir}/charset">
1520 <fileset dir="${icu4j.charset-tests.dir}/${bin.dir}">
1521 <patternset refid="test-classes-patternset"/>
1522 </fileset>
1523 </batchtest>
1524 </junit>
1525 </jacoco:coverage>
1526
1527 <!-- collate -->
1528 <jacoco:coverage destfile="${jacoco.exec.data.file}">
1529 <junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="no">
1530 <jvmarg value="-ea"/>
1531 <jvmarg value="-Djava.awt.headless=true"/>
1532 <classpath>
1533 <path refid="junit.jars"/>
1534 <path refid="junit.icu.jars"/>
1535 </classpath>
1536
1537 <batchtest todir="${junit.out.dir}/collate">
1538 <fileset dir="${icu4j.collate-tests.dir}/${bin.dir}">
1539 <patternset refid="test-classes-patternset"/>
1540 </fileset>
1541 </batchtest>
1542 </junit>
1543 </jacoco:coverage>
1544
1545 <!-- translit -->
1546 <jacoco:coverage destfile="${jacoco.exec.data.file}">
1547 <junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="no">
1548 <jvmarg value="-ea"/>
1549 <jvmarg value="-Djava.awt.headless=true"/>
1550 <classpath>
1551 <path refid="junit.jars"/>
1552 <path refid="junit.icu.jars"/>
1553 </classpath>
1554
1555 <batchtest todir="${junit.out.dir}/translit">
1556 <fileset dir="${icu4j.translit-tests.dir}/${bin.dir}">
1557 <patternset refid="test-classes-patternset"/>
1558 </fileset>
1559 </batchtest>
1560 </junit>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001561 </jacoco:coverage>
1562
1563 <jacoco:report>
1564 <executiondata>
1565 <file file="${jacoco.exec.data.file}"/>
1566 </executiondata>
1567
1568 <structure name="ICU4J Project">
1569 <classfiles>
1570 <fileset dir=".">
1571 <include name="${icu4j.jar.file}"/>
1572 <include name="${icu4j-charset.jar.file}"/>
1573 </fileset>
1574 </classfiles>
1575 <sourcefiles encoding="UTF-8">
1576 <fileset dir="${icu4j.core.dir}/src"/>
1577 <fileset dir="${icu4j.collate.dir}/src"/>
1578 <fileset dir="${icu4j.currdata.dir}/src"/>
1579 <fileset dir="${icu4j.langdata.dir}/src"/>
1580 <fileset dir="${icu4j.regiondata.dir}/src"/>
1581 <fileset dir="${icu4j.translit.dir}/src"/>
1582
1583 <fileset dir="${icu4j.charset.dir}/src"/>
1584 </sourcefiles>
1585 </structure>
1586
1587 <html destfile="${jacoco.report.html.zip}"/>
1588 <xml destfile="${jacoco.report.xml}"/>
1589 <csv destfile="${jacoco.report.csv}"/>
1590 </jacoco:report>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001591
1592 <java classname="com.ibm.icu.dev.tool.coverage.JacocoReportCheck" failonerror="true">
1593 <arg line="${jacoco.report.xml} ${jacoco.exclusion.txt}"/>
1594 <classpath>
1595 <pathelement location="${icu4j.build-tools.jar}"/>
1596 </classpath>
1597 </java>
1598
Fredrik Roubert7935b182014-11-18 20:21:54 -08001599 </target>
1600
Fredrik Roubert7935b182014-11-18 20:21:54 -08001601 <!-- Release management targets -->
1602 <target name="checktags" depends="info, build-tools" description="Check API tags before release">
Victor Chang4578a1c2018-10-22 04:26:58 +01001603 <javadoc source="1.7"
1604 bootclasspath="${java7.bootclasspath}"
Fredrik Roubert7935b182014-11-18 20:21:54 -08001605 encoding="${java.src.encoding}">
1606 <packageset dir="${icu4j.core.dir}/src">
1607 <include name="com/ibm/icu/lang/**"/>
1608 <include name="com/ibm/icu/math/**"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001609 <include name="com/ibm/icu/number/**"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001610 <include name="com/ibm/icu/text/**"/>
1611 <include name="com/ibm/icu/util/**"/>
1612 </packageset>
1613 <packageset dir="${icu4j.collate.dir}/src">
1614 <include name="com/ibm/icu/**"/>
1615 </packageset>
1616 <packageset dir="${icu4j.charset.dir}/src">
1617 <include name="com/ibm/icu/charset/**"/>
1618 </packageset>
1619 <doclet name="com.ibm.icu.dev.tool.docs.CheckTags" path="${icu4j.build-tools.jar}"/>
1620 </javadoc>
1621 </target>
1622
1623 <target name="gatherapi" depends="info, build-tools" description="Run API database generator tool">
1624 <mkdir dir="${out.dir}"/>
Victor Chang4578a1c2018-10-22 04:26:58 +01001625 <javadoc source="1.7"
1626 bootclasspath="${java7.bootclasspath}"
Fredrik Roubert7935b182014-11-18 20:21:54 -08001627 encoding="${java.src.encoding}">
1628 <packageset dir="${icu4j.core.dir}/src">
1629 <include name="com/ibm/icu/lang/**"/>
1630 <include name="com/ibm/icu/math/**"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001631 <include name="com/ibm/icu/number/**"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001632 <include name="com/ibm/icu/text/**"/>
1633 <include name="com/ibm/icu/util/**"/>
1634 </packageset>
1635 <packageset dir="${icu4j.collate.dir}/src">
1636 <include name="com/ibm/icu/text/**"/>
1637 <include name="com/ibm/icu/util/**"/>
1638 </packageset>
1639 <packageset dir="${icu4j.charset.dir}/src">
1640 <include name="com/ibm/icu/charset/**"/>
1641 </packageset>
1642 <packageset dir="${icu4j.translit.dir}/src">
1643 <include name="com/ibm/icu/text/**"/>
1644 </packageset>
1645 <doclet name="com.ibm.icu.dev.tool.docs.GatherAPIData" path="${icu4j.build-tools.jar}">
1646 <param name="-name" value="ICU4J ${icu4j.impl.version}"/>
1647 <param name="-output" value="${out.dir}/icu4j${api.report.version}.api3"/>
1648 <param name="-internal"/>
1649 <param name="-version"/>
1650 <param name="-gzip"/>
1651 </doclet>
1652 </javadoc>
1653 </target>
1654
1655 <target name="apireport" depends="info, gatherapi" description="Run API report generator tool">
1656 <java classname="com.ibm.icu.dev.tool.docs.ReportAPI"
1657 classpath="${icu4j.build-tools.jar}"
1658 failonerror="true">
1659 <arg value="-old:" />
1660 <arg value="${icu4j.build-tools.dir}/icu4j${api.report.prev.version}.api3.gz" />
1661 <arg value="-new:" />
1662 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1663 <arg value="-html" />
1664 <arg value="-out:" />
1665 <arg value="${out.dir}/icu4j_compare_${api.report.prev.version}_${api.report.version}.html" />
1666 </java>
1667 </target>
1668
1669 <target name="gatherapiOld" depends="info, build-tools" description="Run API database generator tool (Pre Java 5 style)">
1670 <mkdir dir="${out.dir}"/>
Victor Chang4578a1c2018-10-22 04:26:58 +01001671 <javadoc source="1.7"
1672 bootclasspath="${java7.bootclasspath}"
Fredrik Roubert7935b182014-11-18 20:21:54 -08001673 encoding="${java.src.encoding}">
1674 <packageset dir="${icu4j.core.dir}/src">
1675 <include name="com/ibm/icu/lang/**"/>
1676 <include name="com/ibm/icu/math/**"/>
Fredrik Roubertfe77e722017-11-27 19:43:43 +01001677 <include name="com/ibm/icu/number/**"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001678 <include name="com/ibm/icu/text/**"/>
1679 <include name="com/ibm/icu/util/**"/>
1680 </packageset>
1681 <packageset dir="${icu4j.collate.dir}/src">
1682 <include name="com/ibm/icu/text/**"/>
1683 <include name="com/ibm/icu/util/**"/>
1684 </packageset>
1685 <packageset dir="${icu4j.charset.dir}/src">
1686 <include name="com/ibm/icu/charset/**"/>
1687 </packageset>
1688 <packageset dir="${icu4j.translit.dir}/src">
1689 <include name="com/ibm/icu/text/**"/>
1690 </packageset>
1691 <doclet name="com.ibm.icu.dev.tool.docs.GatherAPIDataOld" path="${icu4j.build-tools.jar}">
1692 <param name="-name" value="ICU4J ${icu4j.impl.version}"/>
1693 <param name="-output" value="${out.dir}/icu4j${api.report.version}.api"/>
1694 <param name="-internal"/>
1695 <param name="-gzip"/>
1696 </doclet>
1697 </javadoc>
1698 </target>
1699
1700 <target name="apireportOld" depends="info, gatherapiOld" description="Run API report generator tool (Pre Java 5 Style)">
1701 <java classname="com.ibm.icu.dev.tool.docs.ReportAPI"
1702 classpath="${icu4j.build-tools.jar}"
1703 failonerror="true">
1704 <arg value="-old:" />
1705 <arg value="${icu4j.build-tools.dir}/icu4j${api.report.prev.version}.api.gz" />
1706 <arg value="-new:" />
1707 <arg value="${out.dir}/icu4j${api.report.version}.api.gz" />
1708 <arg value="-html" />
1709 <arg value="-internal" />
1710 <arg value="-out:" />
1711 <arg value="${out.dir}/icu4j_compare_${api.report.prev.version}_${api.report.version}.html" />
1712 </java>
1713 </target>
1714
1715 <target name="checkDeprecated" depends="info, build-tools, gatherapi, main"
1716 description="Check consistency between javadoc @deprecated and @Deprecated annotation">
1717 <java classname="com.ibm.icu.dev.tool.docs.DeprecatedAPIChecker"
1718 failonerror="true">
1719 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1720 <classpath>
1721 <pathelement location="${icu4j.build-tools.jar}"/>
1722 <pathelement location="${icu4j.core.jar}"/>
1723 <pathelement location="${icu4j.collate.jar}"/>
1724 <pathelement location="${icu4j.charset.jar}"/>
1725 <pathelement location="${icu4j.currdata.jar}"/>
1726 <pathelement location="${icu4j.langdata.jar}"/>
1727 <pathelement location="${icu4j.regiondata.jar}"/>
1728 <pathelement location="${icu4j.translit.jar}"/>
1729 </classpath>
1730 </java>
1731 </target>
1732
Victor Chang4578a1c2018-10-22 04:26:58 +01001733 <target name="checkAPIStatusConsistency" depends="info, build-tools, gatherapi"
1734 description="Check consistency between API class status and methods overriding java.lang.Object">
1735 <!--
1736 If you need classes excluded from this check, define followig property in build-local.properties.
1737 e.g. checkAPIStatusConsistency.skip.classes=com.ibm.icu.text.Normalizer;com.ibm.icu.util.ULocale
1738 -->
1739 <property name="checkAPIStatusConsistency.skip.classes" value=""/>
1740 <java classname="com.ibm.icu.dev.tool.docs.APIStatusConsistencyChecker"
1741 failonerror="true">
1742 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1743 <arg value="${checkAPIStatusConsistency.skip.classes}" />
1744 <classpath>
1745 <pathelement location="${icu4j.build-tools.jar}"/>
1746 <pathelement location="${icu4j.core.jar}"/>
1747 <pathelement location="${icu4j.collate.jar}"/>
1748 <pathelement location="${icu4j.charset.jar}"/>
1749 <pathelement location="${icu4j.currdata.jar}"/>
1750 <pathelement location="${icu4j.langdata.jar}"/>
1751 <pathelement location="${icu4j.regiondata.jar}"/>
1752 <pathelement location="${icu4j.translit.jar}"/>
1753 </classpath>
1754 </java>
1755 </target>
1756
1757 <target name="checkAPIStatus" depends="checkAPIStatusConsistency, checkDeprecated"/>
1758
Fredrik Roubert1ac15792018-03-26 20:56:58 +02001759 <target name="draftAPIs" depends="info, gatherapi" description="Run API collector tool and generate draft API report in html">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001760 <java classname="com.ibm.icu.dev.tool.docs.CollectAPI"
1761 classpath="${icu4j.build-tools.jar}"
1762 failonerror="true">
1763 <arg value="-f"/>
1764 <arg value="Draft"/>
1765 <arg value="-o"/>
1766 <arg value="${out.dir}/draftAPIs.html"/>
1767 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1768 </java>
1769 </target>
1770
Fredrik Roubert1ac15792018-03-26 20:56:58 +02001771 <target name="draftAPIsTSV" depends="info, gatherapi" description="Run API collector tool and generate draft API report in TSV">
1772 <java classname="com.ibm.icu.dev.tool.docs.CollectAPI"
1773 classpath="${icu4j.build-tools.jar}"
1774 failonerror="true">
1775 <arg value="-f"/>
1776 <arg value="Draft"/>
1777 <arg value="-o"/>
1778 <arg value="${out.dir}/draftAPIs.tsv"/>
1779 <arg value="-t"/>
1780 <arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
1781 </java>
1782 </target>
1783
Fredrik Roubert7935b182014-11-18 20:21:54 -08001784 <target name="swatDeprecated" depends="build-tools" description="Convert @deprecated @draft tags to @provisional">
1785 <antcall target="_runSwatDeprecated">
1786 <param name="swat.deprecated.opt" value="-dep"/>
1787 </antcall>
1788 </target>
1789
1790 <target name="swatProvisional" depends="build-tools" description="Convert @provisional tags to @deprecated @draft">
1791 <antcall target="_runSwatDeprecated">
1792 <param name="swat.deprecated.opt" value="-prov"/>
1793 </antcall>
1794 </target>
1795
1796 <target name="_runSwatDeprecated">
1797 <java classname="com.ibm.icu.dev.tool.docs.SwatDeprecated"
1798 classpath="${icu4j.build-tools.jar}"
1799 failonerror="true">
1800 <arg value="${swat.deprecated.opt}"/>
1801 <arg value="-src"/>
1802 <arg value="${icu4j.core.dir}/src"/>
1803 <arg value="-dst"/>
1804 <arg value="${icu4j.core.dir}/src"/>
1805 <arg value="-overwrite"/>
1806 <arg value="-verbose"/>
1807 </java>
1808 <java classname="com.ibm.icu.dev.tool.docs.SwatDeprecated"
1809 classpath="${icu4j.build-tools.jar}"
1810 failonerror="true">
1811 <arg value="${swat.deprecated.opt}"/>
1812 <arg value="-src"/>
1813 <arg value="${icu4j.charset.dir}/src"/>
1814 <arg value="-dst"/>
1815 <arg value="${icu4j.charset.dir}/src"/>
1816 <arg value="-overwrite"/>
1817 <arg value="-verbose"/>
1818 </java>
1819 </target>
1820
1821 <target name="serialTestData" depends="main, tests">
1822 <property name="serial.test.data.dir" value="${out.dir}/serialTestData"/>
1823 <delete dir="${serial.test.data.dir}"/>
1824 <mkdir dir="${serial.test.data.dir}"/>
1825 <java classname="com.ibm.icu.dev.test.serializable.SerializableWriter" fork="yes" failonerror="true">
1826 <arg line="${serial.test.data.dir}"/>
1827 <classpath>
1828 <pathelement location="${icu4j.core.jar}"/>
1829 <pathelement location="${icu4j.collate.jar}"/>
1830 <pathelement location="${icu4j.charset.jar}"/>
1831 <pathelement location="${icu4j.currdata.jar}"/>
1832 <pathelement location="${icu4j.langdata.jar}"/>
1833 <pathelement location="${icu4j.regiondata.jar}"/>
1834 <pathelement location="${icu4j.translit.jar}"/>
1835 <pathelement location="${icu4j.test-framework.jar}"/>
1836 <pathelement location="${icu4j.core-tests.jar}"/>
1837 </classpath>
1838 </java>
1839 <echo message="Note: The serialization compatibility test data files were"/>
1840 <echo message="created in ${serial.test.data.dir}. Once you confirm"/>
1841 <echo message="the test runs clean, you should copy the data file directory to"/>
1842 <echo message="main/tests/core/src/com/ibm/icu/dev/test/serializable/data."/>
1843 </target>
1844
1845 <!-- Special packaging targets -->
1846 <target name="translitIMEJar" depends="info" description="Build transliterator IME 'icutransime.jar' jar file">
1847 <property name="translit.ime.out.dir" value="${out.dir}/translit_ime"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001848
Fredrik Roubert7935b182014-11-18 20:21:54 -08001849 <mkdir dir="${translit.ime.out.dir}/bin"/>
1850 <javac destdir="${translit.ime.out.dir}/bin"
1851 source="${javac.source}"
1852 target="${javac.target}"
1853 encoding="${java.src.encoding}"
1854 debug="on" deprecation="off">
1855 <src path="${icu4j.core.dir}/src"/>
1856 <src path="${icu4j.translit.dir}/src"/>
1857 <src path="${icu4j.tools.dir}/src"/>
1858 <include name="com/ibm/icu/dev/tool/ime/translit/*.java"/>
1859 </javac>
1860
1861 <copy file="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/translit/Transliterator.properties"
1862 todir="${translit.ime.out.dir}/bin/com/ibm/icu/dev/tool/ime/translit"/>
1863
1864 <mkdir dir="${translit.ime.out.dir}/lib"/>
1865 <jar jarfile="${translit.ime.out.dir}/lib/icutransime.jar"
1866 compress="true"
1867 basedir="${translit.ime.out.dir}/bin"
1868 includes="com/ibm/icu/dev/tool/ime/translit/**/*"
1869 manifest="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/translit/manifest.stub">
1870 <metainf dir="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/translit" includes="services/*" />
1871 </jar>
1872 </target>
1873
1874 <target name="indicIMEJar" depends="info" description="Build indic IME 'icuindicime.jar' jar file">
1875 <property name="indic.ime.out.dir" value="${out.dir}/indic_ime"/>
Fredrik Roubert2d2bb242016-10-21 19:44:52 +02001876
Fredrik Roubert7935b182014-11-18 20:21:54 -08001877 <mkdir dir="${indic.ime.out.dir}/bin"/>
1878 <javac destdir="${indic.ime.out.dir}/bin"
1879 source="${javac.source}"
1880 target="${javac.target}"
1881 encoding="${java.src.encoding}"
1882 debug="on" deprecation="off">
1883 <src path="${icu4j.core.dir}/src"/>
1884 <src path="${icu4j.tools.dir}/src"/>
1885 <include name="com/ibm/icu/dev/tool/ime/indic/*.java"/>
1886 </javac>
1887
1888 <copy file="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/indic/DisplayNames.properties"
1889 todir="${indic.ime.out.dir}/bin/com/ibm/icu/dev/tool/ime/indic"/>
1890
1891 <mkdir dir="${indic.ime.out.dir}/lib"/>
1892 <jar jarfile="${indic.ime.out.dir}/lib/icuindicime.jar"
1893 compress="true"
1894 basedir="${indic.ime.out.dir}/bin"
1895 includes="com/ibm/icu/dev/tool/ime/indic/**/*"
1896 manifest="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/indic/manifest.stub">
1897 <metainf dir="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/ime/indic" includes="services/*" />
1898 </jar>
1899 </target>
1900
1901 <target name="cldrUtil" depends="icu4jJar" description="Build Utilities for CLDR tooling">
1902 <mkdir dir="${cldr.util.out.dir}/bin"/>
1903 <javac destdir="${cldr.util.out.dir}/bin"
1904 source="${javac.source}"
1905 target="${javac.target}"
1906 encoding="${java.src.encoding}"
1907 debug="on" deprecation="off"
1908 classpath="${icu4j.jar.file}">
1909
1910 <src path="${icu4j.tools.dir}/src"/>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001911 <src path="${icu4j.test-framework.dir}/src"/>
1912
Fredrik Roubertd1ab31b2017-04-18 21:38:54 +02001913 <include name="com/ibm/icu/dev/util/CollectionUtilities.java" />
1914 <include name="com/ibm/icu/dev/util/ElapsedTimer.java" />
1915 <include name="com/ibm/icu/dev/util/UnicodeMap.java" />
1916 <include name="com/ibm/icu/dev/util/UnicodeMapIterator.java" />
Fredrik Roubert7935b182014-11-18 20:21:54 -08001917 <include name="com/ibm/icu/dev/tool/UOption.java" />
1918 </javac>
1919
1920 <mkdir dir="${cldr.util.out.dir}/lib"/>
1921 <jar jarfile="${cldr.util.out.dir}/lib/utilities.jar"
1922 compress="true"
1923 basedir="${cldr.util.out.dir}/bin">
Fredrik Roubert7935b182014-11-18 20:21:54 -08001924 <include name="com/ibm/icu/dev/util/*.class"/>
1925 <include name="com/ibm/icu/dev/tool/UOption*.class"/>
1926 </jar>
1927 </target>
1928
1929 <target name="releaseCLDR" depends="icu4jJar,icu4jSrcJar,cldrUtil" description="Build release files for CLDR tooling">
1930 <mkdir dir="${cldr.release.dir}"/>
1931 <!-- icu4j.jar -->
1932 <copy file="${icu4j.jar.file}" todir="${cldr.release.dir}"/>
1933 <!-- icu4j-src.jar -->
1934 <copy file="${icu4j-src.jar.file}" todir="${cldr.release.dir}"/>
1935 <!-- utilities.jar -->
1936 <copy file="${cldr.util.out.dir}/lib/utilities.jar" todir="${cldr.release.dir}"/>
1937 <!-- utilities-src.jar -->
1938 <jar jarfile="${cldr.release.dir}/utilities-src.jar" compress="true">
1939 <fileset dir="${icu4j.test-framework.dir}/${src.dir}">
Fredrik Roubertd1ab31b2017-04-18 21:38:54 +02001940 <include name="com/ibm/icu/dev/util/CollectionUtilities.java" />
1941 <include name="com/ibm/icu/dev/util/ElapsedTimer.java" />
1942 <include name="com/ibm/icu/dev/util/UnicodeMap.java" />
1943 <include name="com/ibm/icu/dev/util/UnicodeMapIterator.java" />
Fredrik Roubert7935b182014-11-18 20:21:54 -08001944 </fileset>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001945 <fileset dir="${icu4j.tools.dir}/${src.dir}" includes="com/ibm/icu/dev/tool/UOption.java"/>
1946 </jar>
1947 </target>
1948
1949 <target name="xliff" description="Build xliff converter tool">
1950 <property name="xliff.out.dir" value="${out.dir}/xliff"/>
1951
1952 <mkdir dir="${xliff.out.dir}/bin"/>
1953 <javac destdir="${xliff.out.dir}/bin"
1954 source="1.3"
1955 target="1.3"
1956 encoding="${java.src.encoding}"
1957 debug="on" deprecation="off">
1958 <src path="${icu4j.tools.dir}/src"/>
1959 <include name="com/ibm/icu/dev/tool/localeconverter/CalculateCRC32.java"/>
1960 <include name="com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java"/>
1961 <include name="com/ibm/icu/dev/tool/UOption.java"/>
1962 </javac>
1963
1964 <mkdir dir="${xliff.out.dir}/lib"/>
1965
1966 <jar jarfile="${xliff.out.dir}/lib/xliff-src.jar"
1967 compress="true"
1968 basedir="${icu4j.tools.dir}/src">
1969 <include name="com/ibm/icu/dev/tool/localeconverter/CalculateCRC32.java"/>
1970 <include name="com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java"/>
1971 <include name="com/ibm/icu/dev/tool/UOption.java"/>
1972 </jar>
1973
1974 <jar jarfile="${xliff.out.dir}/lib/xliff.jar"
1975 compress="true"
1976 basedir="${xliff.out.dir}/bin"
1977 manifest="${icu4j.tools.dir}/src/com/ibm/icu/dev/tool/localeconverter/manifest.stub"/>
1978 </target>
Fredrik Roubert7935b182014-11-18 20:21:54 -08001979</project>