Skip to content

Commit

Permalink
ICU-22773 Migrate the CLDR conversion tool to Maven
Browse files Browse the repository at this point in the history
  • Loading branch information
mihnita committed Dec 5, 2024
1 parent e59065c commit ade45b5
Show file tree
Hide file tree
Showing 29 changed files with 1,358 additions and 1,033 deletions.
2 changes: 1 addition & 1 deletion .github/adaboost.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// © 2022 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// Generated using tools/cldr/cldr-to-icu/build-icu-data.xml
// Generated using tools/cldr/cldr-to-icu/
//
// Include Japanese adaboost model.
{
Expand Down
2 changes: 1 addition & 1 deletion .github/lstm_for_th_my.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// © 2021 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// Generated using tools/cldr/cldr-to-icu/build-icu-data.xml
// Generated using tools/cldr/cldr-to-icu/
//
// Include Burmese and Thai lstm models.
{
Expand Down
211 changes: 110 additions & 101 deletions docs/processes/cldr-icu.md

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions docs/processes/release/tasks/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ need to be correspondingly updated. See below for more files to be updated and s
[icu4c/source/data/misc/icuver.txt](https://github.com/unicode-org/icu/blob/main/icu4c/source/data/misc/icuver.txt)
needs to be updated with the correct version number for ICU and its data.

#### Since ICU 68
#### Since ICU 68, but before ICU 77

In
[tools/cldr/cldr-to-icu/build-icu-data.xml](https://github.com/unicode-org/icu/blob/main/tools/cldr/cldr-to-icu/build-icu-data.xml)
Expand Down Expand Up @@ -212,8 +212,18 @@ The command requires a version number string that follows the typical Java / Mav
6. cldr-to-icu build tool has a dependency on the icu4j packages which needs to be updated in [`tools/cldr/cldr-to-icu/pom.xml`](https://github.com/unicode-org/icu/blob/main/tools/cldr/cldr-to-icu/pom.xml). Please update it to match the version that was updated in `icu4j/pom.xml` in the steps above.
`<version>74.0.1-SNAPSHOT</version>`
```xml
version>74.0.1-SNAPSHOT</version>
```

Since ICU 77 this moved to a property:
```xml
<icu4j.version>77.0.1-SNAPSHOT</icu4j.version>
```
Which can be easily be set from command line:
```sh
mvn versions:set-property -Dproperty=icu4j.version -DnewVersion=77.1 -f $ICU_DIR/tools/cldr/cldr-to-icu
```

#### Until ICU 73 (inclusive)

Expand Down
2 changes: 2 additions & 0 deletions icu4c/source/data/unidata/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ copying that version number into the $ICU_SRC/.bazeliskrc config file.
- run Unicode Tools GenerateUnihanCollators & GenerateUnihanCollatorFiles,
check CLDR diffs, copy to CLDR, test CLDR, ... as documented there
- generate ICU zh collation data
WARNING: outdated, don't do this, follow the tools/cldr/cldr-to-icu/README.md file!
--- Old text from here:
instructions inspired by
https://github.com/unicode-org/icu/blob/main/tools/cldr/cldr-to-icu/README.txt and
https://github.com/unicode-org/icu/blob/main/icu4c/source/data/cldr-icu-readme.txt
Expand Down
9 changes: 0 additions & 9 deletions tools/cldr/.gitignore

This file was deleted.

21 changes: 1 addition & 20 deletions tools/cldr/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- 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.
Expand Down Expand Up @@ -70,23 +70,4 @@
<delete dir="${testDataDir4J}"/>
</target>

<!-- Builds the ICU data, using the Ant build file in the cldr-to-icu directory and passing.
through any specified arguments for controlling the build. If you need more control when
building ICU data (such as incrementally building parts of the data), you should use the
build-icu-data.xml file directly. -->
<target name="build-icu-data">
<ant dir="cldr-to-icu" antfile="build-icu-data.xml" target="all" inheritAll="true"/>
</target>

<!-- Deletes generated ICU data by invoking "clean" in cldr-to-icu/build-icu-data.xml -->
<target name="clean-icu-data">
<ant dir="cldr-to-icu" antfile="build-icu-data.xml" target="clean" inheritAll="true"/>
</target>

<!-- Installs the CLDR library dependencies needed for building ICU data. -->
<target name="install-cldr-libs" depends="init-args">
<exec dir="lib" executable="install-cldr-jars.sh" resolveexecutable="true" failonerror="true">
<arg line="${cldrDir}"/>
</exec>
</target>
</project>
28 changes: 27 additions & 1 deletion tools/cldr/cldr-to-icu/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand All @@ -27,5 +29,29 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
10 changes: 7 additions & 3 deletions tools/cldr/cldr-to-icu/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
Loading

0 comments on commit ade45b5

Please sign in to comment.