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 <property name=
"env.CLDR_TMP_DIR" location=
"${env.CLDR_DIR}/../cldr-aux" /> <!-- Hack: see CLDRPaths -->
47 <property name=
"cldr.prod.dir" location=
"${env.CLDR_TMP_DIR}/production/" />
48 <echo message=
"java home: ${java.home}"/>
49 <echo message=
"java version: ${java.version}"/>
50 <echo message=
"ant java version: ${ant.java.version}"/>
51 <echo message=
"${ant.version}"/>
52 <echo message=
"cldr tools dir: ${cldrtools.dir}"/>
53 <echo message=
"cldr tools jar: ${cldrtools.jar}"/>
54 <echo message=
"cldr tools classes: ${env.CLDR_CLASSES}"/>
55 <echo message=
"CLDR_TMP_DIR: ${env.CLDR_TMP_DIR} "/>
56 <echo message=
"cldr.prod.dir (production data): ${cldr.prod.dir}"/>
58 <target name=
"setup" depends=
"init">
59 <taskdef name=
"cldr-build" classname=
"org.unicode.cldr.ant.CLDRBuild">
61 <pathelement path=
"${java.class.path}/"/>
62 <pathelement path=
"${env.CLDR_CLASSES}"/>
63 <pathelement location=
"${cldrtools.jar}"/>
64 <fileset dir=
"${cldrtools.dir}/libs" includes=
"*.jar"/>
67 <mkdir dir=
"${env.CLDR_TMP_DIR}"/> <!-- make sure parent dir exists -->
68 <condition property=
"cldrprod.exists">
69 <available file=
"${cldr.prod.dir}" type=
"dir"/>
73 <target name=
"cleanprod" depends=
"init, setup" if=
"cldrprod.exists">
74 <delete dir=
"${cldr.prod.dir}" />
76 <target name=
"proddata" depends=
"init,setup" unless=
"cldrprod.exists">
77 <echo message=
"Rebuilding ${cldr.prod.dir} - takes a while!"/>
79 <!-- setup prod data -->
80 <java fork=
"true" jar=
"${cldrtools.jar}">
81 <arg value=
"org.unicode.cldr.tool.GenerateProductionData" /> <!-- change to short alias 'proddata' or similar when annotated -->
83 <!-- TODO: for now, we just let the default source/target paths used.
84 could set '-s' / '-d' for explicit source/dest -->
88 <!-- target for generating ICU data -->
89 <target name=
"all" depends=
"locales, collation, rbnf, supplementalData, metadata, metaZones, windowsZones, likelySubtags, plurals, pluralRanges, numberingSystems, translit, brkitr, keyTypeData, genderList, dayPeriods" />
90 <!-- parallel target -->
91 <target name=
"pall" depends=
"init,setup,proddata">
92 <parallel threadsPerProcessor =
"1">
94 <ant target='locales'
/>
97 <ant target='collation'
>
104 <ant target='supplementalData'
>
107 <ant target='brkitr'
>
111 <ant target='translit'
>
113 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
117 <ant target='keyTypeData'
/>
120 <ant target='genderList'
/>
123 <ant target='dayPeriods'
/>
128 <target name=
"locales" depends=
"init,setup,proddata" description=
"builds locale files in ICU text format">
129 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
130 <!-- launch the tool and generate the data after reading the config file -->
133 <arg name=
"--sourcedir" value=
"${cldr.prod.dir}/common/main" />
134 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/locales"/>
135 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/main"/>
136 <arg name=
"--supplementaldir" value=
"${cldr.prod.dir}/common/supplemental" />
137 <arg name=
"--type" value=
"locales"/>
138 <arg name=
"--depgraphfile" value=
"../../python/icutools/databuilder/locale_dependencies.py"/>
141 <remap sourcePath=
"/Keys" targetDir=
"lang" />
142 <remap sourcePath=
"/Languages" targetDir=
"lang" />
143 <remap sourcePath=
"/Languages%long" targetDir=
"lang" />
144 <remap sourcePath=
"/Languages%menu" targetDir=
"lang" />
145 <remap sourcePath=
"/Languages%short" targetDir=
"lang" />
146 <remap sourcePath=
"/Languages%secondary" targetDir=
"lang" />
147 <remap sourcePath=
"/Languages%variant" targetDir=
"lang" />
148 <remap sourcePath=
"/Scripts" targetDir=
"lang" />
149 <remap sourcePath=
"/Scripts%secondary" targetDir=
"lang" />
150 <remap sourcePath=
"/Scripts%short" targetDir=
"lang" />
151 <remap sourcePath=
"/Scripts%stand-alone" targetDir=
"lang" />
152 <remap sourcePath=
"/Scripts%variant" targetDir=
"lang" />
153 <remap sourcePath=
"/Types" targetDir=
"lang" />
154 <remap sourcePath=
"/Types%short" targetDir=
"lang" />
155 <remap sourcePath=
"/Variants" targetDir=
"lang" />
156 <remap sourcePath=
"/Variants%secondary" targetDir=
"lang" />
157 <remap sourcePath=
"/characterLabelPattern" targetDir=
"lang" />
158 <remap sourcePath=
"/codePatterns" targetDir=
"lang" />
159 <remap sourcePath=
"/localeDisplayPattern" targetDir=
"lang" />
160 <remap sourcePath=
"/Countries" targetDir=
"region" />
161 <remap sourcePath=
"/Countries%variant" targetDir=
"region" />
162 <remap sourcePath=
"/Countries%short" targetDir=
"region" />
163 <remap sourcePath=
"/Currencies" targetDir=
"curr" />
164 <remap sourcePath=
"/Currencies%formal" targetDir=
"curr" />
165 <remap sourcePath=
"/Currencies%narrow" targetDir=
"curr" />
166 <remap sourcePath=
"/Currencies%variant" targetDir=
"curr" />
167 <remap sourcePath=
"/CurrencyPlurals" targetDir=
"curr" />
168 <remap sourcePath=
"/CurrencyUnitPatterns" targetDir=
"curr" />
169 <remap sourcePath=
"/currencySpacing" targetDir=
"curr" />
170 <remap sourcePath=
"/zoneStrings" targetDir=
"zone" />
171 <remap sourcePath=
"/durationUnits" targetDir=
"unit" />
172 <remap sourcePath=
"/units" targetDir=
"unit" />
173 <remap sourcePath=
"/unitsShort" targetDir=
"unit" />
174 <remap sourcePath=
"/unitsNarrow" targetDir=
"unit" />
176 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
178 &icu-locale-deprecates;
182 <target name=
"collation" depends=
"init,setup,proddata" description=
"builds collation files in ICU text format">
183 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
186 <arg name=
"--sourcedir" value=
"${cldr.prod.dir}/common/collation" />
187 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/coll"/>
188 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/collation"/>
189 <arg name=
"--type" value=
"collation"/>
191 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
193 &icu-coll-deprecates;
197 <target name=
"rbnf" depends=
"init,setup,proddata" description=
"builds rbnf files in ICU text format">
198 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
201 <arg name=
"--sourcedir" value=
"${cldr.prod.dir}/common/rbnf" />
202 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/rbnf"/>
203 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/rbnf"/>
204 <arg name=
"--type" value=
"rbnf" />
206 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
208 &icu-rbnf-deprecates;
212 <target name=
"supplementalData" depends=
"init,setup,proddata" description=
"builds supplementalData.txt from supplementalData.xml">
213 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"supplementalData.txt" noArgs=
"true">
214 <!-- launch the tool and generate the data after reading the config file -->
217 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
218 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
219 <arg name=
"-t" value=
"supplementalData"/>
222 <remap sourcePath=
"/CurrencyMap" targetDir=
"curr" />
223 <remap sourcePath=
"/CurrencyMeta" targetDir=
"curr" />
228 <target name=
"metadata" depends=
"init,setup,proddata" description=
"builds metadata.txt from supplementalMetadata.xml">
229 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metadata.txt" noArgs=
"true">
230 <!-- launch the tool and generate the data after reading the config file -->
233 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
234 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
235 <arg name=
"-t" value=
"metadata"/>
240 <target name=
"metaZones" depends=
"init,setup,proddata" description=
"builds metaZones.txt from metaZones.xml">
241 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metaZones.txt" noArgs=
"true">
242 <!-- launch the tool and generate the data after reading the config file -->
245 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
246 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
247 <arg name=
"-t" value=
"metaZones"/>
252 <target name=
"windowsZones" depends=
"init,setup,proddata" description=
"builds windowsZones.txt from windowsZones.xml">
253 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"windowsZones.txt" noArgs=
"true">
254 <!-- launch the tool and generate the data after reading the config file -->
257 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
258 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
259 <arg name=
"-t" value=
"windowsZones"/>
264 <target name=
"likelySubtags" depends=
"init,setup,proddata" description=
"builds likelySubtags.txt from likelySubtags.xml">
265 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"likelySubtags.txt" noArgs=
"true">
266 <!-- launch the tool and generate the data after reading the config file -->
269 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
270 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
271 <arg name=
"-t" value=
"likelySubtags"/>
276 <target name=
"plurals" depends=
"init,setup,proddata" description=
"builds plurals.txt from plurals.xml">
277 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"plurals.txt" noArgs=
"true">
278 <!-- launch the tool and generate the data after reading the config file -->
281 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
282 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
283 <arg name=
"-t" value=
"plurals"/>
288 <target name=
"pluralRanges" depends=
"init,setup,proddata" description=
"builds pluralRanges.txt from pluralRanges.xml">
289 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"pluralRanges.txt" noArgs=
"true">
290 <!-- launch the tool and generate the data after reading the config file -->
293 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
294 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
295 <arg name=
"-t" value=
"pluralRanges"/>
300 <target name=
"numberingSystems" depends=
"init,setup,proddata" description=
"builds numberingSystems.txt from numberingSystems.xml">
301 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"numberingSystems.txt" noArgs=
"true">
302 <!-- launch the tool and generate the data after reading the config file -->
305 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
306 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
307 <arg name=
"-t" value=
"numberingSystems"/>
312 <target name=
"genderList" depends=
"init,setup,proddata" description=
"builds genderList.txt from genderList.xml">
313 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"genderList.txt" noArgs=
"true">
314 <!-- launch the tool and generate the data after reading the config file -->
317 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
318 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
319 <arg name=
"-t" value=
"genderList"/>
324 <target name=
"dayPeriods" depends=
"init,setup,proddata" description=
"builds dayPeriods.txt from dayPeriods.xml">
325 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"dayPeriods.txt" noArgs=
"true">
326 <!-- launch the tool and generate the data after reading the config file -->
329 <arg name=
"-s" value=
"${cldr.prod.dir}/common/supplemental" />
330 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
331 <arg name=
"-t" value=
"dayPeriods"/>
336 <target name=
"brkitr" depends=
"init,setup,proddata" description=
"builds break iterator files in ICU text format">
337 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
340 <arg name=
"--sourcedir" value=
"${cldr.prod.dir}/common/segments"/>
341 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/brkitr"/>
342 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/brkitr"/>
343 <arg name=
"--type" value=
"brkitr" />
345 <!-- The entity include is not required for this target -->
346 <!-- http://ant.apache.org/faq.html#xml-entity-include
353 <target name=
"keyTypeData" depends=
"init,setup,proddata" description=
"builds keyTypeData.txt and timezoneTypes.txt from bcp47/*.xml">
354 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" noArgs=
"true">
357 <arg name=
"-s" value=
"${cldr.prod.dir}/common/bcp47" />
358 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
359 <arg name=
"-t" value=
"keyTypeData"/>
365 <target name=
"translit" depends=
"init,setup,proddata" description=
"builds collation files in ICU text format">
366 <cldr-build toolName=
"org.unicode.cldr.icu.ConvertTransforms" srcFile=
".*xml" destFile=
".*txt">
369 <arg name=
"-m" value=
"((?!.*(Canadian|Ethiopic|ug-Latin).*).*)" />
370 <arg name=
"--sourcedir" value=
"${cldr.prod.dir}/common/transforms" />
371 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/translit"/>
372 <arg name=
"--commentSkip"/>
373 <arg name=
"--approvedOnly"/>
375 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
380 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
382 <target name="trnsfiles" depends="init, setup,proddata" description="builds trnsfiles.mk">
383 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
385 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
386 <arg name=-"-sourcedir" value="${cldr.prod.dir}/common/transforms" />
387 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
388 <arg name=-"-commentSkip"/>
389 <arg name=-"-writeIndex"/>
394 <target name=
"clean" depends=
"init, setup, cleanprod" description=
"deletes all txt files and mk files from coll and locales directories">
396 <fileset id=
"locales" dir=
"${env.ICU4C_DIR}/source/data/locales">
397 <include name=
"*.txt" />
399 <fileset id=
"resfiles" dir=
"${env.ICU4C_DIR}/source/data/locales">
400 <include name=
"resfiles.mk" />
402 <fileset id=
"dependencies_py" dir=
"${env.ICU4C_DIR}/source/python/icutools/databuilder">
403 <include name=
"locale_dependencies.py" />
405 <fileset id=
"locales_split" dir=
"${env.ICU4C_DIR}/source/data">
406 <include name=
"curr/*.txt" />
407 <include name=
"curr/resfiles.mk" />
408 <include name=
"lang/*.txt" />
409 <include name=
"lang/resfiles.mk" />
410 <include name=
"region/*.txt" />
411 <include name=
"region/resfiles.mk" />
412 <include name=
"zone/*.txt" />
413 <include name=
"zone/resfiles.mk" />
414 <exclude name=
"zone/tzdbNames.txt" />
415 <include name=
"unit/*.txt" />
416 <include name=
"unit/resfiles.mk" />
418 <fileset id=
"collation" dir=
"${env.ICU4C_DIR}/source/data/coll">
419 <include name=
"*.txt" />
421 <fileset id=
"colfiles" dir=
"${env.ICU4C_DIR}/source/data/coll">
422 <include name=
"colfiles.mk" />
424 <fileset id=
"translit" dir=
"${env.ICU4C_DIR}/source/data/translit">
425 <include name=
"*_*.txt" />
426 <include name=
"root.txt" />
428 <fileset id=
"brkitr" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
429 <include name=
"*.txt"/>
431 <fileset id=
"brkfiles" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
432 <include name=
"brkfiles.mk" />
434 <fileset id=
"supplementalData" dir=
"${env.ICU4C_DIR}/source/data/misc">
435 <include name=
"supplementalData.txt" />
437 <fileset id=
"rbnf" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
438 <include name=
"*.txt" />
440 <fileset id=
"rbnffiles" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
441 <include name=
"rbnffiles.mk" />
443 <fileset id=
"metadata" dir=
"${env.ICU4C_DIR}/source/data/misc">
444 <include name=
"metadata.txt" />
446 <fileset id=
"metaZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
447 <include name=
"metaZones.txt" />
449 <fileset id=
"windowsZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
450 <include name=
"windowsZones.txt" />
452 <fileset id=
"likelySubtags" dir=
"${env.ICU4C_DIR}/source/data/misc">
453 <include name=
"likelySubtags.txt" />
455 <fileset id=
"plurals" dir=
"${env.ICU4C_DIR}/source/data/misc">
456 <include name=
"plurals.txt" />
458 <fileset id=
"pluralRanges" dir=
"${env.ICU4C_DIR}/source/data/misc">
459 <include name=
"pluralRanges.txt" />
461 <fileset id=
"numberingSystems" dir=
"${env.ICU4C_DIR}/source/data/misc">
462 <include name=
"numberingSystems.txt" />
464 <fileset id=
"keyTypeData" dir=
"${env.ICU4C_DIR}/source/data/misc">
465 <include name=
"keyTypeData.txt" />
466 <include name=
"timezoneTypes.txt" />
468 <fileset id=
"genderList" dir=
"${env.ICU4C_DIR}/source/data/misc">
469 <include name=
"genderList.txt" />
471 <fileset id=
"dayPeriods" dir=
"${env.ICU4C_DIR}/source/data/misc">
472 <include name=
"dayPeriods.txt" />