]> git.saurik.com Git - apple/icu.git/blob - icuSources/data/build.xml
ICU-66108.tar.gz
[apple/icu.git] / icuSources / data / build.xml
1 <!DOCTYPE project [
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">
6 ]>
7 <!--
8 /*
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 *******************************************************************************
15 */
16 -->
17 <project name="icu-build" default="all" basedir=".">
18 <target name="init">
19 <tstamp/>
20
21 <!-- Load environment variables -->
22 <property environment="env"/>
23
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="../.."/>
26
27 <condition property="is.cldr.dir.set" >
28 <isset property="env.CLDR_DIR" />
29 </condition >
30 <fail unless="is.cldr.dir.set" message="Please set the CLDR_DIR environment variable to the top level CLDR source dir (containing 'common')."/>
31
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"/>
35
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">
39 <or>
40 <isset property="env.CLDR_CLASSES" />
41 <isset property="cldrtools.jar" />
42 </or>
43 </condition>
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."/>
45
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}"/>
57 </target>
58 <target name="setup" depends="init">
59 <taskdef name="cldr-build" classname="org.unicode.cldr.ant.CLDRBuild">
60 <classpath>
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"/>
65 </classpath>
66 </taskdef>
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"/>
70 </condition>
71 </target>
72
73 <target name="cleanprod" depends="init, setup" if="cldrprod.exists">
74 <delete dir="${cldr.prod.dir}" />
75 </target>
76 <target name="proddata" depends="init,setup" unless="cldrprod.exists">
77 <echo message="Rebuilding ${cldr.prod.dir} - takes a while!"/>
78
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 -->
82 <arg value="-v" />
83 <!-- TODO: for now, we just let the default source/target paths used.
84 could set '-s' / '-d' for explicit source/dest -->
85 </java>
86 </target>
87
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">
93 <sequential>
94 <ant target='locales' />
95 </sequential>
96 <sequential>
97 <ant target='collation'>
98 </ant>
99 </sequential>
100 <sequential>
101 <ant target='rbnf'>
102 </ant>
103 </sequential>
104 <ant target='supplementalData'>
105 </ant>
106 <sequential>
107 <ant target='brkitr'>
108 </ant>
109 </sequential>
110 <sequential>
111 <ant target='translit'>
112 </ant>
113 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
114 note below. -->
115 </sequential>
116 <sequential>
117 <ant target='keyTypeData'/>
118 </sequential>
119 <sequential>
120 <ant target='genderList'/>
121 </sequential>
122 <sequential>
123 <ant target='dayPeriods'/>
124 </sequential>
125 </parallel>
126 </target>
127
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 -->
131 <run>
132 <args>
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"/>
139 </args>
140 <remapper>
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" />
175 </remapper>
176 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
177 &icu-config;
178 &icu-locale-deprecates;
179 </run>
180 </cldr-build>
181 </target>
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">
184 <run>
185 <args>
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"/>
190 </args>
191 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
192 &icu-config;
193 &icu-coll-deprecates;
194 </run>
195 </cldr-build>
196 </target>
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">
199 <run>
200 <args>
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" />
205 </args>
206 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
207 &icu-config;
208 &icu-rbnf-deprecates;
209 </run>
210 </cldr-build>
211 </target>
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 -->
215 <run>
216 <args>
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"/>
220 </args>
221 <remapper>
222 <remap sourcePath="/CurrencyMap" targetDir="curr" />
223 <remap sourcePath="/CurrencyMeta" targetDir="curr" />
224 </remapper>
225 </run>
226 </cldr-build>
227 </target>
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 -->
231 <run>
232 <args>
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"/>
236 </args>
237 </run>
238 </cldr-build>
239 </target>
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 -->
243 <run>
244 <args>
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"/>
248 </args>
249 </run>
250 </cldr-build>
251 </target>
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 -->
255 <run>
256 <args>
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"/>
260 </args>
261 </run>
262 </cldr-build>
263 </target>
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 -->
267 <run>
268 <args>
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"/>
272 </args>
273 </run>
274 </cldr-build>
275 </target>
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 -->
279 <run>
280 <args>
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"/>
284 </args>
285 </run>
286 </cldr-build>
287 </target>
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 -->
291 <run>
292 <args>
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"/>
296 </args>
297 </run>
298 </cldr-build>
299 </target>
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 -->
303 <run>
304 <args>
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"/>
308 </args>
309 </run>
310 </cldr-build>
311 </target>
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 -->
315 <run>
316 <args>
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"/>
320 </args>
321 </run>
322 </cldr-build>
323 </target>
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 -->
327 <run>
328 <args>
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"/>
332 </args>
333 </run>
334 </cldr-build>
335 </target>
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">
338 <run>
339 <args>
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" />
344 </args>
345 <!-- The entity include is not required for this target -->
346 <!-- http://ant.apache.org/faq.html#xml-entity-include
347 &icu-config;
348 -->
349 </run>
350 </cldr-build>
351 </target>
352
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">
355 <run>
356 <args>
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"/>
360 </args>
361 </run>
362 </cldr-build>
363 </target>
364
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">
367 <run>
368 <args>
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"/>
374 </args>
375 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
376
377 </run>
378 </cldr-build>
379 </target>
380 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
381 <!--
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">
384 <run>
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"/>
390 </args>
391 </run>
392 </cldr-build>
393 </target> -->
394 <target name="clean" depends="init, setup, cleanprod" description="deletes all txt files and mk files from coll and locales directories">
395 <delete>
396 <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/locales">
397 <include name="*.txt" />
398 </fileset>
399 <fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales">
400 <include name="resfiles.mk" />
401 </fileset>
402 <fileset id="dependencies_py" dir="${env.ICU4C_DIR}/source/python/icutools/databuilder">
403 <include name="locale_dependencies.py" />
404 </fileset>
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" />
417 </fileset>
418 <fileset id="collation" dir="${env.ICU4C_DIR}/source/data/coll">
419 <include name="*.txt" />
420 </fileset>
421 <fileset id="colfiles" dir="${env.ICU4C_DIR}/source/data/coll">
422 <include name="colfiles.mk" />
423 </fileset>
424 <fileset id="translit" dir="${env.ICU4C_DIR}/source/data/translit">
425 <include name="*_*.txt" />
426 <include name="root.txt" />
427 </fileset>
428 <fileset id="brkitr" dir="${env.ICU4C_DIR}/source/data/brkitr">
429 <include name="*.txt"/>
430 </fileset>
431 <fileset id="brkfiles" dir="${env.ICU4C_DIR}/source/data/brkitr">
432 <include name="brkfiles.mk" />
433 </fileset>
434 <fileset id="supplementalData" dir="${env.ICU4C_DIR}/source/data/misc">
435 <include name="supplementalData.txt" />
436 </fileset>
437 <fileset id="rbnf" dir="${env.ICU4C_DIR}/source/data/rbnf">
438 <include name="*.txt" />
439 </fileset>
440 <fileset id="rbnffiles" dir="${env.ICU4C_DIR}/source/data/rbnf">
441 <include name="rbnffiles.mk" />
442 </fileset>
443 <fileset id="metadata" dir="${env.ICU4C_DIR}/source/data/misc">
444 <include name="metadata.txt" />
445 </fileset>
446 <fileset id="metaZones" dir="${env.ICU4C_DIR}/source/data/misc">
447 <include name="metaZones.txt" />
448 </fileset>
449 <fileset id="windowsZones" dir="${env.ICU4C_DIR}/source/data/misc">
450 <include name="windowsZones.txt" />
451 </fileset>
452 <fileset id="likelySubtags" dir="${env.ICU4C_DIR}/source/data/misc">
453 <include name="likelySubtags.txt" />
454 </fileset>
455 <fileset id="plurals" dir="${env.ICU4C_DIR}/source/data/misc">
456 <include name="plurals.txt" />
457 </fileset>
458 <fileset id="pluralRanges" dir="${env.ICU4C_DIR}/source/data/misc">
459 <include name="pluralRanges.txt" />
460 </fileset>
461 <fileset id="numberingSystems" dir="${env.ICU4C_DIR}/source/data/misc">
462 <include name="numberingSystems.txt" />
463 </fileset>
464 <fileset id="keyTypeData" dir="${env.ICU4C_DIR}/source/data/misc">
465 <include name="keyTypeData.txt" />
466 <include name="timezoneTypes.txt" />
467 </fileset>
468 <fileset id="genderList" dir="${env.ICU4C_DIR}/source/data/misc">
469 <include name="genderList.txt" />
470 </fileset>
471 <fileset id="dayPeriods" dir="${env.ICU4C_DIR}/source/data/misc">
472 <include name="dayPeriods.txt" />
473 </fileset>
474 </delete>
475 </target>
476 </project>