]> git.saurik.com Git - apple/icu.git/blame - icuSources/data/build.xml
ICU-531.31.tar.gz
[apple/icu.git] / icuSources / data / build.xml
CommitLineData
73c04bcf 1<!DOCTYPE project [
46f4442e 2 <!ENTITY icu-config SYSTEM "./icu-config.xml">
729e4ab9 3 <!ENTITY icu-locale-deprecates SYSTEM "./icu-locale-deprecates.xml">
57a6839d 4 <!ENTITY icu-coll-deprecates SYSTEM "./icu-coll-deprecates.xml">
73c04bcf
A
5]>
6<!--
7/*
8*******************************************************************************
57a6839d 9* Copyright (C) 2005-2014, International Business Machines Corporation and *
73c04bcf
A
10* others. All Rights Reserved. *
11*******************************************************************************
12*/
13-->
14<project name="icu-build" default="all" basedir=".">
15 <target name="init">
16 <tstamp/>
46f4442e 17
73c04bcf
A
18 <!-- Load environment variables -->
19 <property environment="env"/>
46f4442e 20
57a6839d
A
21 <!-- Ant won't set properties that have already been set, so environment variables that have been set before won't be clobbered. -->
22 <property name="env.ICU4C_DIR" location="../.."/>
46f4442e 23
57a6839d 24 <condition property="is.cldr.dir.set" >
73c04bcf 25 <isset property="env.CLDR_DIR" />
46f4442e 26 </condition >
57a6839d 27 <fail unless="is.cldr.dir.set" message="Please set the CLDR_DIR environment variable to the top level ICU source dir (containing 'common')."/>
46f4442e 28
57a6839d
A
29 <available property="cldrtools.dir" value="${env.CLDR_DIR}/cldr-tools" file="${env.CLDR_DIR}/cldr-tools" type="dir"/>
30 <available property="cldrtools.dir" value="${env.CLDR_DIR}/tools/java" file="${env.CLDR_DIR}/tools/java" type="dir"/>
31 <fail unless="cldrtools.dir" message="Please make sure that the CLDR tools directory is checked out into CLDR_DIR"/>
73c04bcf 32
57a6839d
A
33 <available property="env.CLDR_CLASSES" value="${cldrtools.dir}/classes" file="${cldrtools.dir}/classes" type="dir"/>
34 <available property="cldrtools.jar" value="${cldrtools.dir}/cldr.jar" file="${cldrtools.dir}/cldr.jar" type="file"/>
35 <condition property="is.cldr.classes.set">
73c04bcf 36 <or>
57a6839d
A
37 <isset property="env.CLDR_CLASSES" />
38 <isset property="cldrtools.jar" />
73c04bcf 39 </or>
57a6839d
A
40 </condition>
41 <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."/>
46f4442e 42
57a6839d 43 <echo message="java home: ${java.home}"/>
73c04bcf
A
44 <echo message="java version: ${java.version}"/>
45 <echo message="ant java version: ${ant.java.version}"/>
46 <echo message="${ant.version}"/>
47 </target>
48 <target name="setup">
73c04bcf
A
49 <taskdef name="cldr-build" classname="org.unicode.cldr.ant.CLDRBuild">
50 <classpath>
51 <pathelement path="${java.class.path}/"/>
73c04bcf 52 <pathelement path="${env.CLDR_CLASSES}"/>
57a6839d
A
53 <pathelement location="${cldrtools.jar}"/>
54 <fileset dir="${cldrtools.dir}/libs" includes="*.jar"/>
73c04bcf 55 </classpath>
46f4442e 56 </taskdef>
73c04bcf
A
57 </target>
58 <!-- target for generating ICU data -->
57a6839d 59 <target name="all" depends="locales, collation, rbnf, supplementalData, metadata, metaZones, windowsZones, likelySubtags, plurals, numberingSystems, translit, brkitr, keyTypeData, genderList, postalCodeData, dayPeriods" />
46f4442e
A
60 <!-- parallel target -->
61 <target name="pall" depends="init">
62 <parallel threadsPerProcessor ="1">
63 <sequential>
729e4ab9 64 <ant target='locales' />
46f4442e
A
65 </sequential>
66 <sequential>
67 <ant target='collation'>
68 </ant>
46f4442e 69 </sequential>
729e4ab9
A
70 <sequential>
71 <ant target='rbnf'>
72 </ant>
729e4ab9 73 </sequential>
46f4442e
A
74 <ant target='supplementalData'>
75 </ant>
76 <sequential>
77 <ant target='brkitr'>
78 </ant>
46f4442e
A
79 </sequential>
80 <sequential>
81 <ant target='translit'>
82 </ant>
729e4ab9
A
83 <!--<ant target='trnsfiles'></ant> Not ANT-built - see
84 note below. -->
46f4442e 85 </sequential>
57a6839d
A
86 <sequential>
87 <ant target='keyTypeData'/>
88 </sequential>
89 <sequential>
90 <ant target='genderList'/>
91 </sequential>
92 <sequential>
93 <ant target='postalCodeData'/>
94 </sequential>
95 <sequential>
96 <ant target='dayPeriods'/>
97 </sequential>
46f4442e
A
98 </parallel>
99 </target>
100
73c04bcf 101 <target name="locales" depends="init,setup" description="builds locale files in ICU text format">
51004dcb 102 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
73c04bcf
A
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" />
51004dcb 110 <arg name="--type" value="locales"/>
57a6839d 111 <arg name="--makefile" value="resfiles.mk"/>
73c04bcf 112 </args>
729e4ab9
A
113 <remapper>
114 <remap sourcePath="/Keys" targetDir="lang" />
115 <remap sourcePath="/Languages" targetDir="lang" />
116 <remap sourcePath="/LanguagesShort" targetDir="lang" />
117 <remap sourcePath="/Scripts" targetDir="lang" />
4388f060 118 <remap sourcePath="/Scripts%stand-alone" targetDir="lang" />
729e4ab9
A
119 <remap sourcePath="/Types" targetDir="lang" />
120 <remap sourcePath="/Variants" targetDir="lang" />
121 <remap sourcePath="/codePatterns" targetDir="lang" />
122 <remap sourcePath="/localeDisplayPattern" targetDir="lang" />
123 <remap sourcePath="/Countries" targetDir="region" />
57a6839d 124 <remap sourcePath="/CountriesShort" targetDir="region" />
729e4ab9
A
125 <remap sourcePath="/Currencies" targetDir="curr" />
126 <remap sourcePath="/CurrencyPlurals" targetDir="curr" />
127 <remap sourcePath="/CurrencyUnitPatterns" targetDir="curr" />
128 <remap sourcePath="/currencySpacing" targetDir="curr" />
129 <remap sourcePath="/zoneStrings" targetDir="zone" />
130 </remapper>
73c04bcf
A
131 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
132 &icu-config;
57a6839d 133 &icu-locale-deprecates;
73c04bcf
A
134 </run>
135 </cldr-build>
136 </target>
137 <target name="collation" depends="init,setup" description="builds collation files in ICU text format">
57a6839d 138 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
73c04bcf
A
139 <run>
140 <args>
141 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/collation" />
142 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/coll"/>
143 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/collation"/>
57a6839d
A
144 <arg name="--type" value="collation"/>
145 <arg name="--makefile" value="colfiles.mk"/>
73c04bcf
A
146 </args>
147 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
148 &icu-config;
57a6839d 149 &icu-coll-deprecates;
73c04bcf
A
150 </run>
151 </cldr-build>
152 </target>
729e4ab9 153 <target name="rbnf" depends="init,setup" description="builds rbnf files in ICU text format">
57a6839d 154 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
729e4ab9
A
155 <run>
156 <args>
157 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/rbnf" />
158 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/rbnf"/>
159 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/rbnf"/>
57a6839d
A
160 <arg name="--type" value="rbnf" />
161 <arg name="--makefile" value="rbnffiles.mk"/>
729e4ab9
A
162 </args>
163 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
164 &icu-config;
165 </run>
166 </cldr-build>
167 </target>
73c04bcf 168 <target name="supplementalData" depends="init,setup" description="builds supplementalData.txt from supplementalData.xml">
51004dcb 169 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="supplementalData.txt" noArgs="true">
73c04bcf
A
170 <!-- launch the tool and generate the data after reading the config file -->
171 <run>
172 <args>
173 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
174 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 175 <arg name="-t" value="supplementalData"/>
73c04bcf 176 </args>
729e4ab9
A
177 <remapper>
178 <remap sourcePath="/CurrencyMap" targetDir="curr" />
179 <remap sourcePath="/CurrencyMeta" targetDir="curr" />
180 </remapper>
73c04bcf
A
181 </run>
182 </cldr-build>
183 </target>
4388f060 184 <target name="metadata" depends="init,setup" description="builds metadata.txt from supplementalMetadata.xml">
51004dcb 185 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="metadata.txt" noArgs="true">
4388f060
A
186 <!-- launch the tool and generate the data after reading the config file -->
187 <run>
188 <args>
189 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
190 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 191 <arg name="-t" value="metadata"/>
4388f060
A
192 </args>
193 </run>
194 </cldr-build>
195 </target>
729e4ab9 196 <target name="metaZones" depends="init,setup" description="builds metaZones.txt from metaZones.xml">
51004dcb 197 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="metaZones.txt" noArgs="true">
46f4442e
A
198 <!-- launch the tool and generate the data after reading the config file -->
199 <run>
200 <args>
201 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
202 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 203 <arg name="-t" value="metaZones"/>
46f4442e
A
204 </args>
205 </run>
206 </cldr-build>
207 </target>
729e4ab9 208 <target name="windowsZones" depends="init,setup" description="builds windowsZones.txt from windowsZones.xml">
51004dcb 209 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="windowsZones.txt" noArgs="true">
729e4ab9
A
210 <!-- launch the tool and generate the data after reading the config file -->
211 <run>
212 <args>
213 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
214 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 215 <arg name="-t" value="windowsZones"/>
729e4ab9
A
216 </args>
217 </run>
218 </cldr-build>
219 </target>
46f4442e 220 <target name="likelySubtags" depends="init,setup" description="builds likelySubtags.txt from likelySubtags.xml">
51004dcb 221 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="likelySubtags.txt" noArgs="true">
46f4442e
A
222 <!-- launch the tool and generate the data after reading the config file -->
223 <run>
224 <args>
225 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
226 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 227 <arg name="-t" value="likelySubtags"/>
46f4442e
A
228 </args>
229 </run>
230 </cldr-build>
231 </target>
232 <target name="plurals" depends="init,setup" description="builds plurals.txt from plurals.xml">
51004dcb 233 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="plurals.txt" noArgs="true">
46f4442e
A
234 <!-- launch the tool and generate the data after reading the config file -->
235 <run>
236 <args>
237 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
238 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 239 <arg name="-t" value="plurals"/>
46f4442e
A
240 </args>
241 </run>
242 </cldr-build>
243 </target>
729e4ab9 244 <target name="numberingSystems" depends="init,setup" description="builds numberingSystems.txt from numberingSystems.xml">
51004dcb 245 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="numberingSystems.txt" noArgs="true">
729e4ab9
A
246 <!-- launch the tool and generate the data after reading the config file -->
247 <run>
248 <args>
249 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
250 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 251 <arg name="-t" value="numberingSystems"/>
51004dcb
A
252 </args>
253 </run>
254 </cldr-build>
255 </target>
256 <target name="genderList" depends="init,setup" description="builds genderList.txt from genderList.xml">
257 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="genderList.txt" noArgs="true">
258 <!-- launch the tool and generate the data after reading the config file -->
259 <run>
260 <args>
261 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
262 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
263 <arg name="-t" value="genderList"/>
51004dcb
A
264 </args>
265 </run>
266 </cldr-build>
267 </target>
268 <target name="postalCodeData" depends="init,setup" description="builds postalCodeData.txt from postalCodeData.xml">
269 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="postalCodeData.txt" noArgs="true">
270 <!-- launch the tool and generate the data after reading the config file -->
271 <run>
272 <args>
273 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
274 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
275 <arg name="-t" value="postalCodeData"/>
51004dcb
A
276 </args>
277 </run>
278 </cldr-build>
279 </target>
280 <target name="dayPeriods" depends="init,setup" description="builds dayPeriods.txt from dayPeriods.xml">
281 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="dayPeriods.txt" noArgs="true">
282 <!-- launch the tool and generate the data after reading the config file -->
283 <run>
284 <args>
285 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" />
286 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
287 <arg name="-t" value="dayPeriods"/>
729e4ab9
A
288 </args>
289 </run>
290 </cldr-build>
291 </target>
73c04bcf 292 <target name="brkitr" depends="init,setup" description="builds break iterator files in ICU text format">
57a6839d 293 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt">
73c04bcf
A
294 <run>
295 <args>
57a6839d
A
296 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/segments"/>
297 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/brkitr"/>
73c04bcf 298 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/brkitr"/>
57a6839d
A
299 <arg name="--type" value="brkitr" />
300 <arg name="--makefile" value="brkfiles.mk"/>
73c04bcf
A
301 </args>
302 <!-- The entity include is not required for this target -->
46f4442e 303 <!-- http://ant.apache.org/faq.html#xml-entity-include
73c04bcf
A
304 &icu-config;
305 -->
306 </run>
307 </cldr-build>
308 </target>
729e4ab9
A
309
310 <target name="keyTypeData" depends="init,setup" description="builds keyTypeData.txt and timezoneTypes.txt from bcp47/*.xml">
51004dcb 311 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" noArgs="true">
729e4ab9
A
312 <run>
313 <args>
314 <arg name="-s" value="${env.CLDR_DIR}/common/bcp47" />
729e4ab9 315 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/>
51004dcb 316 <arg name="-t" value="keyTypeData"/>
729e4ab9
A
317 </args>
318 </run>
319 </cldr-build>
320 </target>
321
57a6839d 322 <target name="translit" depends="init,setup" description="builds collation files in ICU text format">
73c04bcf
A
323 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile=".*txt">
324 <run>
325 <args>
57a6839d 326 <arg name="-m" value="((?!.*(Canadian|Ethiopic|ug-Latin).*).*)" />
73c04bcf
A
327 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/transforms" />
328 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
329 <arg name="--commentSkip"/>
330 </args>
331 <!-- http://ant.apache.org/faq.html#xml-entity-include -->
46f4442e 332
73c04bcf
A
333 </run>
334 </cldr-build>
335 </target>
46f4442e
A
336 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. -->
337<!--
338 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk">
339 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true">
73c04bcf 340 <run>
46f4442e
A
341 <args> [ double hyphen not allowed in comments - transpose -" to fix below ]
342 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" />
343 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/>
344 <arg name=-"-commentSkip"/>
345 <arg name=-"-writeIndex"/>
73c04bcf 346 </args>
73c04bcf
A
347 </run>
348 </cldr-build>
46f4442e 349 </target> -->
73c04bcf
A
350 <target name="clean" depends="init, setup" description="deletes all txt files and mk files from coll and locales directories">
351 <delete>
352 <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/locales">
353 <include name="*.txt" />
46f4442e
A
354 </fileset>
355 <fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales">
73c04bcf
A
356 <include name="resfiles.mk" />
357 </fileset>
729e4ab9
A
358 <fileset id="locales_split" dir="${env.ICU4C_DIR}/source/data">
359 <include name="curr/*.txt" />
360 <include name="curr/resfiles.mk" />
361 <include name="lang/*.txt" />
362 <include name="lang/resfiles.mk" />
363 <include name="region/*.txt" />
364 <include name="region/resfiles.mk" />
365 <include name="zone/*.txt" />
366 <include name="zone/resfiles.mk" />
367 </fileset>
46f4442e 368 <fileset id="collation" dir="${env.ICU4C_DIR}/source/data/coll">
73c04bcf 369 <include name="*.txt" />
46f4442e
A
370 </fileset>
371 <fileset id="colfiles" dir="${env.ICU4C_DIR}/source/data/coll">
73c04bcf
A
372 <include name="colfiles.mk" />
373 </fileset>
729e4ab9 374 <fileset id="translit" dir="${env.ICU4C_DIR}/source/data/translit">
46f4442e
A
375 <include name="*_*.txt" />
376 <include name="root.txt" />
377 </fileset>
729e4ab9 378 <fileset id="brkitr" dir="${env.ICU4C_DIR}/source/data/brkitr">
46f4442e 379 <!-- brkitr directory contains bunch of txt files that are not produced by LDML2ICUConverter.
73c04bcf 380 So can't clean up everything. This needs to be updated when new files are added to xml/brkitr directory -->
729e4ab9
A
381 <include name="root.txt" />
382 <include name="el.txt" />
383 <include name="en.txt" />
384 <include name="en_US.txt" />
385 <include name="en_US_POSIX.txt" />
386 <include name="fi.txt" />
729e4ab9 387 <include name="ja.txt" />
729e4ab9
A
388 </fileset>
389 <fileset id="brkfiles" dir="${env.ICU4C_DIR}/source/data/brkitr">
73c04bcf
A
390 <include name="brkfiles.mk" />
391 </fileset>
46f4442e
A
392 <fileset id="supplementalData" dir="${env.ICU4C_DIR}/source/data/misc">
393 <include name="supplementalData.txt" />
394 </fileset>
729e4ab9
A
395 <fileset id="rbnf" dir="${env.ICU4C_DIR}/source/data/rbnf">
396 <include name="*.txt" />
397 </fileset>
398 <fileset id="rbnffiles" dir="${env.ICU4C_DIR}/source/data/rbnf">
399 <include name="rbnffiles.mk" />
400 </fileset>
4388f060
A
401 <fileset id="metadata" dir="${env.ICU4C_DIR}/source/data/misc">
402 <include name="metadata.txt" />
403 </fileset>
729e4ab9
A
404 <fileset id="metaZones" dir="${env.ICU4C_DIR}/source/data/misc">
405 <include name="metaZones.txt" />
406 </fileset>
407 <fileset id="windowsZones" dir="${env.ICU4C_DIR}/source/data/misc">
408 <include name="windowsZones.txt" />
46f4442e
A
409 </fileset>
410 <fileset id="likelySubtags" dir="${env.ICU4C_DIR}/source/data/misc">
411 <include name="likelySubtags.txt" />
412 </fileset>
413 <fileset id="plurals" dir="${env.ICU4C_DIR}/source/data/misc">
414 <include name="plurals.txt" />
73c04bcf 415 </fileset>
729e4ab9
A
416 <fileset id="numberingSystems" dir="${env.ICU4C_DIR}/source/data/misc">
417 <include name="numberingSystems.txt" />
418 </fileset>
419 <fileset id="keyTypeData" dir="${env.ICU4C_DIR}/source/data/misc">
420 <include name="keyTypeData.txt" />
421 <include name="timezoneTypes.txt" />
422 </fileset>
51004dcb
A
423 <fileset id="genderList" dir="${env.ICU4C_DIR}/source/data/misc">
424 <include name="genderList.txt" />
425 </fileset>
426 <fileset id="postalCodeData" dir="${env.ICU4C_DIR}/source/data/misc">
427 <include name="postalCodeData.txt" />
428 </fileset>
429 <fileset id="dayPeriods" dir="${env.ICU4C_DIR}/source/data/misc">
430 <include name="dayPeriods.txt" />
431 </fileset>
73c04bcf
A
432 </delete>
433 </target>
46f4442e 434</project>