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 *******************************************************************************
10 * Copyright (C) 2005-2015, International Business Machines Corporation and *
11 * others. All Rights Reserved. *
12 *******************************************************************************
15 <project name=
"icu-build" default=
"all" basedir=
".">
19 <!-- Load environment variables -->
20 <property environment=
"env"/>
22 <!-- Ant won't set properties that have already been set, so environment variables that have been set before won't be clobbered. -->
23 <property name=
"env.ICU4C_DIR" location=
"../.."/>
25 <condition property=
"is.cldr.dir.set" >
26 <isset property=
"env.CLDR_DIR" />
28 <fail unless=
"is.cldr.dir.set" message=
"Please set the CLDR_DIR environment variable to the top level ICU source dir (containing 'common')."/>
30 <available property=
"cldrtools.dir" value=
"${env.CLDR_DIR}/cldr-tools" file=
"${env.CLDR_DIR}/cldr-tools" type=
"dir"/>
31 <available property=
"cldrtools.dir" value=
"${env.CLDR_DIR}/tools/java" file=
"${env.CLDR_DIR}/tools/java" type=
"dir"/>
32 <fail unless=
"cldrtools.dir" message=
"Please make sure that the CLDR tools directory is checked out into CLDR_DIR"/>
34 <available property=
"env.CLDR_CLASSES" value=
"${cldrtools.dir}/classes" file=
"${cldrtools.dir}/classes" type=
"dir"/>
35 <available property=
"cldrtools.jar" value=
"${cldrtools.dir}/cldr.jar" file=
"${cldrtools.dir}/cldr.jar" type=
"file"/>
36 <condition property=
"is.cldr.classes.set">
38 <isset property=
"env.CLDR_CLASSES" />
39 <isset property=
"cldrtools.jar" />
42 <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."/>
44 <echo message=
"java home: ${java.home}"/>
45 <echo message=
"java version: ${java.version}"/>
46 <echo message=
"ant java version: ${ant.java.version}"/>
47 <echo message=
"${ant.version}"/>
50 <taskdef name=
"cldr-build" classname=
"org.unicode.cldr.ant.CLDRBuild">
52 <pathelement path=
"${java.class.path}/"/>
53 <pathelement path=
"${env.CLDR_CLASSES}"/>
54 <pathelement location=
"${cldrtools.jar}"/>
55 <fileset dir=
"${cldrtools.dir}/libs" includes=
"*.jar"/>
59 <!-- target for generating ICU data -->
60 <target name=
"all" depends=
"locales, collation, rbnf, supplementalData, metadata, metaZones, windowsZones, likelySubtags, plurals, numberingSystems, translit, brkitr, keyTypeData, genderList, dayPeriods" />
61 <!-- parallel target -->
62 <target name=
"pall" depends=
"init">
63 <parallel threadsPerProcessor =
"1">
65 <ant target='locales'
/>
68 <ant target='collation'
>
75 <ant target='supplementalData'
>
82 <ant target='translit'
>
84 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
88 <ant target='keyTypeData'
/>
91 <ant target='genderList'
/>
94 <ant target='dayPeriods'
/>
99 <target name=
"locales" depends=
"init,setup" description=
"builds locale files in ICU text format">
100 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
101 <!-- launch the tool and generate the data after reading the config file -->
104 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/main" />
105 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/locales"/>
106 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/main"/>
107 <arg name=
"--supplementaldir" value=
"${env.CLDR_DIR}/common/supplemental" />
108 <arg name=
"--type" value=
"locales"/>
109 <arg name=
"--makefile" value=
"resfiles.mk"/>
112 <remap sourcePath=
"/Keys" targetDir=
"lang" />
113 <remap sourcePath=
"/Languages" targetDir=
"lang" />
114 <remap sourcePath=
"/Languages%short" targetDir=
"lang" />
115 <remap sourcePath=
"/Languages%secondary" targetDir=
"lang" />
116 <remap sourcePath=
"/Languages%variant" targetDir=
"lang" />
117 <remap sourcePath=
"/Scripts" targetDir=
"lang" />
118 <remap sourcePath=
"/Scripts%secondary" targetDir=
"lang" />
119 <remap sourcePath=
"/Scripts%short" targetDir=
"lang" />
120 <remap sourcePath=
"/Scripts%stand-alone" targetDir=
"lang" />
121 <remap sourcePath=
"/Scripts%variant" targetDir=
"lang" />
122 <remap sourcePath=
"/Types" targetDir=
"lang" />
123 <remap sourcePath=
"/Types%short" targetDir=
"lang" />
124 <remap sourcePath=
"/Variants" targetDir=
"lang" />
125 <remap sourcePath=
"/Variants%secondary" targetDir=
"lang" />
126 <remap sourcePath=
"/codePatterns" targetDir=
"lang" />
127 <remap sourcePath=
"/localeDisplayPattern" targetDir=
"lang" />
128 <remap sourcePath=
"/Countries" targetDir=
"region" />
129 <remap sourcePath=
"/Countries%variant" targetDir=
"region" />
130 <remap sourcePath=
"/Countries%short" targetDir=
"region" />
131 <remap sourcePath=
"/Currencies" targetDir=
"curr" />
132 <remap sourcePath=
"/Currencies%narrow" targetDir=
"curr" />
133 <remap sourcePath=
"/Currencies%variant" targetDir=
"curr" />
134 <remap sourcePath=
"/CurrencyPlurals" targetDir=
"curr" />
135 <remap sourcePath=
"/CurrencyUnitPatterns" targetDir=
"curr" />
136 <remap sourcePath=
"/currencySpacing" targetDir=
"curr" />
137 <remap sourcePath=
"/zoneStrings" targetDir=
"zone" />
138 <remap sourcePath=
"/durationUnits" targetDir=
"unit" />
139 <remap sourcePath=
"/units" targetDir=
"unit" />
140 <remap sourcePath=
"/unitsShort" targetDir=
"unit" />
141 <remap sourcePath=
"/unitsNarrow" targetDir=
"unit" />
143 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
145 &icu-locale-deprecates;
149 <target name=
"collation" depends=
"init,setup" description=
"builds collation files in ICU text format">
150 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
153 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/collation" />
154 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/coll"/>
155 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/collation"/>
156 <arg name=
"--type" value=
"collation"/>
157 <arg name=
"--makefile" value=
"colfiles.mk"/>
159 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
161 &icu-coll-deprecates;
165 <target name=
"rbnf" depends=
"init,setup" description=
"builds rbnf files in ICU text format">
166 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
169 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/rbnf" />
170 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/rbnf"/>
171 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/rbnf"/>
172 <arg name=
"--type" value=
"rbnf" />
173 <arg name=
"--makefile" value=
"rbnffiles.mk"/>
175 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
177 &icu-rbnf-deprecates;
181 <target name=
"supplementalData" depends=
"init,setup" description=
"builds supplementalData.txt from supplementalData.xml">
182 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"supplementalData.txt" noArgs=
"true">
183 <!-- launch the tool and generate the data after reading the config file -->
186 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
187 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
188 <arg name=
"-t" value=
"supplementalData"/>
191 <remap sourcePath=
"/CurrencyMap" targetDir=
"curr" />
192 <remap sourcePath=
"/CurrencyMeta" targetDir=
"curr" />
197 <target name=
"metadata" depends=
"init,setup" description=
"builds metadata.txt from supplementalMetadata.xml">
198 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metadata.txt" noArgs=
"true">
199 <!-- launch the tool and generate the data after reading the config file -->
202 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
203 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
204 <arg name=
"-t" value=
"metadata"/>
209 <target name=
"metaZones" depends=
"init,setup" description=
"builds metaZones.txt from metaZones.xml">
210 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"metaZones.txt" noArgs=
"true">
211 <!-- launch the tool and generate the data after reading the config file -->
214 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
215 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
216 <arg name=
"-t" value=
"metaZones"/>
221 <target name=
"windowsZones" depends=
"init,setup" description=
"builds windowsZones.txt from windowsZones.xml">
222 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"windowsZones.txt" noArgs=
"true">
223 <!-- launch the tool and generate the data after reading the config file -->
226 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
227 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
228 <arg name=
"-t" value=
"windowsZones"/>
233 <target name=
"likelySubtags" depends=
"init,setup" description=
"builds likelySubtags.txt from likelySubtags.xml">
234 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"likelySubtags.txt" noArgs=
"true">
235 <!-- launch the tool and generate the data after reading the config file -->
238 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
239 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
240 <arg name=
"-t" value=
"likelySubtags"/>
245 <target name=
"plurals" depends=
"init,setup" description=
"builds plurals.txt from plurals.xml">
246 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"plurals.txt" noArgs=
"true">
247 <!-- launch the tool and generate the data after reading the config file -->
250 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
251 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
252 <arg name=
"-t" value=
"plurals"/>
257 <target name=
"numberingSystems" depends=
"init,setup" description=
"builds numberingSystems.txt from numberingSystems.xml">
258 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"numberingSystems.txt" noArgs=
"true">
259 <!-- launch the tool and generate the data after reading the config file -->
262 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
263 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
264 <arg name=
"-t" value=
"numberingSystems"/>
269 <target name=
"genderList" depends=
"init,setup" description=
"builds genderList.txt from genderList.xml">
270 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"genderList.txt" noArgs=
"true">
271 <!-- launch the tool and generate the data after reading the config file -->
274 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
275 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
276 <arg name=
"-t" value=
"genderList"/>
281 <target name=
"dayPeriods" depends=
"init,setup" description=
"builds dayPeriods.txt from dayPeriods.xml">
282 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" destFile=
"dayPeriods.txt" noArgs=
"true">
283 <!-- launch the tool and generate the data after reading the config file -->
286 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/supplemental" />
287 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
288 <arg name=
"-t" value=
"dayPeriods"/>
293 <target name=
"brkitr" depends=
"init,setup" description=
"builds break iterator files in ICU text format">
294 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=
".*xml" destFile=
".*txt">
297 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/segments"/>
298 <arg name=
"--specialsdir" value=
"${env.ICU4C_DIR}/source/data/xml/brkitr"/>
299 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/brkitr"/>
300 <arg name=
"--type" value=
"brkitr" />
301 <arg name=
"--makefile" value=
"brkfiles.mk"/>
303 <!-- The entity include is not required for this target -->
304 <!-- http://ant.apache.org/faq.html#xml-entity-include
311 <target name=
"keyTypeData" depends=
"init,setup" description=
"builds keyTypeData.txt and timezoneTypes.txt from bcp47/*.xml">
312 <cldr-build toolName=
"org.unicode.cldr.icu.NewLdml2IcuConverter" noArgs=
"true">
315 <arg name=
"-s" value=
"${env.CLDR_DIR}/common/bcp47" />
316 <arg name=
"-d" value=
"${env.ICU4C_DIR}/source/data/misc"/>
317 <arg name=
"-t" value=
"keyTypeData"/>
323 <target name=
"translit" depends=
"init,setup" description=
"builds collation files in ICU text format">
324 <cldr-build toolName=
"org.unicode.cldr.icu.ConvertTransforms" srcFile=
".*xml" destFile=
".*txt">
327 <arg name=
"-m" value=
"((?!.*(Canadian|Ethiopic|ug-Latin).*).*)" />
328 <arg name=
"--sourcedir" value=
"${env.CLDR_DIR}/common/transforms" />
329 <arg name=
"--destdir" value=
"${env.ICU4C_DIR}/source/data/translit"/>
330 <arg name=
"--commentSkip"/>
332 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
337 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
339 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk">
340 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
342 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
343 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" />
344 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
345 <arg name=-"-commentSkip"/>
346 <arg name=-"-writeIndex"/>
351 <target name=
"clean" depends=
"init, setup" description=
"deletes all txt files and mk files from coll and locales directories">
353 <fileset id=
"locales" dir=
"${env.ICU4C_DIR}/source/data/locales">
354 <include name=
"*.txt" />
356 <fileset id=
"resfiles" dir=
"${env.ICU4C_DIR}/source/data/locales">
357 <include name=
"resfiles.mk" />
359 <fileset id=
"locales_split" dir=
"${env.ICU4C_DIR}/source/data">
360 <include name=
"curr/*.txt" />
361 <include name=
"curr/resfiles.mk" />
362 <include name=
"lang/*.txt" />
363 <include name=
"lang/resfiles.mk" />
364 <include name=
"region/*.txt" />
365 <include name=
"region/resfiles.mk" />
366 <include name=
"zone/*.txt" />
367 <include name=
"zone/resfiles.mk" />
368 <exclude name=
"zone/tzdbNames.txt" />
369 <include name=
"unit/*.txt" />
370 <include name=
"unit/resfiles.mk" />
372 <fileset id=
"collation" dir=
"${env.ICU4C_DIR}/source/data/coll">
373 <include name=
"*.txt" />
375 <fileset id=
"colfiles" dir=
"${env.ICU4C_DIR}/source/data/coll">
376 <include name=
"colfiles.mk" />
378 <fileset id=
"translit" dir=
"${env.ICU4C_DIR}/source/data/translit">
379 <include name=
"*_*.txt" />
380 <include name=
"root.txt" />
382 <fileset id=
"brkitr" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
383 <include name=
"*.txt"/>
385 <fileset id=
"brkfiles" dir=
"${env.ICU4C_DIR}/source/data/brkitr">
386 <include name=
"brkfiles.mk" />
388 <fileset id=
"supplementalData" dir=
"${env.ICU4C_DIR}/source/data/misc">
389 <include name=
"supplementalData.txt" />
391 <fileset id=
"rbnf" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
392 <include name=
"*.txt" />
394 <fileset id=
"rbnffiles" dir=
"${env.ICU4C_DIR}/source/data/rbnf">
395 <include name=
"rbnffiles.mk" />
397 <fileset id=
"metadata" dir=
"${env.ICU4C_DIR}/source/data/misc">
398 <include name=
"metadata.txt" />
400 <fileset id=
"metaZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
401 <include name=
"metaZones.txt" />
403 <fileset id=
"windowsZones" dir=
"${env.ICU4C_DIR}/source/data/misc">
404 <include name=
"windowsZones.txt" />
406 <fileset id=
"likelySubtags" dir=
"${env.ICU4C_DIR}/source/data/misc">
407 <include name=
"likelySubtags.txt" />
409 <fileset id=
"plurals" dir=
"${env.ICU4C_DIR}/source/data/misc">
410 <include name=
"plurals.txt" />
412 <fileset id=
"numberingSystems" dir=
"${env.ICU4C_DIR}/source/data/misc">
413 <include name=
"numberingSystems.txt" />
415 <fileset id=
"keyTypeData" dir=
"${env.ICU4C_DIR}/source/data/misc">
416 <include name=
"keyTypeData.txt" />
417 <include name=
"timezoneTypes.txt" />
419 <fileset id=
"genderList" dir=
"${env.ICU4C_DIR}/source/data/misc">
420 <include name=
"genderList.txt" />
422 <fileset id=
"dayPeriods" dir=
"${env.ICU4C_DIR}/source/data/misc">
423 <include name=
"dayPeriods.txt" />