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]> 6<!-- 7/* 8******************************************************************************* 9* Copyright (C) 2005-2014, International Business Machines Corporation and * 10* others. All Rights Reserved. * 11******************************************************************************* 12*/ 13--> 14<project name="icu-build" default="all" basedir="."> 15 <target name="init"> 16 <tstamp/> 17 18 <!-- Load environment variables --> 19 <property environment="env"/> 20 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="../.."/> 23 24 <condition property="is.cldr.dir.set" > 25 <isset property="env.CLDR_DIR" /> 26 </condition > 27 <fail unless="is.cldr.dir.set" message="Please set the CLDR_DIR environment variable to the top level ICU source dir (containing 'common')."/> 28 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"/> 32 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"> 36 <or> 37 <isset property="env.CLDR_CLASSES" /> 38 <isset property="cldrtools.jar" /> 39 </or> 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."/> 42 43 <echo message="java home: ${java.home}"/> 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"> 49 <taskdef name="cldr-build" classname="org.unicode.cldr.ant.CLDRBuild"> 50 <classpath> 51 <pathelement path="${java.class.path}/"/> 52 <pathelement path="${env.CLDR_CLASSES}"/> 53 <pathelement location="${cldrtools.jar}"/> 54 <fileset dir="${cldrtools.dir}/libs" includes="*.jar"/> 55 </classpath> 56 </taskdef> 57 </target> 58 <!-- target for generating ICU data --> 59 <!-- Google Patch: exclude metaZones, windowsZones from "all" --> 60 <target name="all" depends="locales, collation, rbnf, supplementalData, metadata, likelySubtags, plurals, numberingSystems, translit, brkitr, keyTypeData, genderList, postalCodeData, dayPeriods" /> 61 <!-- parallel target --> 62 <target name="pall" depends="init"> 63 <parallel threadsPerProcessor ="1"> 64 <sequential> 65 <ant target='locales' /> 66 </sequential> 67 <sequential> 68 <ant target='collation'> 69 </ant> 70 </sequential> 71 <sequential> 72 <ant target='rbnf'> 73 </ant> 74 </sequential> 75 <ant target='supplementalData'> 76 </ant> 77 <sequential> 78 <ant target='brkitr'> 79 </ant> 80 </sequential> 81 <sequential> 82 <ant target='translit'> 83 </ant> 84 <!--<ant target='trnsfiles'></ant> Not ANT-built - see 85 note below. --> 86 </sequential> 87 <sequential> 88 <ant target='keyTypeData'/> 89 </sequential> 90 <sequential> 91 <ant target='genderList'/> 92 </sequential> 93 <sequential> 94 <ant target='postalCodeData'/> 95 </sequential> 96 <sequential> 97 <ant target='dayPeriods'/> 98 </sequential> 99 </parallel> 100 </target> 101 102 <target name="locales" depends="init,setup" description="builds locale files in ICU text format"> 103 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt"> 104 <!-- launch the tool and generate the data after reading the config file --> 105 <run> 106 <args> 107 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/main" /> 108 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/locales"/> 109 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/main"/> 110 <arg name="--supplementaldir" value="${env.CLDR_DIR}/common/supplemental" /> 111 <arg name="--type" value="locales"/> 112 <arg name="--filter"/> <!-- Google Patch: select short names for HK, MO. (SAR China.) --> 113 <arg name="--makefile" value="resfiles.mk"/> 114 </args> 115 <remapper> 116 <remap sourcePath="/Keys" targetDir="lang" /> 117 <remap sourcePath="/Languages" targetDir="lang" /> 118 <remap sourcePath="/Languages%short" targetDir="lang" /> 119 <remap sourcePath="/Languages%secondary" targetDir="lang" /> 120 <remap sourcePath="/Languages%variant" targetDir="lang" /> 121 <remap sourcePath="/Scripts" targetDir="lang" /> 122 <remap sourcePath="/Scripts%secondary" targetDir="lang" /> 123 <remap sourcePath="/Scripts%short" targetDir="lang" /> 124 <remap sourcePath="/Scripts%stand-alone" targetDir="lang" /> 125 <remap sourcePath="/Scripts%variant" targetDir="lang" /> 126 <remap sourcePath="/Types" targetDir="lang" /> 127 <remap sourcePath="/Types%short" targetDir="lang" /> 128 <remap sourcePath="/Variants" targetDir="lang" /> 129 <remap sourcePath="/Variants%secondary" 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 </run> 182 </cldr-build> 183 </target> 184 <target name="supplementalData" depends="init,setup" description="builds supplementalData.txt from supplementalData.xml"> 185 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="supplementalData.txt" noArgs="true"> 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"/> 191 <arg name="-t" value="supplementalData"/> 192 </args> 193 <remapper> 194 <remap sourcePath="/CurrencyMap" targetDir="curr" /> 195 <remap sourcePath="/CurrencyMeta" targetDir="curr" /> 196 </remapper> 197 </run> 198 </cldr-build> 199 </target> 200 <target name="metadata" depends="init,setup" description="builds metadata.txt from supplementalMetadata.xml"> 201 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="metadata.txt" noArgs="true"> 202 <!-- launch the tool and generate the data after reading the config file --> 203 <run> 204 <args> 205 <arg name="-s" value="${env.CLDR_DIR}/common/supplemental" /> 206 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/> 207 <arg name="-t" value="metadata"/> 208 </args> 209 </run> 210 </cldr-build> 211 </target> 212 <!-- Google patch: removed metaZones and windowsZones targets. --> 213 <target name="likelySubtags" depends="init,setup" description="builds likelySubtags.txt from likelySubtags.xml"> 214 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="likelySubtags.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="likelySubtags"/> 221 </args> 222 </run> 223 </cldr-build> 224 </target> 225 <target name="plurals" depends="init,setup" description="builds plurals.txt from plurals.xml"> 226 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="plurals.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="plurals"/> 233 </args> 234 </run> 235 </cldr-build> 236 </target> 237 <target name="numberingSystems" depends="init,setup" description="builds numberingSystems.txt from numberingSystems.xml"> 238 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="numberingSystems.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="numberingSystems"/> 245 </args> 246 </run> 247 </cldr-build> 248 </target> 249 <target name="genderList" depends="init,setup" description="builds genderList.txt from genderList.xml"> 250 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="genderList.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="genderList"/> 257 </args> 258 </run> 259 </cldr-build> 260 </target> 261 <target name="postalCodeData" depends="init,setup" description="builds postalCodeData.txt from postalCodeData.xml"> 262 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="postalCodeData.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="postalCodeData"/> 269 </args> 270 </run> 271 </cldr-build> 272 </target> 273 <target name="dayPeriods" depends="init,setup" description="builds dayPeriods.txt from dayPeriods.xml"> 274 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" destFile="dayPeriods.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="dayPeriods"/> 281 </args> 282 </run> 283 </cldr-build> 284 </target> 285 <target name="brkitr" depends="init,setup" description="builds break iterator files in ICU text format"> 286 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" srcFile=".*xml" destFile=".*txt"> 287 <run> 288 <args> 289 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/segments"/> 290 <arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/brkitr"/> 291 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/brkitr"/> 292 <arg name="--type" value="brkitr" /> 293 <arg name="--makefile" value="brkfiles.mk"/> 294 </args> 295 <!-- The entity include is not required for this target --> 296 <!-- http://ant.apache.org/faq.html#xml-entity-include 297 &icu-config; 298 --> 299 </run> 300 </cldr-build> 301 </target> 302 303 <target name="keyTypeData" depends="init,setup" description="builds keyTypeData.txt and timezoneTypes.txt from bcp47/*.xml"> 304 <cldr-build toolName="org.unicode.cldr.icu.NewLdml2IcuConverter" noArgs="true"> 305 <run> 306 <args> 307 <arg name="-s" value="${env.CLDR_DIR}/common/bcp47" /> 308 <arg name="-d" value="${env.ICU4C_DIR}/source/data/misc"/> 309 <arg name="-t" value="keyTypeData"/> 310 </args> 311 </run> 312 </cldr-build> 313 </target> 314 315 <target name="translit" depends="init,setup" description="builds collation files in ICU text format"> 316 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile=".*txt"> 317 <run> 318 <args> 319 <arg name="-m" value="((?!.*(Canadian|Ethiopic|ug-Latin).*).*)" /> 320 <arg name="--sourcedir" value="${env.CLDR_DIR}/common/transforms" /> 321 <arg name="--destdir" value="${env.ICU4C_DIR}/source/data/translit"/> 322 <arg name="--commentSkip"/> 323 </args> 324 <!-- http://ant.apache.org/faq.html#xml-entity-include --> 325 326 </run> 327 </cldr-build> 328 </target> 329 <!-- we don't generate en.txt or el.txt - so don't change trnsfiles.mk for now. --> 330<!-- 331 <target name="trnsfiles" depends="init, setup" description="builds trnsfiles.mk"> 332 <cldr-build toolName="org.unicode.cldr.icu.ConvertTransforms" srcFile=".*xml" destFile="trnsfiles.mk" noArgs="true"> 333 <run> 334 <args> [ double hyphen not allowed in comments - transpose -" to fix below ] 335 <arg name=-"-sourcedir" value="${env.CLDR_DIR}/common/transforms" /> 336 <arg name=-"-destdir" value="${env.ICU4C_DIR}/source/data/translit"/> 337 <arg name=-"-commentSkip"/> 338 <arg name=-"-writeIndex"/> 339 </args> 340 </run> 341 </cldr-build> 342 </target> --> 343 <target name="clean" depends="init, setup" description="deletes all txt files and mk files from coll and locales directories"> 344 <delete> 345 <fileset id="locales" dir="${env.ICU4C_DIR}/source/data/locales"> 346 <include name="*.txt" /> 347 </fileset> 348 <fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales"> 349 <include name="resfiles.mk" /> 350 </fileset> 351 <fileset id="locales_split" dir="${env.ICU4C_DIR}/source/data"> 352 <include name="curr/*.txt" /> 353 <include name="curr/resfiles.mk" /> 354 <include name="lang/*.txt" /> 355 <include name="lang/resfiles.mk" /> 356 <include name="region/*.txt" /> 357 <include name="region/resfiles.mk" /> 358 <include name="zone/*.txt" /> 359 <include name="zone/resfiles.mk" /> 360 <exclude name="zone/tzdbNames.txt" /> 361 <include name="unit/*.txt" /> 362 <include name="unit/resfiles.mk" /> 363 </fileset> 364 <fileset id="collation" dir="${env.ICU4C_DIR}/source/data/coll"> 365 <include name="*.txt" /> 366 </fileset> 367 <fileset id="colfiles" dir="${env.ICU4C_DIR}/source/data/coll"> 368 <include name="colfiles.mk" /> 369 </fileset> 370 <fileset id="translit" dir="${env.ICU4C_DIR}/source/data/translit"> 371 <include name="*_*.txt" /> 372 <include name="root.txt" /> 373 </fileset> 374 <fileset id="brkitr" dir="${env.ICU4C_DIR}/source/data/brkitr"> 375 <!-- brkitr directory contains bunch of txt files that are not produced by LDML2ICUConverter. 376 So can't clean up everything. This needs to be updated when new files are added to xml/brkitr directory --> 377 <include name="root.txt" /> 378 <include name="el.txt" /> 379 <include name="en.txt" /> 380 <include name="en_US.txt" /> 381 <include name="en_US_POSIX.txt" /> 382 <include name="fi.txt" /> 383 <include name="ja.txt" /> 384 </fileset> 385 <fileset id="brkfiles" dir="${env.ICU4C_DIR}/source/data/brkitr"> 386 <include name="brkfiles.mk" /> 387 </fileset> 388 <fileset id="supplementalData" dir="${env.ICU4C_DIR}/source/data/misc"> 389 <include name="supplementalData.txt" /> 390 </fileset> 391 <fileset id="rbnf" dir="${env.ICU4C_DIR}/source/data/rbnf"> 392 <include name="*.txt" /> 393 </fileset> 394 <fileset id="rbnffiles" dir="${env.ICU4C_DIR}/source/data/rbnf"> 395 <include name="rbnffiles.mk" /> 396 </fileset> 397 <fileset id="metadata" dir="${env.ICU4C_DIR}/source/data/misc"> 398 <include name="metadata.txt" /> 399 </fileset> 400 <fileset id="likelySubtags" dir="${env.ICU4C_DIR}/source/data/misc"> 401 <include name="likelySubtags.txt" /> 402 </fileset> 403 <fileset id="plurals" dir="${env.ICU4C_DIR}/source/data/misc"> 404 <include name="plurals.txt" /> 405 </fileset> 406 <fileset id="numberingSystems" dir="${env.ICU4C_DIR}/source/data/misc"> 407 <include name="numberingSystems.txt" /> 408 </fileset> 409 <fileset id="keyTypeData" dir="${env.ICU4C_DIR}/source/data/misc"> 410 <include name="keyTypeData.txt" /> 411 <include name="timezoneTypes.txt" /> 412 </fileset> 413 <fileset id="genderList" dir="${env.ICU4C_DIR}/source/data/misc"> 414 <include name="genderList.txt" /> 415 </fileset> 416 <fileset id="postalCodeData" dir="${env.ICU4C_DIR}/source/data/misc"> 417 <include name="postalCodeData.txt" /> 418 </fileset> 419 <fileset id="dayPeriods" dir="${env.ICU4C_DIR}/source/data/misc"> 420 <include name="dayPeriods.txt" /> 421 </fileset> 422 </delete> 423 </target> 424</project> 425