/
githubmirror
/
icu
Обзор
Документация
Войти
/
githubmirror
/
icu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/cldr/build.xml
73 строки
4 KB
Mihai Nita
ICU-22773 Migrate the CLDR conversion tool to Maven
10 дек 2024, 00:15
10 дек 2024, 00:15
2fa8a09
Код
Авторство
О чём код?
<!-- © 2020 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html --> <!-- This build file is intended to become the single mechanism for working with CLDR code and data when building ICU data. Eventually it will encompass: * Building ICU data form CLDR data via cldr-to-icu. * Building the CLDR libraries needed to support ICU data conversion. * Copying CLDR test data for ICU regression tests. It's not complete yet, so for now follow the instructions in: icu4c/source/data/cldr-icu-readme.txt --> <!-- Using the directory of this build.xml file as ${basedir}. --> <project name="CLDR" basedir="."> <!-- Initialize any properties not already set on the command line. --> <target name="init-args"> <property environment="env"/> <!-- Inherit properties from environment variable unless specified. As usual with Ant, this is messier than it should be. All we are saying here is: "Use the property if explicitly set, otherwise use the environment variable." We cannot just set the property to the environment variable, since expansion fails for non existent properties, and you are left with a literal value of "${env.CLDR_DIR}". --> <condition property="cldrDir" value="${env.CLDR_DIR}"> <isset property="env.CLDR_DIR"/> </condition> <fail unless="cldrDir" message="Set the CLDR_DIR environment variable (or cldrDir property) to the top level CLDR source directory (containing 'common')."/> <property name="testDataDir4C" value="${basedir}/../../icu4c/source/test/testdata/cldr"/> <property name="testDataDir4J" value="${basedir}/../../icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/cldr"/> </target> <!-- Copies CLDR test data directories, after deleting previous contents to prevent inconsistent state. --> <target name="copy-cldr-testdata" depends="init-args, clean-cldr-testdata"> <!-- CLDR test data directories to be copied into ICU. --> <fileset id="cldrTestData" dir="${cldrDir}/common/testData"> <!-- Add directories here to control which test data is installed. --> <include name="localeIdentifiers/**"/> <!-- ... --> <include name="personNameTest/**"/> <!-- Used in ExhaustivePersonNameTest --> <include name="units/**"/> <!-- Used in UnitsTest tests --> </fileset> <copy todir="${testDataDir4C}"> <fileset refid="cldrTestData"/> </copy> <copy todir="${testDataDir4J}"> <fileset refid="cldrTestData"/> </copy> <!-- create a catalog file for the cldr/personNameTest directory --> <pathconvert property="personNameTestDirContents" pathsep="${line.separator}"> <fileset dir="${cldrDir}/common/testData/personNameTest" excludes="_*" includes="**" /> <map from="${cldrDir}/common/testData/personNameTest/" to="" /> </pathconvert> <echo message="Creating catalog.txt file" /> <copy file="${testDataDir4C}/personNameTest/_header.txt" tofile="${testDataDir4C}/personNameTest/catalog.txt" /> <echo message="${personNameTestDirContents}" file="${testDataDir4C}/personNameTest/catalog.txt" append="true" /> <copy file="${testDataDir4J}/personNameTest/_header.txt" tofile="${testDataDir4J}/personNameTest/catalog.txt" /> <echo message="${personNameTestDirContents}" file="${testDataDir4J}/personNameTest/catalog.txt" append="true" /> </target> <!-- Deletes CLDR test data --> <target name="clean-cldr-testdata" depends="init-args"> <delete dir="${testDataDir4C}"/> <delete dir="${testDataDir4J}"/> </target> </project>