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 ICU 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}"/>
52 <taskdef name=
"cldr-build" classname=
"org.unicode.cldr.ant.CLDRBuild">
54 <pathelement path=
"${java.class.path}/"/>
55 <pathelement path=
"${env.CLDR_CLASSES}"/>
56 <pathelement location=
"${cldrtools.jar}"/>
57 <fileset dir=
"${cldrtools.dir}/libs" includes=
"*.jar"/>
61 <!-- target for generating ICU data -->
62 <target name=
"all" depends=
"locales, collation, rbnf, supplementalData, metadata, metaZones, windowsZones, likelySubtags, plurals, numberingSystems, translit, brkitr, keyTypeData, genderList, dayPeriods" />
63 <!-- parallel target -->
64 <target name=
"pall" depends=
"init">
65 <parallel threadsPerProcessor =
"1">
67 <ant target='locales'
/>
70 <ant target='collation'
>
77 <ant target='supplementalData'
>
84 <ant target='translit'
>
86 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
90 <ant target='keyTypeData'
/>
93 <ant target='genderList'
/>
96 <ant target='dayPeriods'
/>
101 <target name=
"locales" depends=
"init,setup" description=
"builds locale files in ICU text format">
102 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
103 <!-- launch the tool and generate the data after reading the config file -->
106 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/main" />
107 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/locales"/>
108 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/main"/>
109 <arg name=
"--supplementaldir" value=
"${env.CLDR_DIR}/common/supplemental" />
110 <arg name=
"--type" value=
"locales"/>
111 <arg name=
"--makefile" value=
"resfiles.mk"/>
114 <remap sourcePath=
"/Keys" targetDir=
"lang" />
115 <remap sourcePath=
"/Languages" targetDir=
"lang" />
116 <remap sourcePath=
"/Languages%long" targetDir=
"lang" />
117 <remap sourcePath=
"/Languages%short" targetDir=
"lang" />
118 <remap sourcePath=
"/Languages%secondary" targetDir=
"lang" />
119 <remap sourcePath=
"/Languages%variant" targetDir=
"lang" />
120 <remap sourcePath=
"/Scripts" targetDir=
"lang" />
121 <remap sourcePath=
"/Scripts%secondary" targetDir=
"lang" />
122 <remap sourcePath=
"/Scripts%short" targetDir=
"lang" />
123 <remap sourcePath=
"/Scripts%stand-alone" targetDir=
"lang" />
124 <remap sourcePath=
"/Scripts%variant" targetDir=
"lang" />
125 <remap sourcePath=
"/Types" targetDir=
"lang" />
126 <remap sourcePath=
"/Types%short" targetDir=
"lang" />
127 <remap sourcePath=
"/Variants" targetDir=
"lang" />
128 <remap sourcePath=
"/Variants%secondary" targetDir=
"lang" />
129 <remap sourcePath=
"/characterLabelPattern" targetDir=
"lang" />
130 <remap sourcePath=
"/codePatterns" targetDir=
"lang" />
131 <remap sourcePath=
"/localeDisplayPattern" targetDir=
"lang" />
132 <remap sourcePath=
"/Countries" targetDir=
"region" />
133 <remap sourcePath=
"/Countries%variant" targetDir=
"region" />
134 <remap sourcePath=
"/Countries%short" targetDir=
"region" />
135 <remap sourcePath=
"/Currencies" targetDir=
"curr" />
136 <remap sourcePath=
"/Currencies%narrow" targetDir=
"curr" />
137 <remap sourcePath=
"/Currencies%variant" targetDir=
"curr" />
138 <remap sourcePath=
"/CurrencyPlurals" targetDir=
"curr" />
139 <remap sourcePath=
"/CurrencyUnitPatterns" targetDir=
"curr" />
140 <remap sourcePath=
"/currencySpacing" targetDir=
"curr" />
141 <remap sourcePath=
"/zoneStrings" targetDir=
"zone" />
142 <remap sourcePath=
"/durationUnits" targetDir=
"unit" />
143 <remap sourcePath=
"/units" targetDir=
"unit" />
144 <remap sourcePath=
"/unitsShort" targetDir=
"unit" />
145 <remap sourcePath=
"/unitsNarrow" targetDir=
"unit" />
147 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
149 &icu-locale-deprecates;
153 <target name=
"collation" depends=
"init,setup" description=
"builds collation files in ICU text format">
154 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
157 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/collation" />
158 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/coll"/>
159 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/collation"/>
160 <arg name=
"--type" value=
"collation"/>
161 <arg name=
"--makefile" value=
"colfiles.mk"/>
163 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
165 &icu-coll-deprecates;
169 <target name=
"rbnf" depends=
"init,setup" description=
"builds rbnf files in ICU text format">
170 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
173 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/rbnf" />
174 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/rbnf"/>
175 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/rbnf"/>
176 <arg name=
"--type" value=
"rbnf" />
177 <arg name=
"--makefile" value=
"rbnffiles.mk"/>
179 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
181 &icu-rbnf-deprecates;
185 <target name=
"supplementalData" depends=
"init,setup" description=
"builds supplementalData.txt from supplementalData.xml">
186 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"supplementalData.txt" noArgs=
"true">
187 <!-- launch the tool and generate the data after reading the config file -->
190 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
191 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
192 <arg name=
"-t" value=
"supplementalData"/>
195 <remap sourcePath=
"/CurrencyMap" targetDir=
"curr" />
196 <remap sourcePath=
"/CurrencyMeta" targetDir=
"curr" />
201 <target name=
"metadata" depends=
"init,setup" description=
"builds metadata.txt from supplementalMetadata.xml">
202 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metadata.txt" noArgs=
"true">
203 <!-- launch the tool and generate the data after reading the config file -->
206 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
207 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
208 <arg name=
"-t" value=
"metadata"/>
213 <target name=
"metaZones" depends=
"init,setup" description=
"builds metaZones.txt from metaZones.xml">
214 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metaZones.txt" noArgs=
"true">
215 <!-- launch the tool and generate the data after reading the config file -->
218 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
219 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
220 <arg name=
"-t" value=
"metaZones"/>
225 <target name=
"windowsZones" depends=
"init,setup" description=
"builds windowsZones.txt from windowsZones.xml">
226 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"windowsZones.txt" noArgs=
"true">
227 <!-- launch the tool and generate the data after reading the config file -->
230 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
231 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
232 <arg name=
"-t" value=
"windowsZones"/>
237 <target name=
"likelySubtags" depends=
"init,setup" description=
"builds likelySubtags.txt from likelySubtags.xml">
238 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"likelySubtags.txt" noArgs=
"true">
239 <!-- launch the tool and generate the data after reading the config file -->
242 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
243 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
244 <arg name=
"-t" value=
"likelySubtags"/>
249 <target name=
"plurals" depends=
"init,setup" description=
"builds plurals.txt from plurals.xml">
250 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"plurals.txt" noArgs=
"true">
251 <!-- launch the tool and generate the data after reading the config file -->
254 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
255 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
256 <arg name=
"-t" value=
"plurals"/>
261 <target name=
"numberingSystems" depends=
"init,setup" description=
"builds numberingSystems.txt from numberingSystems.xml">
262 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"numberingSystems.txt" noArgs=
"true">
263 <!-- launch the tool and generate the data after reading the config file -->
266 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
267 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
268 <arg name=
"-t" value=
"numberingSystems"/>
273 <target name=
"genderList" depends=
"init,setup" description=
"builds genderList.txt from genderList.xml">
274 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"genderList.txt" noArgs=
"true">
275 <!-- launch the tool and generate the data after reading the config file -->
278 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
279 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
280 <arg name=
"-t" value=
"genderList"/>
285 <target name=
"dayPeriods" depends=
"init,setup" description=
"builds dayPeriods.txt from dayPeriods.xml">
286 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"dayPeriods.txt" noArgs=
"true">
287 <!-- launch the tool and generate the data after reading the config file -->
290 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
291 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
292 <arg name=
"-t" value=
"dayPeriods"/>
297 <target name=
"brkitr" depends=
"init,setup" description=
"builds break iterator files in ICU text format">
298 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
301 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/segments"/>
302 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/brkitr"/>
303 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/brkitr"/>
304 <arg name=
"--type" value=
"brkitr" />
305 <arg name=
"--makefile" value=
"brkfiles.mk"/>
307 <!-- The entity include is not required for this target -->
308 <!-- http://ant.apache.org/faq.html#xml-entity-include
315 <target name=
"keyTypeData" depends=
"init,setup" description=
"builds keyTypeData.txt and timezoneTypes.txt from bcp47/*.xml">
316 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" noArgs=
"true">
319 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/bcp47" />
320 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
321 <arg name=
"-t" value=
"keyTypeData"/>
327 <target name=
"translit" depends=
"init,setup" description=
"builds collation files in ICU text format">
328 <cldr-build toolName=
"org.unicode.cldr.icu.ConvertTransforms" srcFile=
".*xml" destFile=
".*txt">
331 <arg name=
"-m" value=
"((?!.*(Canadian|Ethiopic|ug-Latin).*).*)" />
332 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/transforms" />
333 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/translit"/>
334 <arg name=
"--commentSkip"/>
335 <arg name=
"--approvedOnly"/>
337 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
342 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
344 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk">
345 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
347 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
348 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" />
349 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
350 <arg name=-"-commentSkip"/>
351 <arg name=-"-writeIndex"/>
356 <target name=
"clean" depends=
"init, setup" description=
"deletes all txt files and mk files from coll and locales directories">
358 <fileset id=
"locales" dir=
"${env.ICU4C_DIR}/source/data/locales">
359 <include name=
"*.txt" />
361 <fileset id=
"resfiles" dir=
"${env.ICU4C_DIR}/source/data/locales">
362 <include name=
"resfiles.mk" />
364 <fileset id=
"locales_split" dir=
"${env.ICU4C_DIR}/source/data">
365 <include name=
"curr/*.txt" />
366 <include name=
"curr/resfiles.mk" />
367 <include name=
"lang/*.txt" />
368 <include name=
"lang/resfiles.mk" />
369 <include name=
"region/*.txt" />
370 <include name=
"region/resfiles.mk" />
371 <include name=
"zone/*.txt" />
372 <include name=
"zone/resfiles.mk" />
373 <exclude name=
"zone/tzdbNames.txt" />
374 <include name=
"unit/*.txt" />
375 <include name=
"unit/resfiles.mk" />
377 <fileset id=
"collation" dir=
"${env.ICU4C_DIR}/source/data/coll">
378 <include name=
"*.txt" />
380 <fileset id=
"colfiles" dir=
"${env.ICU4C_DIR}/source/data/coll">
381 <include name=
"colfiles.mk" />
383 <fileset id=
"translit" dir=
"${env.ICU4C_DIR}/source/data/translit">
384 <include name=
"*_*.txt" />
385 <include name=
"root.txt" />
387 <fileset id=
"brkitr" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
388 <include name=
"*.txt"/>
390 <fileset id=
"brkfiles" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
391 <include name=
"brkfiles.mk" />
393 <fileset id=
"supplementalData" dir=
"${env.ICU4C_DIR}/source/data/misc">
394 <include name=
"supplementalData.txt" />
396 <fileset id=
"rbnf" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
397 <include name=
"*.txt" />
399 <fileset id=
"rbnffiles" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
400 <include name=
"rbnffiles.mk" />
402 <fileset id=
"metadata" dir=
"${env.ICU4C_DIR}/source/data/misc">
403 <include name=
"metadata.txt" />
405 <fileset id=
"metaZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
406 <include name=
"metaZones.txt" />
408 <fileset id=
"windowsZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
409 <include name=
"windowsZones.txt" />
411 <fileset id=
"likelySubtags" dir=
"${env.ICU4C_DIR}/source/data/misc">
412 <include name=
"likelySubtags.txt" />
414 <fileset id=
"plurals" dir=
"${env.ICU4C_DIR}/source/data/misc">
415 <include name=
"plurals.txt" />
417 <fileset id=
"numberingSystems" dir=
"${env.ICU4C_DIR}/source/data/misc">
418 <include name=
"numberingSystems.txt" />
420 <fileset id=
"keyTypeData" dir=
"${env.ICU4C_DIR}/source/data/misc">
421 <include name=
"keyTypeData.txt" />
422 <include name=
"timezoneTypes.txt" />
424 <fileset id=
"genderList" dir=
"${env.ICU4C_DIR}/source/data/misc">
425 <include name=
"genderList.txt" />
427 <fileset id=
"dayPeriods" dir=
"${env.ICU4C_DIR}/source/data/misc">
428 <include name=
"dayPeriods.txt" />