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"/>
336 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
341 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
343 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk">
344 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
346 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
347 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" />
348 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
349 <arg name=-"-commentSkip"/>
350 <arg name=-"-writeIndex"/>
355 <target name="clean" depends="init, setup" description="deletes all txt files and mk files from coll and locales directories">
357 <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/locales">
358 <include name="*.txt" />
360 <fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales">
361 <include name="resfiles.mk" />
363 <fileset id="locales_split" dir="${env.ICU4C_DIR}/source/data">
364 <include name="curr/*.txt" />
365 <include name="curr/resfiles.mk" />
366 <include name="lang/*.txt" />
367 <include name="lang/resfiles.mk" />
368 <include name="region/*.txt" />
369 <include name="region/resfiles.mk" />
370 <include name="zone/*.txt" />
371 <include name="zone/resfiles.mk" />
372 <exclude name="zone/tzdbNames.txt" />
373 <include name="unit/*.txt" />
374 <include name="unit/resfiles.mk" />
376 <fileset id="collation" dir="${env.ICU4C_DIR}/source/data/coll">
377 <include name="*.txt" />
379 <fileset id="colfiles" dir="${env.ICU4C_DIR}/source/data/coll">
380 <include name="colfiles.mk" />
382 <fileset id="translit" dir="${env.ICU4C_DIR}/source/data/translit">
383 <include name="*_*.txt" />
384 <include name="root.txt" />
386 <fileset id="brkitr" dir="${env.ICU4C_DIR}/source/data/brkitr">
387 <include name="*.txt"/>
389 <fileset id="brkfiles" dir="${env.ICU4C_DIR}/source/data/brkitr">
390 <include name="brkfiles.mk" />
392 <fileset id="supplementalData" dir="${env.ICU4C_DIR}/source/data/misc">
393 <include name="supplementalData.txt" />
395 <fileset id="rbnf" dir="${env.ICU4C_DIR}/source/data/rbnf">
396 <include name="*.txt" />
398 <fileset id="rbnffiles" dir="${env.ICU4C_DIR}/source/data/rbnf">
399 <include name="rbnffiles.mk" />
401 <fileset id="metadata" dir="${env.ICU4C_DIR}/source/data/misc">
402 <include name="metadata.txt" />
404 <fileset id="metaZones" dir="${env.ICU4C_DIR}/source/data/misc">
405 <include name="metaZones.txt" />
407 <fileset id="windowsZones" dir="${env.ICU4C_DIR}/source/data/misc">
408 <include name="windowsZones.txt" />
410 <fileset id="likelySubtags" dir="${env.ICU4C_DIR}/source/data/misc">
411 <include name="likelySubtags.txt" />
413 <fileset id="plurals" dir="${env.ICU4C_DIR}/source/data/misc">
414 <include name="plurals.txt" />
416 <fileset id="numberingSystems" dir="${env.ICU4C_DIR}/source/data/misc">
417 <include name="numberingSystems.txt" />
419 <fileset id="keyTypeData" dir="${env.ICU4C_DIR}/source/data/misc">
420 <include name="keyTypeData.txt" />
421 <include name="timezoneTypes.txt" />
423 <fileset id="genderList" dir="${env.ICU4C_DIR}/source/data/misc">
424 <include name="genderList.txt" />
426 <fileset id="dayPeriods" dir="${env.ICU4C_DIR}/source/data/misc">
427 <include name="dayPeriods.txt" />