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