]> git.saurik.com Git - apple/icu.git/blob - icuSources/data/build.xml
ICU-64252.0.1.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 <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}"/>
50 <echo message="cldr tools dir: ${cldrtools.dir}"/>
51 <echo message="cldr tools jar: ${cldrtools.jar}"/>
52 <echo message="cldr tools classes: ${env.CLDR_CLASSES}"/>
53 </target>
54 <target name="setup" depends="init">
55 <taskdef name="cldr-build" classname="org.unicode.cldr.ant.CLDRBuild">
56 <classpath>
57 <pathelement path="${java.class.path}/"/>
58 <pathelement path="${env.CLDR_CLASSES}"/>
59 <pathelement location="${cldrtools.jar}"/>
60 <fileset dir="${cldrtools.dir}/libs" includes="*.jar"/>
61 </classpath>
62 </taskdef>
63 </target>
64 <!-- target for generating ICU data -->
65 <target name="all" depends="locales, collation, rbnf, supplementalData, metadata, metaZones, windowsZones, likelySubtags, plurals, pluralRanges, numberingSystems, translit, brkitr, keyTypeData, genderList, dayPeriods" />
66 <!-- parallel target -->
67 <target name="pall" depends="init">
68 <parallel threadsPerProcessor ="1">
69 <sequential>
70 <ant target='locales' />
71 </sequential>
72 <sequential>
73 <ant target='collation'>
74 </ant>
75 </sequential>
76 <sequential>
77 <ant target='rbnf'>
78 </ant>
79 </sequential>
80 <ant target='supplementalData'>
81 </ant>
82 <sequential>
83 <ant target='brkitr'>
84 </ant>
85 </sequential>
86 <sequential>
87 <ant target='translit'>
88 </ant>
89 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
90 note below. -->
91 </sequential>
92 <sequential>
93 <ant target='keyTypeData'/>
94 </sequential>
95 <sequential>
96 <ant target='genderList'/>
97 </sequential>
98 <sequential>
99 <ant target='dayPeriods'/>
100 </sequential>
101 </parallel>
102 </target>
103
104 <target name="locales" depends="init,setup" description="builds locale files in ICU text format">
105 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
106 <!-- launch the tool and generate the data after reading the config file -->
107 <run>
108 <args>
109 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/main" />
110 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/locales"/>
111 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/main"/>
112 <arg name="--supplementaldir" value="${env.CLDR_DIR}/common/supplemental" />
113 <arg name="--type" value="locales"/>
114 <arg name="--depgraphfile" value="../buildtool/locale_dependencies.py"/>
115 </args>
116 <remapper>
117 <remap sourcePath="/Keys" targetDir="lang" />
118 <remap sourcePath="/Languages" targetDir="lang" />
119 <remap sourcePath="/Languages%long" targetDir="lang" />
120 <remap sourcePath="/Languages%short" targetDir="lang" />
121 <remap sourcePath="/Languages%secondary" targetDir="lang" />
122 <remap sourcePath="/Languages%variant" targetDir="lang" />
123 <remap sourcePath="/Scripts" targetDir="lang" />
124 <remap sourcePath="/Scripts%secondary" targetDir="lang" />
125 <remap sourcePath="/Scripts%short" targetDir="lang" />
126 <remap sourcePath="/Scripts%stand-alone" targetDir="lang" />
127 <remap sourcePath="/Scripts%variant" targetDir="lang" />
128 <remap sourcePath="/Types" targetDir="lang" />
129 <remap sourcePath="/Types%short" targetDir="lang" />
130 <remap sourcePath="/Variants" targetDir="lang" />
131 <remap sourcePath="/Variants%secondary" targetDir="lang" />
132 <remap sourcePath="/characterLabelPattern" targetDir="lang" />
133 <remap sourcePath="/codePatterns" targetDir="lang" />
134 <remap sourcePath="/localeDisplayPattern" targetDir="lang" />
135 <remap sourcePath="/Countries" targetDir="region" />
136 <remap sourcePath="/Countries%variant" targetDir="region" />
137 <remap sourcePath="/Countries%short" targetDir="region" />
138 <remap sourcePath="/Currencies" targetDir="curr" />
139 <remap sourcePath="/Currencies%formal" targetDir="curr" />
140 <remap sourcePath="/Currencies%narrow" targetDir="curr" />
141 <remap sourcePath="/Currencies%variant" targetDir="curr" />
142 <remap sourcePath="/CurrencyPlurals" targetDir="curr" />
143 <remap sourcePath="/CurrencyUnitPatterns" targetDir="curr" />
144 <remap sourcePath="/currencySpacing" targetDir="curr" />
145 <remap sourcePath="/zoneStrings" targetDir="zone" />
146 <remap sourcePath="/durationUnits" targetDir="unit" />
147 <remap sourcePath="/units" targetDir="unit" />
148 <remap sourcePath="/unitsShort" targetDir="unit" />
149 <remap sourcePath="/unitsNarrow" targetDir="unit" />
150 </remapper>
151 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
152 &icu-config;
153 &icu-locale-deprecates;
154 </run>
155 </cldr-build>
156 </target>
157 <target name="collation" depends="init,setup" description="builds collation files in ICU text format">
158 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
159 <run>
160 <args>
161 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/collation" />
162 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/coll"/>
163 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/collation"/>
164 <arg name="--type" value="collation"/>
165 </args>
166 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
167 &icu-config;
168 &icu-coll-deprecates;
169 </run>
170 </cldr-build>
171 </target>
172 <target name="rbnf" depends="init,setup" description="builds rbnf files in ICU text format">
173 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
174 <run>
175 <args>
176 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/rbnf" />
177 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/rbnf"/>
178 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/rbnf"/>
179 <arg name="--type" value="rbnf" />
180 </args>
181 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
182 &icu-config;
183 &icu-rbnf-deprecates;
184 </run>
185 </cldr-build>
186 </target>
187 <target name="supplementalData" depends="init,setup" description="builds supplementalData.txt from supplementalData.xml">
188 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="supplementalData.txt" noArgs="true">
189 <!-- launch the tool and generate the data after reading the config file -->
190 <run>
191 <args>
192 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
193 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
194 <arg name="-t" value="supplementalData"/>
195 </args>
196 <remapper>
197 <remap sourcePath="/CurrencyMap" targetDir="curr" />
198 <remap sourcePath="/CurrencyMeta" targetDir="curr" />
199 </remapper>
200 </run>
201 </cldr-build>
202 </target>
203 <target name="metadata" depends="init,setup" description="builds metadata.txt from supplementalMetadata.xml">
204 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="metadata.txt" noArgs="true">
205 <!-- launch the tool and generate the data after reading the config file -->
206 <run>
207 <args>
208 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
209 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
210 <arg name="-t" value="metadata"/>
211 </args>
212 </run>
213 </cldr-build>
214 </target>
215 <target name="metaZones" depends="init,setup" description="builds metaZones.txt from metaZones.xml">
216 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="metaZones.txt" noArgs="true">
217 <!-- launch the tool and generate the data after reading the config file -->
218 <run>
219 <args>
220 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
221 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
222 <arg name="-t" value="metaZones"/>
223 </args>
224 </run>
225 </cldr-build>
226 </target>
227 <target name="windowsZones" depends="init,setup" description="builds windowsZones.txt from windowsZones.xml">
228 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="windowsZones.txt" noArgs="true">
229 <!-- launch the tool and generate the data after reading the config file -->
230 <run>
231 <args>
232 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
233 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
234 <arg name="-t" value="windowsZones"/>
235 </args>
236 </run>
237 </cldr-build>
238 </target>
239 <target name="likelySubtags" depends="init,setup" description="builds likelySubtags.txt from likelySubtags.xml">
240 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="likelySubtags.txt" noArgs="true">
241 <!-- launch the tool and generate the data after reading the config file -->
242 <run>
243 <args>
244 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
245 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
246 <arg name="-t" value="likelySubtags"/>
247 </args>
248 </run>
249 </cldr-build>
250 </target>
251 <target name="plurals" depends="init,setup" description="builds plurals.txt from plurals.xml">
252 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="plurals.txt" noArgs="true">
253 <!-- launch the tool and generate the data after reading the config file -->
254 <run>
255 <args>
256 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
257 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
258 <arg name="-t" value="plurals"/>
259 </args>
260 </run>
261 </cldr-build>
262 </target>
263 <target name="pluralRanges" depends="init,setup" description="builds pluralRanges.txt from pluralRanges.xml">
264 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="pluralRanges.txt" noArgs="true">
265 <!-- launch the tool and generate the data after reading the config file -->
266 <run>
267 <args>
268 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
269 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
270 <arg name="-t" value="pluralRanges"/>
271 </args>
272 </run>
273 </cldr-build>
274 </target>
275 <target name="numberingSystems" depends="init,setup" description="builds numberingSystems.txt from numberingSystems.xml">
276 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="numberingSystems.txt" noArgs="true">
277 <!-- launch the tool and generate the data after reading the config file -->
278 <run>
279 <args>
280 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
281 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
282 <arg name="-t" value="numberingSystems"/>
283 </args>
284 </run>
285 </cldr-build>
286 </target>
287 <target name="genderList" depends="init,setup" description="builds genderList.txt from genderList.xml">
288 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="genderList.txt" noArgs="true">
289 <!-- launch the tool and generate the data after reading the config file -->
290 <run>
291 <args>
292 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
293 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
294 <arg name="-t" value="genderList"/>
295 </args>
296 </run>
297 </cldr-build>
298 </target>
299 <target name="dayPeriods" depends="init,setup" description="builds dayPeriods.txt from dayPeriods.xml">
300 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="dayPeriods.txt" noArgs="true">
301 <!-- launch the tool and generate the data after reading the config file -->
302 <run>
303 <args>
304 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
305 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
306 <arg name="-t" value="dayPeriods"/>
307 </args>
308 </run>
309 </cldr-build>
310 </target>
311 <target name="brkitr" depends="init,setup" description="builds break iterator files in ICU text format">
312 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
313 <run>
314 <args>
315 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/segments"/>
316 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/brkitr"/>
317 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/brkitr"/>
318 <arg name="--type" value="brkitr" />
319 </args>
320 <!-- The entity include is not required for this target -->
321 <!-- http://ant.apache.org/faq.html#xml-entity-include
322 &icu-config;
323 -->
324 </run>
325 </cldr-build>
326 </target>
327
328 <target name="keyTypeData" depends="init,setup" description="builds keyTypeData.txt and timezoneTypes.txt from bcp47/*.xml">
329 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" noArgs="true">
330 <run>
331 <args>
332 <arg name="-s" value="${env.CLDR_DIR}/common/bcp47" />
333 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
334 <arg name="-t" value="keyTypeData"/>
335 </args>
336 </run>
337 </cldr-build>
338 </target>
339
340 <target name="translit" depends="init,setup" description="builds collation files in ICU text format">
341 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile=".*txt">
342 <run>
343 <args>
344 <arg name="-m" value="((?!.*(Canadian|Ethiopic|ug-Latin).*).*)" />
345 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/transforms" />
346 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
347 <arg name="--commentSkip"/>
348 <arg name="--approvedOnly"/>
349 </args>
350 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
351
352 </run>
353 </cldr-build>
354 </target>
355 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
356 <!--
357 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk">
358 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
359 <run>
360 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
361 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" />
362 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
363 <arg name=-"-commentSkip"/>
364 <arg name=-"-writeIndex"/>
365 </args>
366 </run>
367 </cldr-build>
368 </target> -->
369 <target name="clean" depends="init, setup" description="deletes all txt files and mk files from coll and locales directories">
370 <delete>
371 <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/locales">
372 <include name="*.txt" />
373 </fileset>
374 <fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales">
375 <include name="resfiles.mk" />
376 </fileset>
377 <fileset id="dependencies_py" dir="${env.ICU4C_DIR}/source/data/buildtool">
378 <include name="locale_dependencies.py" />
379 </fileset>
380 <fileset id="locales_split" dir="${env.ICU4C_DIR}/source/data">
381 <include name="curr/*.txt" />
382 <include name="curr/resfiles.mk" />
383 <include name="lang/*.txt" />
384 <include name="lang/resfiles.mk" />
385 <include name="region/*.txt" />
386 <include name="region/resfiles.mk" />
387 <include name="zone/*.txt" />
388 <include name="zone/resfiles.mk" />
389 <exclude name="zone/tzdbNames.txt" />
390 <include name="unit/*.txt" />
391 <include name="unit/resfiles.mk" />
392 </fileset>
393 <fileset id="collation" dir="${env.ICU4C_DIR}/source/data/coll">
394 <include name="*.txt" />
395 </fileset>
396 <fileset id="colfiles" dir="${env.ICU4C_DIR}/source/data/coll">
397 <include name="colfiles.mk" />
398 </fileset>
399 <fileset id="translit" dir="${env.ICU4C_DIR}/source/data/translit">
400 <include name="*_*.txt" />
401 <include name="root.txt" />
402 </fileset>
403 <fileset id="brkitr" dir="${env.ICU4C_DIR}/source/data/brkitr">
404 <include name="*.txt"/>
405 </fileset>
406 <fileset id="brkfiles" dir="${env.ICU4C_DIR}/source/data/brkitr">
407 <include name="brkfiles.mk" />
408 </fileset>
409 <fileset id="supplementalData" dir="${env.ICU4C_DIR}/source/data/misc">
410 <include name="supplementalData.txt" />
411 </fileset>
412 <fileset id="rbnf" dir="${env.ICU4C_DIR}/source/data/rbnf">
413 <include name="*.txt" />
414 </fileset>
415 <fileset id="rbnffiles" dir="${env.ICU4C_DIR}/source/data/rbnf">
416 <include name="rbnffiles.mk" />
417 </fileset>
418 <fileset id="metadata" dir="${env.ICU4C_DIR}/source/data/misc">
419 <include name="metadata.txt" />
420 </fileset>
421 <fileset id="metaZones" dir="${env.ICU4C_DIR}/source/data/misc">
422 <include name="metaZones.txt" />
423 </fileset>
424 <fileset id="windowsZones" dir="${env.ICU4C_DIR}/source/data/misc">
425 <include name="windowsZones.txt" />
426 </fileset>
427 <fileset id="likelySubtags" dir="${env.ICU4C_DIR}/source/data/misc">
428 <include name="likelySubtags.txt" />
429 </fileset>
430 <fileset id="plurals" dir="${env.ICU4C_DIR}/source/data/misc">
431 <include name="plurals.txt" />
432 </fileset>
433 <fileset id="pluralRanges" dir="${env.ICU4C_DIR}/source/data/misc">
434 <include name="pluralRanges.txt" />
435 </fileset>
436 <fileset id="numberingSystems" dir="${env.ICU4C_DIR}/source/data/misc">
437 <include name="numberingSystems.txt" />
438 </fileset>
439 <fileset id="keyTypeData" dir="${env.ICU4C_DIR}/source/data/misc">
440 <include name="keyTypeData.txt" />
441 <include name="timezoneTypes.txt" />
442 </fileset>
443 <fileset id="genderList" dir="${env.ICU4C_DIR}/source/data/misc">
444 <include name="genderList.txt" />
445 </fileset>
446 <fileset id="dayPeriods" dir="${env.ICU4C_DIR}/source/data/misc">
447 <include name="dayPeriods.txt" />
448 </fileset>
449 </delete>
450 </target>
451 </project>