xref: /aosp_15_r20/external/icu/tools/cldr/lib/README.txt (revision 0e209d3975ff4a8c132096b14b0e9364a753506e)
1*0e209d39SAndroid Build Coastguard Worker*********************************************************************
2*0e209d39SAndroid Build Coastguard Worker*** © 2019 and later: Unicode, Inc. and others.                   ***
3*0e209d39SAndroid Build Coastguard Worker*** License & terms of use: http://www.unicode.org/copyright.html ***
4*0e209d39SAndroid Build Coastguard Worker*********************************************************************
5*0e209d39SAndroid Build Coastguard Worker
6*0e209d39SAndroid Build Coastguard WorkerWhat is this directory and why is it empty?
7*0e209d39SAndroid Build Coastguard Worker-------------------------------------------
8*0e209d39SAndroid Build Coastguard Worker
9*0e209d39SAndroid Build Coastguard WorkerThis is the root of a local Maven repository which needs to be populated before
10*0e209d39SAndroid Build Coastguard Workercode which uses the CLDR data API can be executed.
11*0e209d39SAndroid Build Coastguard Worker
12*0e209d39SAndroid Build Coastguard WorkerTo do this, you need to have a local copy of the CLDR project configured on your
13*0e209d39SAndroid Build Coastguard Workercomputer and be able able to build the API jar file and copy an existing utility
14*0e209d39SAndroid Build Coastguard Workerjar file. In the examples below it is assumed that $CLDR_ROOT references this
15*0e209d39SAndroid Build Coastguard WorkerCLDR release.
16*0e209d39SAndroid Build Coastguard Worker
17*0e209d39SAndroid Build Coastguard WorkerSetup
18*0e209d39SAndroid Build Coastguard Worker-----
19*0e209d39SAndroid Build Coastguard Worker
20*0e209d39SAndroid Build Coastguard WorkerThis project relies on the Maven build tool for managing dependencies and uses
21*0e209d39SAndroid Build Coastguard WorkerAnt for configuration purposes, so both will need to be installed. On a Debian
22*0e209d39SAndroid Build Coastguard Workerbased system, this should be as simple as:
23*0e209d39SAndroid Build Coastguard Worker
24*0e209d39SAndroid Build Coastguard Worker$ sudo apt-get install maven ant
25*0e209d39SAndroid Build Coastguard Worker
26*0e209d39SAndroid Build Coastguard Worker
27*0e209d39SAndroid Build Coastguard WorkerInstalling the CLDR API jar
28*0e209d39SAndroid Build Coastguard Worker---------------------------
29*0e209d39SAndroid Build Coastguard Worker
30*0e209d39SAndroid Build Coastguard WorkerFrom this directory:
31*0e209d39SAndroid Build Coastguard Worker
32*0e209d39SAndroid Build Coastguard Worker$ ./install-cldr-jars.sh "$CLDR_DIR"
33*0e209d39SAndroid Build Coastguard Worker
34*0e209d39SAndroid Build Coastguard Worker
35*0e209d39SAndroid Build Coastguard WorkerManually installing the CLDR API jar
36*0e209d39SAndroid Build Coastguard Worker------------------------------------
37*0e209d39SAndroid Build Coastguard Worker
38*0e209d39SAndroid Build Coastguard WorkerOnly follow these remaining steps if the installation script isn't suitable or
39*0e209d39SAndroid Build Coastguard Workerdoesn't work on your system.
40*0e209d39SAndroid Build Coastguard Worker
41*0e209d39SAndroid Build Coastguard WorkerTo regenerate the CLDR API jar you need to build the "jar" target manually
42*0e209d39SAndroid Build Coastguard Workerusing the Maven pom.xml file in the "tools" directory of the CLDR project:
43*0e209d39SAndroid Build Coastguard Worker
44*0e209d39SAndroid Build Coastguard Worker$ cd "$CLDR_ROOT/tools"
45*0e209d39SAndroid Build Coastguard Worker$ mvn package -DskipTests=true
46*0e209d39SAndroid Build Coastguard Worker
47*0e209d39SAndroid Build Coastguard WorkerThis should result in the cldr-code.jar file being built into the cldr-code/target
48*0e209d39SAndroid Build Coastguard Workersub-directory, which can then be installed as a Maven dependency as described above.
49*0e209d39SAndroid Build Coastguard Worker
50*0e209d39SAndroid Build Coastguard Worker
51*0e209d39SAndroid Build Coastguard WorkerUpdating local Maven repository
52*0e209d39SAndroid Build Coastguard Worker-------------------------------
53*0e209d39SAndroid Build Coastguard Worker
54*0e209d39SAndroid Build Coastguard WorkerTo update the local Maven repository (e.g. to install the CLDR jar) then from
55*0e209d39SAndroid Build Coastguard Workerthis directory (lib/) you should run:
56*0e209d39SAndroid Build Coastguard Worker
57*0e209d39SAndroid Build Coastguard Worker$ mvn install:install-file \
58*0e209d39SAndroid Build Coastguard Worker  -Dproject.parent.relativePath="" \
59*0e209d39SAndroid Build Coastguard Worker  -DgroupId=org.unicode.cldr \
60*0e209d39SAndroid Build Coastguard Worker  -DartifactId=cldr-api \
61*0e209d39SAndroid Build Coastguard Worker  -Dversion=0.1-SNAPSHOT \
62*0e209d39SAndroid Build Coastguard Worker  -Dpackaging=jar \
63*0e209d39SAndroid Build Coastguard Worker  -DgeneratePom=true \
64*0e209d39SAndroid Build Coastguard Worker  -DlocalRepositoryPath=. \
65*0e209d39SAndroid Build Coastguard Worker  -Dfile="$CLDR_ROOT/tools/cldr-code/target/cldr-code.jar"
66*0e209d39SAndroid Build Coastguard Worker
67*0e209d39SAndroid Build Coastguard WorkerAnd if you have updated one of these libraries then from this directory run:
68*0e209d39SAndroid Build Coastguard Worker
69*0e209d39SAndroid Build Coastguard Worker$ mvn dependency:purge-local-repository \
70*0e209d39SAndroid Build Coastguard Worker  -Dproject.parent.relativePath="" \
71*0e209d39SAndroid Build Coastguard Worker  -DmanualIncludes=org.unicode.cldr:cldr-api:jar
72*0e209d39SAndroid Build Coastguard Worker
73*0e209d39SAndroid Build Coastguard WorkerAfter doing this, you should see something like the following list of files in
74*0e209d39SAndroid Build Coastguard Workerthis directory:
75*0e209d39SAndroid Build Coastguard Worker
76*0e209d39SAndroid Build Coastguard WorkerREADME.txt   <-- this file
77*0e209d39SAndroid Build Coastguard Workerorg/unicode/cldr/cldr-api/maven-metadata-local.xml
78*0e209d39SAndroid Build Coastguard Workerorg/unicode/cldr/cldr-api/0.1-SNAPSHOT/maven-metadata-local.xml
79*0e209d39SAndroid Build Coastguard Workerorg/unicode/cldr/cldr-api/0.1-SNAPSHOT/cldr-api-0.1-SNAPSHOT.pom
80*0e209d39SAndroid Build Coastguard Workerorg/unicode/cldr/cldr-api/0.1-SNAPSHOT/cldr-api-0.1-SNAPSHOT.jar
81*0e209d39SAndroid Build Coastguard Worker
82*0e209d39SAndroid Build Coastguard WorkerFinally, if you choose to update the version number of the snapshot, then also
83*0e209d39SAndroid Build Coastguard Workerupdate all the the pom.xml files which reference it (but this is unlikely to be
84*0e209d39SAndroid Build Coastguard Workernecessary).
85*0e209d39SAndroid Build Coastguard Worker
86*0e209d39SAndroid Build Coastguard WorkerTroubleshooting
87*0e209d39SAndroid Build Coastguard Worker---------------
88*0e209d39SAndroid Build Coastguard Worker
89*0e209d39SAndroid Build Coastguard WorkerWhile the Maven system should keep the CLDR JAR up to date, there is a chance
90*0e209d39SAndroid Build Coastguard Workerthat you may have an out of date JAR installed elsewhere. If you have any
91*0e209d39SAndroid Build Coastguard Workerissues with the JAR not being the expected version (e.g. after making changes)
92*0e209d39SAndroid Build Coastguard Workerthen run the above "purge" step again, from this directory.
93*0e209d39SAndroid Build Coastguard Worker
94*0e209d39SAndroid Build Coastguard WorkerThis should re-resolve the current JAR snapshot from the repository in this
95*0e209d39SAndroid Build Coastguard Workerdirectory. Having purged the Maven cache, next time you build a project, you
96*0e209d39SAndroid Build Coastguard Workershould see something like:
97*0e209d39SAndroid Build Coastguard Worker
98*0e209d39SAndroid Build Coastguard Worker[exec] Downloading from <xxx>: <url>/org/unicode/cldr/cldr-api/0.1-SNAPSHOT/maven-metadata.xml
99*0e209d39SAndroid Build Coastguard Worker[exec] [INFO] Building jar: <path-to-icu-root>/tools/cldr/cldr-to-icu/target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar
100*0e209d39SAndroid Build Coastguard Worker
101*0e209d39SAndroid Build Coastguard WorkerThis shows that it has had to re-fetch the JAR file.
102