]>
Commit | Line | Data |
---|---|---|
73c04bcf | 1 | <!DOCTYPE project [ |
46f4442e | 2 | <!ENTITY icu-config SYSTEM "./icu-config.xml"> |
73c04bcf A |
3 | ]> |
4 | <!-- | |
5 | /* | |
6 | ******************************************************************************* | |
46f4442e | 7 | * Copyright (C) 2005-2008, International Business Machines Corporation and * |
73c04bcf A |
8 | * others. All Rights Reserved. * |
9 | ******************************************************************************* | |
10 | */ | |
11 | --> | |
12 | <project name="icu-build" default="all" basedir="."> | |
13 | <target name="init"> | |
14 | <tstamp/> | |
46f4442e | 15 | |
73c04bcf A |
16 | <!-- Load environment variables --> |
17 | <property environment="env"/> | |
46f4442e | 18 | |
73c04bcf A |
19 | <condition property="is.icu4j.classes.set" > |
20 | <or> | |
21 | <isset property="env.ICU4J_CLASSES" /> | |
22 | <isset property="env.ICU4J_JAR" /> | |
23 | </or> | |
46f4442e | 24 | </condition > |
73c04bcf | 25 | <fail unless="is.icu4j.classes.set" message="Please set the ICU4J_CLASSES or ICU4J_JAR environment variable."/> |
46f4442e | 26 | |
73c04bcf A |
27 | <condition property="is.icu4c.dir.set" > |
28 | <isset property="env.ICU4C_DIR" /> | |
46f4442e | 29 | </condition > |
73c04bcf | 30 | <fail unless="is.icu4c.dir.set" message="Please set the ICU4C_DIR environment variable."/> |
46f4442e | 31 | |
73c04bcf A |
32 | <condition property="is.cldr.dir.set" > |
33 | <isset property="env.CLDR_DIR" /> | |
46f4442e | 34 | </condition > |
73c04bcf | 35 | <fail unless="is.cldr.dir.set" message="Please set the CLDR_DIR environment variable."/> |
46f4442e | 36 | |
73c04bcf A |
37 | <condition property="is.cldr.classes.set" > |
38 | <or> | |
39 | <isset property="env.CLDR_CLASSES" /> | |
40 | <isset property="env.CLDR_JAR" /> | |
41 | </or> | |
46f4442e | 42 | </condition > |
73c04bcf A |
43 | <fail unless="is.cldr.classes.set" message="Please set the CLDR_CLASSES or CLDR_JAR environment variable."/> |
44 | ||
45 | <condition property="is.utilities.classes.set" > | |
46 | <or> | |
47 | <isset property="env.ICU4J_CLASSES" /> | |
48 | <isset property="env.UTILITIES_JAR" /> | |
49 | </or> | |
46f4442e | 50 | </condition > |
73c04bcf | 51 | <fail unless="is.utilities.classes.set" message="Please set the ICU4J_CLASSES or UTILITIES_JAR environment variable."/> |
46f4442e | 52 | |
73c04bcf A |
53 | <echo message="java home: ${java.home}"/> |
54 | <echo message="java version: ${java.version}"/> | |
55 | <echo message="ant java version: ${ant.java.version}"/> | |
56 | <echo message="${ant.version}"/> | |
57 | </target> | |
58 | <target name="setup"> | |
46f4442e | 59 | |
73c04bcf A |
60 | <echo message="${env.CLDR_CLASSES}"/> |
61 | <taskdef name="cldr-build" classname="org.unicode.cldr.ant.CLDRBuild"> | |
62 | <classpath> | |
63 | <pathelement path="${java.class.path}/"/> | |
64 | <pathelement path="${env.ICU4J_CLASSES}"/> | |
65 | <pathelement path="${env.CLDR_CLASSES}"/> | |
66 | <pathelement location="${env.ICU4J_JAR}"/> | |
67 | <pathelement location="${env.CLDR_JAR}"/> | |
68 | <pathelement location="${env.UTILITIES_JAR}"/> | |
69 | </classpath> | |
46f4442e | 70 | </taskdef> |
73c04bcf A |
71 | </target> |
72 | <!-- target for generating ICU data --> | |
46f4442e A |
73 | <target name="all" depends="locales, resfiles, collation, colfiles, supplementalData, metazoneInfo, likelySubtags, plurals, translit, brkitr, brkfiles" /> |
74 | <!-- parallel target --> | |
75 | <target name="pall" depends="init"> | |
76 | <parallel threadsPerProcessor ="1"> | |
77 | <sequential> | |
78 | <ant target='locales'> | |
79 | </ant> | |
80 | <ant target='resfiles'> | |
81 | </ant> | |
82 | </sequential> | |
83 | <sequential> | |
84 | <ant target='collation'> | |
85 | </ant> | |
86 | <ant target='colfiles'> | |
87 | </ant> | |
88 | </sequential> | |
89 | <ant target='supplementalData'> | |
90 | </ant> | |
91 | <sequential> | |
92 | <ant target='brkitr'> | |
93 | </ant> | |
94 | <ant target='brkfiles'> | |
95 | </ant> | |
96 | </sequential> | |
97 | <sequential> | |
98 | <ant target='translit'> | |
99 | </ant> | |
100 | <!--<ant target='trnsfiles'></ant> Not ANT-built - see note below. --> | |
101 | </sequential> | |
102 | </parallel> | |
103 | </target> | |
104 | ||
73c04bcf A |
105 | <target name="locales" depends="init,setup" description="builds locale files in ICU text format"> |
106 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" srcFile=".*xml" destFile=".*txt"> | |
107 | <!-- launch the tool and generate the data after reading the config file --> | |
108 | <run> | |
109 | <args> | |
110 | <arg name="--sourcedir" value="${env.CLDR_DIR}/common/main" /> | |
111 | <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/locales"/> | |
112 | <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/main"/> | |
113 | <arg name="--supplementaldir" value="${env.CLDR_DIR}/common/supplemental" /> | |
114 | </args> | |
115 | <!-- http://ant.apache.org/faq.html#xml-entity-include --> | |
116 | &icu-config; | |
117 | </run> | |
118 | </cldr-build> | |
119 | </target> | |
120 | <target name="resfiles" depends="init,setup" description="builds resfiles.mk"> | |
121 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" destFile="resfiles.mk" noArgs="true"> | |
122 | <run> | |
123 | <args> | |
124 | <arg name="-s" value="${env.CLDR_DIR}/common/main" /> | |
125 | <arg name="-d" value="${env.ICU4C_DIR}/source/data/locales"/> | |
126 | <arg name="-p" value="${env.ICU4C_DIR}/source/data/xml/main"/> | |
127 | <arg name="-m" value="${env.CLDR_DIR}/common/supplemental" /> | |
128 | <arg name="-w" value="${env.CLDR_DIR}/common/main" /> | |
129 | </args> | |
130 | <!-- locale aliases (main) --> | |
46f4442e A |
131 | <deprecates> |
132 | <alias from="in_ID" to="id_ID" /> | |
133 | <alias from="iw_IL" to="he_IL" /> | |
134 | <alias from="ja_JP_TRADITIONAL" to="ja_JP@calendar=japanese" xpath="//ldml/dates/calendars/default[@type='japanese']"/> | |
135 | <alias from="no_NO" to="nb_NO" /> | |
73c04bcf | 136 | <alias from="no_NO_NY" to="nn_NO" /> |
46f4442e A |
137 | <alias from="en_RH" to="en_ZW" /> |
138 | <alias from="th_TH_TRADITIONAL" to="th_TH@calendar=buddhist" xpath="//ldml/dates/calendars/default[@type='buddhist']" /> | |
139 | <aliasLocale locale="az_AZ" /> | |
140 | <aliasLocale locale="ha_NG" /> | |
141 | <aliasLocale locale="kk_KZ" /> | |
142 | <aliasLocale locale="in" /> | |
143 | <aliasLocale locale="iw" /> | |
144 | <aliasLocale locale="no" /> | |
145 | <aliasLocale locale="pa_IN" /> | |
146 | <aliasLocale locale="pa_PK" /> | |
147 | <aliasLocale locale="sh" /> | |
148 | <aliasLocale locale="sh_BA" /> | |
149 | <aliasLocale locale="sh_CS" /> | |
150 | <aliasLocale locale="sh_YU" /> | |
151 | <aliasLocale locale="sr_BA" /> | |
152 | <aliasLocale locale="sr_CS" /> | |
153 | <aliasLocale locale="sr_ME" /> | |
154 | <aliasLocale locale="sr_RS" /> | |
155 | <aliasLocale locale="sr_YU" /> | |
156 | <aliasLocale locale="sr_Cyrl_YU" /> | |
157 | <aliasLocale locale="sr_Cyrl_CS" /> | |
158 | <aliasLocale locale="sr_Latn_YU" /> | |
159 | <aliasLocale locale="sr_Latn_CS" /> | |
160 | <aliasLocale locale="uz_AF" /> | |
161 | <aliasLocale locale="uz_UZ" /> | |
162 | <aliasLocale locale="zh_CN" /> | |
163 | <aliasLocale locale="zh_HK" /> | |
164 | <aliasLocale locale="zh_MO" /> | |
165 | <aliasLocale locale="zh_SG" /> | |
73c04bcf | 166 | <aliasLocale locale="zh_TW" /> |
46f4442e | 167 | </deprecates> |
73c04bcf A |
168 | </run> |
169 | </cldr-build> | |
170 | </target> | |
171 | <target name="collation" depends="init,setup" description="builds collation files in ICU text format"> | |
172 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" srcFile=".*xml" destFile=".*txt"> | |
173 | <run> | |
174 | <args> | |
175 | <arg name="--sourcedir" value="${env.CLDR_DIR}/common/collation" /> | |
176 | <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/coll"/> | |
177 | <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/collation"/> | |
46f4442e | 178 | <arg name="--supplementaldir" value="${env.CLDR_DIR}/common/supplemental" /> |
73c04bcf A |
179 | </args> |
180 | <!-- http://ant.apache.org/faq.html#xml-entity-include --> | |
181 | &icu-config; | |
182 | </run> | |
183 | </cldr-build> | |
184 | </target> | |
185 | <target name="colfiles" depends="init, setup" description="builds colfiles.mk"> | |
186 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" destFile="colfiles.mk" 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/collation" /> | |
191 | <arg name="-d" value="${env.ICU4C_DIR}/source/data/coll"/> | |
192 | <arg name="-p" value="${env.ICU4C_DIR}/source/data/xml/collation"/> | |
193 | <arg name="-m" value="${env.CLDR_DIR}/common/supplemental" /> | |
194 | <arg name="-w" value="${env.CLDR_DIR}/common/collation" /> | |
195 | </args> | |
46f4442e A |
196 | <deprecates> |
197 | <alias from="de__PHONEBOOK" to="de@collation=phonebook" xpath="//ldml/collations/default[@type='phonebook']"/> | |
198 | <alias from="es__TRADITIONAL" to="es@collation=traditional" xpath="//ldml/collations/default[@type='traditional']"/> | |
199 | <alias from="hi__DIRECT" to="hi@collation=direct" xpath="//ldml/collations/default[@type='direct']"/> | |
200 | <alias from="zh__PINYIN" to="zh@collation=pinyin" xpath="//ldml/collations/default[@type='pinyin']"/> | |
201 | <alias from="zh_TW_STROKE" to="zh@collation=stroke" xpath="//ldml/collations/default[@type='stroke']"/> | |
202 | <alias from="in" to="id" /> | |
203 | <alias from="in_ID" to="id_ID" /> | |
204 | <alias from="iw" to="he" /> | |
73c04bcf | 205 | <alias from="iw_IL" to="he_IL" /> |
46f4442e A |
206 | <alias from="no" to="nb" /> |
207 | <alias from="no_NO" to="nb_NO" /> | |
208 | <alias from="sh" to="sr_Latn" /> | |
209 | <alias from="sh_BA" to="sr_Latn_BA" /> | |
210 | <alias from="sh_CS" to="sr_Latn_RS" /> | |
211 | <alias from="sh_YU" to="sr_Latn_RS" /> | |
212 | <alias from="sr_BA" to="sr_Cyrl_BA" /> | |
213 | <alias from="sr_ME" to="sr_Cyrl_ME" /> | |
214 | <alias from="sr_RS" to="sr_Cyrl_RS" /> | |
215 | <alias from="zh_CN" to="zh_Hans_CN" /> | |
216 | <alias from="zh_SG" to="zh_Hans_SG" /> | |
217 | <alias from="zh_HK" to="zh_Hant_HK" /> | |
218 | <alias from="zh_MO" to="zh_Hant_MO" /> | |
219 | <alias from="zh_TW" to="zh_Hant_TW" /> | |
73c04bcf A |
220 | <emptyLocale locale="de_" /> |
221 | <emptyLocale locale="es_" /> | |
222 | <emptyLocale locale="hi_" /> | |
223 | <emptyLocale locale="zh_" /> | |
46f4442e | 224 | </deprecates> |
73c04bcf A |
225 | </run> |
226 | </cldr-build> | |
227 | </target> | |
228 | <target name="supplementalData" depends="init,setup" description="builds supplementalData.txt from supplementalData.xml"> | |
229 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" destFile="supplementalData.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="${env.CLDR_DIR}/common/supplemental" /> | |
234 | <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/> | |
235 | <arg name="-l"/> | |
236 | <arg name="-f"/> | |
237 | <arg name="-m" value="${env.CLDR_DIR}/common/supplemental" /> | |
238 | </args> | |
239 | </run> | |
240 | </cldr-build> | |
241 | </target> | |
46f4442e A |
242 | <target name="metazoneInfo" depends="init,setup" description="builds metazoneInfo.txt from metazoneInfo.xml"> |
243 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" destFile="metazoneInfo.txt" noArgs="true"> | |
244 | <!-- launch the tool and generate the data after reading the config file --> | |
245 | <run> | |
246 | <args> | |
247 | <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" /> | |
248 | <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/> | |
249 | <arg name="-z"/> | |
250 | <arg name="-f"/> | |
251 | <arg name="-m" value="${env.CLDR_DIR}/common/supplemental" /> | |
252 | </args> | |
253 | </run> | |
254 | </cldr-build> | |
255 | </target> | |
256 | <target name="likelySubtags" depends="init,setup" description="builds likelySubtags.txt from likelySubtags.xml"> | |
257 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" destFile="likelySubtags.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"/> | |
264 | <arg name="-f"/> | |
265 | <arg name="-m" value="${env.CLDR_DIR}/common/supplemental" /> | |
266 | </args> | |
267 | </run> | |
268 | </cldr-build> | |
269 | </target> | |
270 | <target name="plurals" depends="init,setup" description="builds plurals.txt from plurals.xml"> | |
271 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" destFile="plurals.txt" noArgs="true"> | |
272 | <!-- launch the tool and generate the data after reading the config file --> | |
273 | <run> | |
274 | <args> | |
275 | <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" /> | |
276 | <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/> | |
277 | <arg name="-r"/> | |
278 | <arg name="-f"/> | |
279 | <arg name="-m" value="${env.CLDR_DIR}/common/supplemental" /> | |
280 | </args> | |
281 | </run> | |
282 | </cldr-build> | |
283 | </target> | |
73c04bcf A |
284 | <target name="brkitr" depends="init,setup" description="builds break iterator files in ICU text format"> |
285 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" srcFile=".*xml" destFile=".*txt"> | |
286 | <run> | |
287 | <args> | |
288 | <arg name="--sourcedir" value="${env.ICU4C_DIR}/source/data/xml/brkitr"/> | |
289 | <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/brkitr"/> | |
46f4442e | 290 | <arg name="--supplementaldir" value="${env.CLDR_DIR}/common/supplemental" /> |
73c04bcf A |
291 | </args> |
292 | <!-- The entity include is not required for this target --> | |
46f4442e | 293 | <!-- http://ant.apache.org/faq.html#xml-entity-include |
73c04bcf A |
294 | &icu-config; |
295 | --> | |
296 | </run> | |
297 | </cldr-build> | |
298 | </target> | |
299 | <target name="brkfiles" depends="init, setup" description="builds brkfiles.mk"> | |
300 | <cldr-build toolName="org.unicode.cldr.icu.LDML2ICUConverter" destFile="brkfiles.mk" 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.ICU4C_DIR}/source/data/xml/brkitr" /> | |
305 | <arg name="-d" value="${env.ICU4C_DIR}/source/data/brkitr"/> | |
306 | <arg name="-m" value="${env.CLDR_DIR}/common/supplemental" /> | |
307 | <arg name="-w" value="${env.ICU4C_DIR}/source/data/xml/brkitr" /> | |
308 | </args> | |
309 | </run> | |
310 | </cldr-build> | |
311 | </target> | |
312 | <target name="translit" depends="init,setup" description="builds collation files in ICU text format"> | |
313 | <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile=".*txt"> | |
314 | <run> | |
315 | <args> | |
46f4442e | 316 | <arg name="-m" value="((?!.*(BGN|Canadian|Ethiopic).*).*)" /> |
73c04bcf A |
317 | <arg name="--sourcedir" value="${env.CLDR_DIR}/common/transforms" /> |
318 | <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/translit"/> | |
319 | <arg name="--commentSkip"/> | |
320 | </args> | |
321 | <!-- http://ant.apache.org/faq.html#xml-entity-include --> | |
46f4442e | 322 | |
73c04bcf A |
323 | </run> |
324 | </cldr-build> | |
325 | </target> | |
46f4442e A |
326 | <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. --> |
327 | <!-- | |
328 | <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk"> | |
329 | <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true"> | |
73c04bcf | 330 | <run> |
46f4442e A |
331 | <args> [ double hyphen not allowed in comments - transpose -" to fix below ] |
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=-"-writeIndex"/> | |
73c04bcf | 336 | </args> |
73c04bcf A |
337 | </run> |
338 | </cldr-build> | |
46f4442e | 339 | </target> --> |
73c04bcf A |
340 | <target name="clean" depends="init, setup" description="deletes all txt files and mk files from coll and locales directories"> |
341 | <delete> | |
342 | <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/locales"> | |
343 | <include name="*.txt" /> | |
46f4442e A |
344 | </fileset> |
345 | <fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales"> | |
73c04bcf A |
346 | <include name="resfiles.mk" /> |
347 | </fileset> | |
46f4442e | 348 | <fileset id="collation" dir="${env.ICU4C_DIR}/source/data/coll"> |
73c04bcf | 349 | <include name="*.txt" /> |
46f4442e A |
350 | </fileset> |
351 | <fileset id="colfiles" dir="${env.ICU4C_DIR}/source/data/coll"> | |
73c04bcf A |
352 | <include name="colfiles.mk" /> |
353 | </fileset> | |
46f4442e A |
354 | <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/translit"> |
355 | <include name="*_*.txt" /> | |
356 | <include name="root.txt" /> | |
357 | </fileset> | |
73c04bcf | 358 | <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/brkitr"> |
46f4442e | 359 | <!-- brkitr directory contains bunch of txt files that are not produced by LDML2ICUConverter. |
73c04bcf A |
360 | So can't clean up everything. This needs to be updated when new files are added to xml/brkitr directory --> |
361 | <include name="root.txt, en.txt, en_US.txt, en_US_POSIX.txt, ja.txt" /> | |
362 | <include name="brkfiles.mk" /> | |
363 | </fileset> | |
46f4442e A |
364 | <fileset id="supplementalData" dir="${env.ICU4C_DIR}/source/data/misc"> |
365 | <include name="supplementalData.txt" /> | |
366 | </fileset> | |
367 | <fileset id="metazoneInfo" dir="${env.ICU4C_DIR}/source/data/misc"> | |
368 | <include name="metazoneInfo.txt" /> | |
369 | </fileset> | |
370 | <fileset id="likelySubtags" dir="${env.ICU4C_DIR}/source/data/misc"> | |
371 | <include name="likelySubtags.txt" /> | |
372 | </fileset> | |
373 | <fileset id="plurals" dir="${env.ICU4C_DIR}/source/data/misc"> | |
374 | <include name="plurals.txt" /> | |
73c04bcf A |
375 | </fileset> |
376 | </delete> | |
377 | </target> | |
46f4442e | 378 | </project> |