readme.txt
1 This directory is used for building our Android ICU data file.
2
3 1. To generate ICU data files:run the icu_dat_generator.py script.
4 The command is:
5 ./icu_dat_generator.py [-v] [-h]
6
7 2. To add a resource to Android ICU data file: insert an entry to
8 icu-data-default.txt in external/icu4c/stubdata then
9 run icu_dat_generator.py.
10 For example, to add French collation, you need to
11 a. Add an entry, "coll/fr.res", into external/icu4c/stubdata/icu-data-default.txt
12 b. run "./icu_dat_generator.py".
13
14 3. Add a new resource or modify existing ICU resource definition:
15 Note: This is a rare case. You should talk to ICU team first if it is a bug
16 in ICU resource or a feature enhancement before making such changes.
17 If you would like to add existing ICU resource to Android, please check #2.
18 a. Create or change the text format resource files under external/icu4c/data.
19 b. Make a temporary directory for ICU build.
20 i.e. mkdir external/icu4c/icuBuild
21 c. cd to ICU build directory.
22 i.e. cd external/icu4c/icuBuild
23 d. Run external/icu4c/runConfigureICU with "Linux" option to generate the
24 makefile.
25 i.e. $ANDROID_BUILD_TOP/external/icu4c/runConfigureICU Linux
26 e. make -j2
27 f. The new icudtXXl.dat is under data/out/tmp and the individual resources are
28 under data/out/build/icudtXXl
29 For example, you can find data/out/tmp/icudtXXl.dat and data/out/build/icudtXX48l/*.res.
30 g. Copy the new icudtXXl.dat over $ANDROID_BUILD_TOP/external/icu4c/stubdata/icudtXXl-all.dat.
31 i.e. cp data/out/tmp/icudtXXl.dat $ANDROID_BUILD_TOP/external/icu4c/stubdata/icudtXXl-all.dat.
32 h. Check #1 or #2 to replace or add resource to ICU.
33 i. Clean up ICU build directory.
34 j. Discuss with icu-team how to include the change to public ICU.
35
36 Locale Resource Files:
37 - icudtXXl-all.dat contains the resources in packed
38 form. It includes everything that comes with
39 a vanilla ICU release. icu_dat_generator.py uses this file to generate
40 custom build dat files.
41
42 - cnv/*.cnv are the additional encodings required by Android.
43 These are
44 - gsm-03.38-2000.cnv
45 - iso-8859_16-2001.cnv
46 - docomo-shift_jis-2007.cnv
47 - kddi-jisx-208-2007.cnv
48 - kddi-shift_jis-2007.cnv
49 - softbank-jisx-208-2007.cnv
50 - softbank-shift_jis-2007.cnv
51
52 - Text format ICU resource files are under external/icu4c/data directory.
53 Binary resource files are packaged in external/icu4c/stubdata/icudtXXl-all.dat.
54 If you have bug fixes to apply or want to examine individual resource sizes,
55 you can run icupkg utility to extract icudtXXl-all.dat into a temporary directory.
56 For example:
57 cd $ANDROID_BUILD_TOP/external/icu4c/stubdata
58 cp icudtXXl-all.dat icudtXXl.dat
59 mkdir tempDir
60 $ANDROID_BUILD_TOP/prebuilt/linux-x86_64/icu-4.8/icupkg icudtXXl.dat -x "*" -d tempDir
61
62 Run ICU tests:
63 ICU tests are not part of Android build. If you change the ICU code or data,
64 it is highly recommended to run ICU tests.
65 1. Remove the flag "-R" in external/icu4c/data/Makefile.in.
66 "Reverse collation keys" tables are not included in ICU data on Android. To
67 pass ICU collation tests, you need to delete the flag "-R" in Makefile.in.
68 Search for " -R" under "### collation res" section in external/icu4c/data/Makefile.in,
69 delete all of them.
70 2. Make a temporary directory for ICU build.
71 i.e. mkdir external/icu4c/icuBuild
72 3. cd to ICU build directory.
73 i.e. cd external/icu4c/icuBuild
74 4. Run external/icu4c/runConfigureICU with "Linux" option to generate the makefile.
75 i.e. $ANDROID_BUILD_TOP/external/icu4c/runConfigureICU Linux
76 5. make -j2 check
77 6. Check the result. Ignore the errors from tsconv.
78