]> git.saurik.com Git - apple/icu.git/blame_incremental - icuSources/data/build.xml
ICU-62109.0.1.tar.gz
[apple/icu.git] / icuSources / data / build.xml
... / ...
CommitLineData
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 ICU 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 </target>
51 <target name="setup">
52 <taskdef name="cldr-build" classname="org.unicode.cldr.ant.CLDRBuild">
53 <classpath>
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"/>
58 </classpath>
59 </taskdef>
60 </target>
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">
66 <sequential>
67 <ant target='locales' />
68 </sequential>
69 <sequential>
70 <ant target='collation'>
71 </ant>
72 </sequential>
73 <sequential>
74 <ant target='rbnf'>
75 </ant>
76 </sequential>
77 <ant target='supplementalData'>
78 </ant>
79 <sequential>
80 <ant target='brkitr'>
81 </ant>
82 </sequential>
83 <sequential>
84 <ant target='translit'>
85 </ant>
86 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
87 note below. -->
88 </sequential>
89 <sequential>
90 <ant target='keyTypeData'/>
91 </sequential>
92 <sequential>
93 <ant target='genderList'/>
94 </sequential>
95 <sequential>
96 <ant target='dayPeriods'/>
97 </sequential>
98 </parallel>
99 </target>
100
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 -->
104 <run>
105 <args>
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"/>
112 </args>
113 <remapper>
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" />
146 </remapper>
147 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
148 &icu-config;
149 &icu-locale-deprecates;
150 </run>
151 </cldr-build>
152 </target>
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">
155 <run>
156 <args>
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"/>
162 </args>
163 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
164 &icu-config;
165 &icu-coll-deprecates;
166 </run>
167 </cldr-build>
168 </target>
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">
171 <run>
172 <args>
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"/>
178 </args>
179 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
180 &icu-config;
181 &icu-rbnf-deprecates;
182 </run>
183 </cldr-build>
184 </target>
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 -->
188 <run>
189 <args>
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"/>
193 </args>
194 <remapper>
195 <remap sourcePath="/CurrencyMap" targetDir="curr" />
196 <remap sourcePath="/CurrencyMeta" targetDir="curr" />
197 </remapper>
198 </run>
199 </cldr-build>
200 </target>
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 -->
204 <run>
205 <args>
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"/>
209 </args>
210 </run>
211 </cldr-build>
212 </target>
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 -->
216 <run>
217 <args>
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"/>
221 </args>
222 </run>
223 </cldr-build>
224 </target>
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 -->
228 <run>
229 <args>
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"/>
233 </args>
234 </run>
235 </cldr-build>
236 </target>
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 -->
240 <run>
241 <args>
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"/>
245 </args>
246 </run>
247 </cldr-build>
248 </target>
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 -->
252 <run>
253 <args>
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"/>
257 </args>
258 </run>
259 </cldr-build>
260 </target>
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 -->
264 <run>
265 <args>
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"/>
269 </args>
270 </run>
271 </cldr-build>
272 </target>
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 -->
276 <run>
277 <args>
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"/>
281 </args>
282 </run>
283 </cldr-build>
284 </target>
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 -->
288 <run>
289 <args>
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"/>
293 </args>
294 </run>
295 </cldr-build>
296 </target>
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">
299 <run>
300 <args>
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"/>
306 </args>
307 <!-- The entity include is not required for this target -->
308 <!-- http://ant.apache.org/faq.html#xml-entity-include
309 &icu-config;
310 -->
311 </run>
312 </cldr-build>
313 </target>
314
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">
317 <run>
318 <args>
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"/>
322 </args>
323 </run>
324 </cldr-build>
325 </target>
326
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">
329 <run>
330 <args>
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"/>
335 <arg name="--approvedOnly"/>
336 </args>
337 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
338
339 </run>
340 </cldr-build>
341 </target>
342 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
343<!--
344 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk">
345 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
346 <run>
347 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
348 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" />
349 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
350 <arg name=-"-commentSkip"/>
351 <arg name=-"-writeIndex"/>
352 </args>
353 </run>
354 </cldr-build>
355 </target> -->
356 <target name="clean" depends="init, setup" description="deletes all txt files and mk files from coll and locales directories">
357 <delete>
358 <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/locales">
359 <include name="*.txt" />
360 </fileset>
361 <fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales">
362 <include name="resfiles.mk" />
363 </fileset>
364 <fileset id="locales_split" dir="${env.ICU4C_DIR}/source/data">
365 <include name="curr/*.txt" />
366 <include name="curr/resfiles.mk" />
367 <include name="lang/*.txt" />
368 <include name="lang/resfiles.mk" />
369 <include name="region/*.txt" />
370 <include name="region/resfiles.mk" />
371 <include name="zone/*.txt" />
372 <include name="zone/resfiles.mk" />
373 <exclude name="zone/tzdbNames.txt" />
374 <include name="unit/*.txt" />
375 <include name="unit/resfiles.mk" />
376 </fileset>
377 <fileset id="collation" dir="${env.ICU4C_DIR}/source/data/coll">
378 <include name="*.txt" />
379 </fileset>
380 <fileset id="colfiles" dir="${env.ICU4C_DIR}/source/data/coll">
381 <include name="colfiles.mk" />
382 </fileset>
383 <fileset id="translit" dir="${env.ICU4C_DIR}/source/data/translit">
384 <include name="*_*.txt" />
385 <include name="root.txt" />
386 </fileset>
387 <fileset id="brkitr" dir="${env.ICU4C_DIR}/source/data/brkitr">
388 <include name="*.txt"/>
389 </fileset>
390 <fileset id="brkfiles" dir="${env.ICU4C_DIR}/source/data/brkitr">
391 <include name="brkfiles.mk" />
392 </fileset>
393 <fileset id="supplementalData" dir="${env.ICU4C_DIR}/source/data/misc">
394 <include name="supplementalData.txt" />
395 </fileset>
396 <fileset id="rbnf" dir="${env.ICU4C_DIR}/source/data/rbnf">
397 <include name="*.txt" />
398 </fileset>
399 <fileset id="rbnffiles" dir="${env.ICU4C_DIR}/source/data/rbnf">
400 <include name="rbnffiles.mk" />
401 </fileset>
402 <fileset id="metadata" dir="${env.ICU4C_DIR}/source/data/misc">
403 <include name="metadata.txt" />
404 </fileset>
405 <fileset id="metaZones" dir="${env.ICU4C_DIR}/source/data/misc">
406 <include name="metaZones.txt" />
407 </fileset>
408 <fileset id="windowsZones" dir="${env.ICU4C_DIR}/source/data/misc">
409 <include name="windowsZones.txt" />
410 </fileset>
411 <fileset id="likelySubtags" dir="${env.ICU4C_DIR}/source/data/misc">
412 <include name="likelySubtags.txt" />
413 </fileset>
414 <fileset id="plurals" dir="${env.ICU4C_DIR}/source/data/misc">
415 <include name="plurals.txt" />
416 </fileset>
417 <fileset id="numberingSystems" dir="${env.ICU4C_DIR}/source/data/misc">
418 <include name="numberingSystems.txt" />
419 </fileset>
420 <fileset id="keyTypeData" dir="${env.ICU4C_DIR}/source/data/misc">
421 <include name="keyTypeData.txt" />
422 <include name="timezoneTypes.txt" />
423 </fileset>
424 <fileset id="genderList" dir="${env.ICU4C_DIR}/source/data/misc">
425 <include name="genderList.txt" />
426 </fileset>
427 <fileset id="dayPeriods" dir="${env.ICU4C_DIR}/source/data/misc">
428 <include name="dayPeriods.txt" />
429 </fileset>
430 </delete>
431 </target>
432</project>