2 <!ENTITY icu-config SYSTEM
"./icu-config.xml">
3 <!ENTITY icu-locale-deprecates SYSTEM
"./icu-locale-deprecates.xml">
4 <!ENTITY icu-coll-deprecates SYSTEM
"./icu-coll-deprecates.xml">
5 <!ENTITY icu-rbnf-deprecates SYSTEM
"./icu-rbnf-deprecates.xml">
9 * Copyright (C) 2016 and later: Unicode, Inc. and others.
10 * License & terms of use: http://www.unicode.org/copyright.html
11 *******************************************************************************
12 * Copyright (C) 2005-2015, International Business Machines Corporation and *
13 * others. All Rights Reserved. *
14 *******************************************************************************
17 <project name=
"icu-build" default=
"all" basedir=
".">
21 <!-- Load environment variables -->
22 <property environment=
"env"/>
24 <!-- Ant won't set properties that have already been set, so environment variables that have been set before won't be clobbered. -->
25 <property name=
"env.ICU4C_DIR" location=
"../.."/>
27 <condition property=
"is.cldr.dir.set" >
28 <isset property=
"env.CLDR_DIR" />
30 <fail unless=
"is.cldr.dir.set" message=
"Please set the CLDR_DIR environment variable to the top level CLDR source dir (containing 'common')."/>
32 <available property=
"cldrtools.dir" value=
"${env.CLDR_DIR}/cldr-tools" file=
"${env.CLDR_DIR}/cldr-tools" type=
"dir"/>
33 <available property=
"cldrtools.dir" value=
"${env.CLDR_DIR}/tools/java" file=
"${env.CLDR_DIR}/tools/java" type=
"dir"/>
34 <fail unless=
"cldrtools.dir" message=
"Please make sure that the CLDR tools directory is checked out into CLDR_DIR"/>
36 <available property=
"env.CLDR_CLASSES" value=
"${cldrtools.dir}/classes" file=
"${cldrtools.dir}/classes" type=
"dir"/>
37 <available property=
"cldrtools.jar" value=
"${cldrtools.dir}/cldr.jar" file=
"${cldrtools.dir}/cldr.jar" type=
"file"/>
38 <condition property=
"is.cldr.classes.set">
40 <isset property=
"env.CLDR_CLASSES" />
41 <isset property=
"cldrtools.jar" />
44 <fail unless=
"is.cldr.classes.set" message=
"CLDR classes not found in ${cldrtools.dir}. Please either set the CLDR_CLASSES environment variable or build cldr.jar."/>
46 <echo message=
"java home: ${java.home}"/>
47 <echo message=
"java version: ${java.version}"/>
48 <echo message=
"ant java version: ${ant.java.version}"/>
49 <echo message=
"${ant.version}"/>
50 <echo message=
"cldr tools dir: ${cldrtools.dir}"/>
51 <echo message=
"cldr tools jar: ${cldrtools.jar}"/>
52 <echo message=
"cldr tools classes: ${env.CLDR_CLASSES}"/>
54 <target name=
"setup" depends=
"init">
55 <taskdef name=
"cldr-build" classname=
"org.unicode.cldr.ant.CLDRBuild">
57 <pathelement path=
"${java.class.path}/"/>
58 <pathelement path=
"${env.CLDR_CLASSES}"/>
59 <pathelement location=
"${cldrtools.jar}"/>
60 <fileset dir=
"${cldrtools.dir}/libs" includes=
"*.jar"/>
64 <!-- target for generating ICU data -->
65 <target name=
"all" depends=
"locales, collation, rbnf, supplementalData, metadata, metaZones, windowsZones, likelySubtags, plurals, pluralRanges, numberingSystems, translit, brkitr, keyTypeData, genderList, dayPeriods" />
66 <!-- parallel target -->
67 <target name=
"pall" depends=
"init">
68 <parallel threadsPerProcessor =
"1">
70 <ant target='locales'
/>
73 <ant target='collation'
>
80 <ant target='supplementalData'
>
87 <ant target='translit'
>
89 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
93 <ant target='keyTypeData'
/>
96 <ant target='genderList'
/>
99 <ant target='dayPeriods'
/>
104 <target name=
"locales" depends=
"init,setup" description=
"builds locale files in ICU text format">
105 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
106 <!-- launch the tool and generate the data after reading the config file -->
109 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/main" />
110 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/locales"/>
111 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/main"/>
112 <arg name=
"--supplementaldir" value=
"${env.CLDR_DIR}/common/supplemental" />
113 <arg name=
"--type" value=
"locales"/>
114 <arg name=
"--depgraphfile" value=
"../buildtool/locale_dependencies.py"/>
117 <remap sourcePath=
"/Keys" targetDir=
"lang" />
118 <remap sourcePath=
"/Languages" targetDir=
"lang" />
119 <remap sourcePath=
"/Languages%long" targetDir=
"lang" />
120 <remap sourcePath=
"/Languages%short" targetDir=
"lang" />
121 <remap sourcePath=
"/Languages%secondary" targetDir=
"lang" />
122 <remap sourcePath=
"/Languages%variant" targetDir=
"lang" />
123 <remap sourcePath=
"/Scripts" targetDir=
"lang" />
124 <remap sourcePath=
"/Scripts%secondary" targetDir=
"lang" />
125 <remap sourcePath=
"/Scripts%short" targetDir=
"lang" />
126 <remap sourcePath=
"/Scripts%stand-alone" targetDir=
"lang" />
127 <remap sourcePath=
"/Scripts%variant" targetDir=
"lang" />
128 <remap sourcePath=
"/Types" targetDir=
"lang" />
129 <remap sourcePath=
"/Types%short" targetDir=
"lang" />
130 <remap sourcePath=
"/Variants" targetDir=
"lang" />
131 <remap sourcePath=
"/Variants%secondary" targetDir=
"lang" />
132 <remap sourcePath=
"/characterLabelPattern" targetDir=
"lang" />
133 <remap sourcePath=
"/codePatterns" targetDir=
"lang" />
134 <remap sourcePath=
"/localeDisplayPattern" targetDir=
"lang" />
135 <remap sourcePath=
"/Countries" targetDir=
"region" />
136 <remap sourcePath=
"/Countries%variant" targetDir=
"region" />
137 <remap sourcePath=
"/Countries%short" targetDir=
"region" />
138 <remap sourcePath=
"/Currencies" targetDir=
"curr" />
139 <remap sourcePath=
"/Currencies%formal" targetDir=
"curr" />
140 <remap sourcePath=
"/Currencies%narrow" targetDir=
"curr" />
141 <remap sourcePath=
"/Currencies%variant" targetDir=
"curr" />
142 <remap sourcePath=
"/CurrencyPlurals" targetDir=
"curr" />
143 <remap sourcePath=
"/CurrencyUnitPatterns" targetDir=
"curr" />
144 <remap sourcePath=
"/currencySpacing" targetDir=
"curr" />
145 <remap sourcePath=
"/zoneStrings" targetDir=
"zone" />
146 <remap sourcePath=
"/durationUnits" targetDir=
"unit" />
147 <remap sourcePath=
"/units" targetDir=
"unit" />
148 <remap sourcePath=
"/unitsShort" targetDir=
"unit" />
149 <remap sourcePath=
"/unitsNarrow" targetDir=
"unit" />
151 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
153 &icu-locale-deprecates;
157 <target name=
"collation" depends=
"init,setup" description=
"builds collation files in ICU text format">
158 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
161 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/collation" />
162 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/coll"/>
163 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/collation"/>
164 <arg name=
"--type" value=
"collation"/>
166 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
168 &icu-coll-deprecates;
172 <target name=
"rbnf" depends=
"init,setup" description=
"builds rbnf files in ICU text format">
173 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
176 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/rbnf" />
177 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/rbnf"/>
178 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/rbnf"/>
179 <arg name=
"--type" value=
"rbnf" />
181 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
183 &icu-rbnf-deprecates;
187 <target name=
"supplementalData" depends=
"init,setup" description=
"builds supplementalData.txt from supplementalData.xml">
188 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"supplementalData.txt" noArgs=
"true">
189 <!-- launch the tool and generate the data after reading the config file -->
192 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
193 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
194 <arg name=
"-t" value=
"supplementalData"/>
197 <remap sourcePath=
"/CurrencyMap" targetDir=
"curr" />
198 <remap sourcePath=
"/CurrencyMeta" targetDir=
"curr" />
203 <target name=
"metadata" depends=
"init,setup" description=
"builds metadata.txt from supplementalMetadata.xml">
204 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metadata.txt" noArgs=
"true">
205 <!-- launch the tool and generate the data after reading the config file -->
208 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
209 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
210 <arg name=
"-t" value=
"metadata"/>
215 <target name=
"metaZones" depends=
"init,setup" description=
"builds metaZones.txt from metaZones.xml">
216 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metaZones.txt" noArgs=
"true">
217 <!-- launch the tool and generate the data after reading the config file -->
220 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
221 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
222 <arg name=
"-t" value=
"metaZones"/>
227 <target name=
"windowsZones" depends=
"init,setup" description=
"builds windowsZones.txt from windowsZones.xml">
228 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"windowsZones.txt" noArgs=
"true">
229 <!-- launch the tool and generate the data after reading the config file -->
232 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
233 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
234 <arg name=
"-t" value=
"windowsZones"/>
239 <target name=
"likelySubtags" depends=
"init,setup" description=
"builds likelySubtags.txt from likelySubtags.xml">
240 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"likelySubtags.txt" noArgs=
"true">
241 <!-- launch the tool and generate the data after reading the config file -->
244 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
245 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
246 <arg name=
"-t" value=
"likelySubtags"/>
251 <target name=
"plurals" depends=
"init,setup" description=
"builds plurals.txt from plurals.xml">
252 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"plurals.txt" noArgs=
"true">
253 <!-- launch the tool and generate the data after reading the config file -->
256 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
257 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
258 <arg name=
"-t" value=
"plurals"/>
263 <target name=
"pluralRanges" depends=
"init,setup" description=
"builds pluralRanges.txt from pluralRanges.xml">
264 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"pluralRanges.txt" noArgs=
"true">
265 <!-- launch the tool and generate the data after reading the config file -->
268 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
269 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
270 <arg name=
"-t" value=
"pluralRanges"/>
275 <target name=
"numberingSystems" depends=
"init,setup" description=
"builds numberingSystems.txt from numberingSystems.xml">
276 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"numberingSystems.txt" noArgs=
"true">
277 <!-- launch the tool and generate the data after reading the config file -->
280 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
281 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
282 <arg name=
"-t" value=
"numberingSystems"/>
287 <target name=
"genderList" depends=
"init,setup" description=
"builds genderList.txt from genderList.xml">
288 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"genderList.txt" noArgs=
"true">
289 <!-- launch the tool and generate the data after reading the config file -->
292 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
293 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
294 <arg name=
"-t" value=
"genderList"/>
299 <target name=
"dayPeriods" depends=
"init,setup" description=
"builds dayPeriods.txt from dayPeriods.xml">
300 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"dayPeriods.txt" noArgs=
"true">
301 <!-- launch the tool and generate the data after reading the config file -->
304 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
305 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
306 <arg name=
"-t" value=
"dayPeriods"/>
311 <target name=
"brkitr" depends=
"init,setup" description=
"builds break iterator files in ICU text format">
312 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
315 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/segments"/>
316 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/brkitr"/>
317 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/brkitr"/>
318 <arg name=
"--type" value=
"brkitr" />
320 <!-- The entity include is not required for this target -->
321 <!-- http://ant.apache.org/faq.html#xml-entity-include
328 <target name=
"keyTypeData" depends=
"init,setup" description=
"builds keyTypeData.txt and timezoneTypes.txt from bcp47/*.xml">
329 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" noArgs=
"true">
332 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/bcp47" />
333 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
334 <arg name=
"-t" value=
"keyTypeData"/>
340 <target name=
"translit" depends=
"init,setup" description=
"builds collation files in ICU text format">
341 <cldr-build toolName=
"org.unicode.cldr.icu.ConvertTransforms" srcFile=
".*xml" destFile=
".*txt">
344 <arg name=
"-m" value=
"((?!.*(Canadian|Ethiopic|ug-Latin).*).*)" />
345 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/transforms" />
346 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/translit"/>
347 <arg name=
"--commentSkip"/>
348 <arg name=
"--approvedOnly"/>
350 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
355 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
357 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk">
358 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
360 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
361 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" />
362 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
363 <arg name=-"-commentSkip"/>
364 <arg name=-"-writeIndex"/>
369 <target name=
"clean" depends=
"init, setup" description=
"deletes all txt files and mk files from coll and locales directories">
371 <fileset id=
"locales" dir=
"${env.ICU4C_DIR}/source/data/locales">
372 <include name=
"*.txt" />
374 <fileset id=
"resfiles" dir=
"${env.ICU4C_DIR}/source/data/locales">
375 <include name=
"resfiles.mk" />
377 <fileset id=
"dependencies_py" dir=
"${env.ICU4C_DIR}/source/data/buildtool">
378 <include name=
"locale_dependencies.py" />
380 <fileset id=
"locales_split" dir=
"${env.ICU4C_DIR}/source/data">
381 <include name=
"curr/*.txt" />
382 <include name=
"curr/resfiles.mk" />
383 <include name=
"lang/*.txt" />
384 <include name=
"lang/resfiles.mk" />
385 <include name=
"region/*.txt" />
386 <include name=
"region/resfiles.mk" />
387 <include name=
"zone/*.txt" />
388 <include name=
"zone/resfiles.mk" />
389 <exclude name=
"zone/tzdbNames.txt" />
390 <include name=
"unit/*.txt" />
391 <include name=
"unit/resfiles.mk" />
393 <fileset id=
"collation" dir=
"${env.ICU4C_DIR}/source/data/coll">
394 <include name=
"*.txt" />
396 <fileset id=
"colfiles" dir=
"${env.ICU4C_DIR}/source/data/coll">
397 <include name=
"colfiles.mk" />
399 <fileset id=
"translit" dir=
"${env.ICU4C_DIR}/source/data/translit">
400 <include name=
"*_*.txt" />
401 <include name=
"root.txt" />
403 <fileset id=
"brkitr" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
404 <include name=
"*.txt"/>
406 <fileset id=
"brkfiles" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
407 <include name=
"brkfiles.mk" />
409 <fileset id=
"supplementalData" dir=
"${env.ICU4C_DIR}/source/data/misc">
410 <include name=
"supplementalData.txt" />
412 <fileset id=
"rbnf" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
413 <include name=
"*.txt" />
415 <fileset id=
"rbnffiles" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
416 <include name=
"rbnffiles.mk" />
418 <fileset id=
"metadata" dir=
"${env.ICU4C_DIR}/source/data/misc">
419 <include name=
"metadata.txt" />
421 <fileset id=
"metaZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
422 <include name=
"metaZones.txt" />
424 <fileset id=
"windowsZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
425 <include name=
"windowsZones.txt" />
427 <fileset id=
"likelySubtags" dir=
"${env.ICU4C_DIR}/source/data/misc">
428 <include name=
"likelySubtags.txt" />
430 <fileset id=
"plurals" dir=
"${env.ICU4C_DIR}/source/data/misc">
431 <include name=
"plurals.txt" />
433 <fileset id=
"pluralRanges" dir=
"${env.ICU4C_DIR}/source/data/misc">
434 <include name=
"pluralRanges.txt" />
436 <fileset id=
"numberingSystems" dir=
"${env.ICU4C_DIR}/source/data/misc">
437 <include name=
"numberingSystems.txt" />
439 <fileset id=
"keyTypeData" dir=
"${env.ICU4C_DIR}/source/data/misc">
440 <include name=
"keyTypeData.txt" />
441 <include name=
"timezoneTypes.txt" />
443 <fileset id=
"genderList" dir=
"${env.ICU4C_DIR}/source/data/misc">
444 <include name=
"genderList.txt" />
446 <fileset id=
"dayPeriods" dir=
"${env.ICU4C_DIR}/source/data/misc">
447 <include name=
"dayPeriods.txt" />