Compare commits
930
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f60c70ad33 | ||
|
|
8b24235043 | ||
|
|
7750081bda | ||
|
|
0379e638a9 | ||
|
|
d8ee6843b9 | ||
|
|
530e9a509f | ||
|
|
aebd5ba54b | ||
|
|
9518b26a91 | ||
|
|
dcae3872f0 | ||
|
|
c27199ec9c | ||
|
|
66c8c65857 | ||
|
|
97a046d116 | ||
|
|
2f7a3ea491 | ||
|
|
a1bce0c096 | ||
|
|
75eab42060 | ||
|
|
6d4cea57ed | ||
|
|
9e1c66daf7 | ||
|
|
bae39adf67 | ||
|
|
4f0c2ca71c | ||
|
|
43cde6bdbf | ||
|
|
9c466d43d9 | ||
|
|
fc91b6bb7f | ||
|
|
492a8441db | ||
|
|
97335dfa7e | ||
|
|
1ac14c4ea7 | ||
|
|
b2539f44df | ||
|
|
0127e4f760 | ||
|
|
070a1f420b | ||
|
|
d83d26cc5d | ||
|
|
9e6173fcef | ||
|
|
aff1bbaa14 | ||
|
|
cce642a84f | ||
|
|
f7d641d5ad | ||
|
|
4b8f8f3c48 | ||
|
|
86b07da451 | ||
|
|
4b6c85737a | ||
|
|
d4bc9bef26 | ||
|
|
869cc60f3c | ||
|
|
8a1df5a7f4 | ||
|
|
57fc3094f9 | ||
|
|
6ad2ffb9db | ||
|
|
4f75c62767 | ||
|
|
8ba19195f9 | ||
|
|
141e820f71 | ||
|
|
13bf3c8313 | ||
|
|
6eb43b1648 | ||
|
|
142850ae2c | ||
|
|
dd7b0a9d6d | ||
|
|
2a6bc212d4 | ||
|
|
b3032aba0c | ||
|
|
37bdffb240 | ||
|
|
d259da8118 | ||
|
|
fbc1f33e7e | ||
|
|
94305fc59b | ||
|
|
028fa70c29 | ||
|
|
e246d3b712 | ||
|
|
91721504ef | ||
|
|
80a01a475b | ||
|
|
5e95ed8294 | ||
|
|
0b77215040 | ||
|
|
cce162bf4d | ||
|
|
1be861209e | ||
|
|
7a3dfe877d | ||
|
|
6b67715a94 | ||
|
|
7c22ff7541 | ||
|
|
ade671e252 | ||
|
|
6ad78a08c7 | ||
|
|
e017edc97d | ||
|
|
4f2cefb7ca | ||
|
|
606623cf30 | ||
|
|
16b87419ed | ||
|
|
281d8ef140 | ||
|
|
ce052f52c2 | ||
|
|
cbab919682 | ||
|
|
2295478716 | ||
|
|
4405c543ad | ||
|
|
80b33416e8 | ||
|
|
a1c5294ae7 | ||
|
|
f709987818 | ||
|
|
5401c12018 | ||
|
|
de9910659d | ||
|
|
104214aeae | ||
|
|
c771fc444f | ||
|
|
2b6ddc50fe | ||
|
|
b396885aae | ||
|
|
1b2d28b042 | ||
|
|
fc18bcb05f | ||
|
|
0906aae169 | ||
|
|
9a912bb51b | ||
|
|
2a1853c9a9 | ||
|
|
3000bfb67e | ||
|
|
1a4fc9b009 | ||
|
|
00072801a5 | ||
|
|
1cedbbd90d | ||
|
|
d43d216feb | ||
|
|
18c7d48b3e | ||
|
|
37ecee3a0c | ||
|
|
ceee4f0b46 | ||
|
|
4c664b2180 | ||
|
|
784056dfdb | ||
|
|
ebaf3e9f75 | ||
|
|
3a88e99a27 | ||
|
|
a0cdb9cda5 | ||
|
|
89cf56333f | ||
|
|
e0a711c0a4 | ||
|
|
c0c46988c5 | ||
|
|
3a6b1ef80e | ||
|
|
53568e8dfc | ||
|
|
7bc202ae87 | ||
|
|
02a1bfc59f | ||
|
|
c610d7f986 | ||
|
|
232362bf17 | ||
|
|
73744ea41f | ||
|
|
37526240e1 | ||
|
|
71b9b88200 | ||
|
|
aa3e49fa9a | ||
|
|
929cd9bb4f | ||
|
|
35353f2d7f | ||
|
|
137b4c9e47 | ||
|
|
75ff7952b9 | ||
|
|
96fb7ae73a | ||
|
|
0563859d8c | ||
|
|
7d636aecf7 | ||
|
|
09ccfb9956 | ||
|
|
ceca6c4120 | ||
|
|
0d7cedc0dd | ||
|
|
a1925abf4f | ||
|
|
d271d3f269 | ||
|
|
d1fa15bc1f | ||
|
|
c2b328267e | ||
|
|
3df505b511 | ||
|
|
ec800e7407 | ||
|
|
314f03eeaf | ||
|
|
201af462fc | ||
|
|
394341edba | ||
|
|
ea1c6da07f | ||
|
|
6d15faab48 | ||
|
|
3c82e6857c | ||
|
|
fd5d6c97b1 | ||
|
|
4633254f9e | ||
|
|
f3e50a7624 | ||
|
|
8acebe4a0c | ||
|
|
df46d089d5 | ||
|
|
90b2eed71a | ||
|
|
164a56b736 | ||
|
|
b24b251bca | ||
|
|
939f08f274 | ||
|
|
69c8e12642 | ||
|
|
61fdbe0d06 | ||
|
|
2c16b037cf | ||
|
|
abcb80fd53 | ||
|
|
cd251ee62e | ||
|
|
63ae786bf7 | ||
|
|
ba1208e49b | ||
|
|
699555a5bd | ||
|
|
a210fc8351 | ||
|
|
0b66fada30 | ||
|
|
a6efa924ad | ||
|
|
56509e88bf | ||
|
|
43ab3d1de8 | ||
|
|
12cbf73e39 | ||
|
|
c7245a36df | ||
|
|
b79ef68c32 | ||
|
|
d28e12b1f2 | ||
|
|
930b4d9ab9 | ||
|
|
835b009314 | ||
|
|
1b768edbdf | ||
|
|
dc70b5a056 | ||
|
|
678d5c1273 | ||
|
|
6fa113eaa8 | ||
|
|
b8271577b6 | ||
|
|
6562a7df85 | ||
|
|
9515e82741 | ||
|
|
ae9cc8cbd1 | ||
|
|
1b0f5e41c5 | ||
|
|
340806bf9a | ||
|
|
e1415d1282 | ||
|
|
8f80c62aa2 | ||
|
|
400d97e7d2 | ||
|
|
f7f9dbb88d | ||
|
|
e81b8727aa | ||
|
|
5eded36279 | ||
|
|
7c48842e23 | ||
|
|
49a7a1e76d | ||
|
|
9167d6beaf | ||
|
|
ac7e3de879 | ||
|
|
9832f48e22 | ||
|
|
7cec4a9308 | ||
|
|
c8336085bb | ||
|
|
3eb8923b97 | ||
|
|
7b690aa8c7 | ||
|
|
c5160765d4 | ||
|
|
ca53838b83 | ||
|
|
d0672fa8ab | ||
|
|
981057143c | ||
|
|
47b9a517be | ||
|
|
4a8cd80973 | ||
|
|
2d65456a3b | ||
|
|
078b88a11a | ||
|
|
214ae60d94 | ||
|
|
ab72ab1d4a | ||
|
|
509405c9f2 | ||
|
|
dc7014fda6 | ||
|
|
a837e0d399 | ||
|
|
23d1fc5989 | ||
|
|
906093f31b | ||
|
|
87ca023447 | ||
|
|
ed970751ef | ||
|
|
3f054adaf3 | ||
|
|
cfba9a8caf | ||
|
|
539e8f41a3 | ||
|
|
52ff51e82c | ||
|
|
1a60a038e1 | ||
|
|
02740597ce | ||
|
|
74abcfe288 | ||
|
|
7eb56fee1e | ||
|
|
5fa7d4c7ff | ||
|
|
03a870a23c | ||
|
|
9a91599fd4 | ||
|
|
9d3e12b820 | ||
|
|
887005b68a | ||
|
|
daa0171501 | ||
|
|
23dd2b8b54 | ||
|
|
ef78f2a863 | ||
|
|
45d351ca4e | ||
|
|
fc6e282d98 | ||
|
|
96128db44d | ||
|
|
d19dec1556 | ||
|
|
1384d9f395 | ||
|
|
85b7f5fda2 | ||
|
|
838227ce95 | ||
|
|
11d1148e56 | ||
|
|
4ba5d9191b | ||
|
|
7bef50e71d | ||
|
|
5cf5ec1adb | ||
|
|
77759422dd | ||
|
|
e76094c55a | ||
|
|
19af9e7ce3 | ||
|
|
99f6be4345 | ||
|
|
391e3b85fe | ||
|
|
6f2e37ecb5 | ||
|
|
e2d1d3ed43 | ||
|
|
e112f896a2 | ||
|
|
1bc059e7d6 | ||
|
|
7ec1765ce8 | ||
|
|
4a7d61d261 | ||
|
|
8b14c05791 | ||
|
|
7d3cd7cba5 | ||
|
|
4da7ffaa36 | ||
|
|
73f972f7ff | ||
|
|
665d9dbbe9 | ||
|
|
e6892996b1 | ||
|
|
da83309900 | ||
|
|
2a3cb99f6e | ||
|
|
b246489074 | ||
|
|
bcae6f2a43 | ||
|
|
394ebaaee0 | ||
|
|
e5f3295b91 | ||
|
|
e48d2734c6 | ||
|
|
d2a5638336 | ||
|
|
d93c7b60fc | ||
|
|
83327fb92c | ||
|
|
e8e19454da | ||
|
|
368d67316c | ||
|
|
78b1a3fc46 | ||
|
|
f99f8c678b | ||
|
|
ba4e8f2ef7 | ||
|
|
2adf957de2 | ||
|
|
0bfa5f4c44 | ||
|
|
276d3dc865 | ||
|
|
5d3e84afc0 | ||
|
|
757d2cd90a | ||
|
|
8d3d214ad7 | ||
|
|
102ed8b6bd | ||
|
|
511e5efe56 | ||
|
|
091fcf6f82 | ||
|
|
fa6a4661ba | ||
|
|
1bb711ad20 | ||
|
|
a7c7d8f214 | ||
|
|
b070c932ad | ||
|
|
92eeb45811 | ||
|
|
9edac7b783 | ||
|
|
d44f5bc9f0 | ||
|
|
e04f4427dc | ||
|
|
cdab88ff4e | ||
|
|
9f64d3f269 | ||
|
|
1caf1c9c55 | ||
|
|
97e2f3b018 | ||
|
|
683df2254e | ||
|
|
da874594ef | ||
|
|
2f7bfd87cb | ||
|
|
f15f8a41a4 | ||
|
|
91a94c78d3 | ||
|
|
8499f338ee | ||
|
|
5591fd65c0 | ||
|
|
7200b4d18b | ||
|
|
01388fa5ef | ||
|
|
3c44e031be | ||
|
|
3d1dee6837 | ||
|
|
cb7b1b6506 | ||
|
|
ca631eaa26 | ||
|
|
bd9e5ed620 | ||
|
|
6a4ae3b95f | ||
|
|
4b65cdeae1 | ||
|
|
cdbf0ef6df | ||
|
|
049c8ad365 | ||
|
|
2e9d1288dd | ||
|
|
deab8eef82 | ||
|
|
cc777ef48c | ||
|
|
623cb1accc | ||
|
|
1b5542da42 | ||
|
|
597e3110a5 | ||
|
|
72099ee64c | ||
|
|
34883e931c | ||
|
|
d82ad9975d | ||
|
|
1651e63b33 | ||
|
|
c587069895 | ||
|
|
fc386c3a9a | ||
|
|
e09adbf05a | ||
|
|
3cc4e1aac6 | ||
|
|
e6f7ef7ef4 | ||
|
|
e1af930c6a | ||
|
|
dff59b61f9 | ||
|
|
05b0e7abaf | ||
|
|
f6d09d514d | ||
|
|
e73d9736c9 | ||
|
|
3446660d27 | ||
|
|
f24e0a0ff3 | ||
|
|
38643e14e5 | ||
|
|
5fa75fb9cc | ||
|
|
76b9e089be | ||
|
|
07137b64e4 | ||
|
|
acfe1c299b | ||
|
|
bfbf578f1c | ||
|
|
9ed8532d2d | ||
|
|
aa377d7366 | ||
|
|
7a0373411e | ||
|
|
c670bbd5b0 | ||
|
|
87fe057838 | ||
|
|
037449fff8 | ||
|
|
96dcaf7da8 | ||
|
|
99026f01cc | ||
|
|
9bce52f003 | ||
|
|
2df1ab7240 | ||
|
|
47b28d6740 | ||
|
|
558df3aeb8 | ||
|
|
c1475f4bbd | ||
|
|
6d1999fbb9 | ||
|
|
c4689841c0 | ||
|
|
8c4af504a0 | ||
|
|
6e0468d3bf | ||
|
|
cdcea0c378 | ||
|
|
501fe1b74a | ||
|
|
c3544278cb | ||
|
|
77bc51e03e | ||
|
|
263db44a3a | ||
|
|
f14b24a845 | ||
|
|
4fcf8d22b9 | ||
|
|
1b980e5999 | ||
|
|
6a42197331 | ||
|
|
2ca7c49662 | ||
|
|
87d606c39a | ||
|
|
f4227f5d54 | ||
|
|
9be9ed3231 | ||
|
|
2f7090256a | ||
|
|
c4a596e18e | ||
|
|
990779c4bf | ||
|
|
6df1babae2 | ||
|
|
f3b869cbb0 | ||
|
|
d8659b476d | ||
|
|
d082de574f | ||
|
|
14ca2b0e6d | ||
|
|
71a483d174 | ||
|
|
28572ab67e | ||
|
|
7ff2fff2b8 | ||
|
|
63c9435e87 | ||
|
|
84ae742ea0 | ||
|
|
386e9a10db | ||
|
|
832997c57e | ||
|
|
9e9bc3695f | ||
|
|
9fb9bd4950 | ||
|
|
bb7352990e | ||
|
|
6b08bb601c | ||
|
|
a5589e9210 | ||
|
|
6d178fd002 | ||
|
|
68a61daa95 | ||
|
|
35645abdcb | ||
|
|
687feb1eaa | ||
|
|
916452befc | ||
|
|
612cfbbfe4 | ||
|
|
7ae7b15698 | ||
|
|
8c7a78f663 | ||
|
|
b6a4eb8a65 | ||
|
|
c294c3272c | ||
|
|
fab5faa3aa | ||
|
|
21f74b3698 | ||
|
|
aa70ba6746 | ||
|
|
5fb2a6ad06 | ||
|
|
869713b65f | ||
|
|
d501225db2 | ||
|
|
af8dc57a1d | ||
|
|
6afef81b5e | ||
|
|
b3d542392c | ||
|
|
c7f227b37f | ||
|
|
95f25839f4 | ||
|
|
35bae683a5 | ||
|
|
02d5e71903 | ||
|
|
2207e2c3df | ||
|
|
0cc2d9ed4c | ||
|
|
29a6ffc350 | ||
|
|
8817c25c1e | ||
|
|
ea0dbd4c41 | ||
|
|
706044b0a2 | ||
|
|
f79fe9347a | ||
|
|
fb0f36203a | ||
|
|
2270c174a5 | ||
|
|
5d6d197a03 | ||
|
|
667ee72b7c | ||
|
|
52177cc8c7 | ||
|
|
248b1c2a13 | ||
|
|
1fc560c07f | ||
|
|
a7a2fdbcf2 | ||
|
|
ffc449de62 | ||
|
|
27181e36a6 | ||
|
|
81a6edb287 | ||
|
|
6338b704ff | ||
|
|
d91859de21 | ||
|
|
b70b2d0433 | ||
|
|
ca3fd47f4c | ||
|
|
cc2ddc0d11 | ||
|
|
a6fc915e05 | ||
|
|
86193b1b98 | ||
|
|
ca1435c3ea | ||
|
|
56850c9a42 | ||
|
|
47e47ec439 | ||
|
|
720e5741cc | ||
|
|
89b952dffd | ||
|
|
6ba5a1a1b7 | ||
|
|
9511fff62a | ||
|
|
d511cad90d | ||
|
|
1f07d2b29f | ||
|
|
19bac42f98 | ||
|
|
73b61ceece | ||
|
|
03e98c04f3 | ||
|
|
2238f1c2c1 | ||
|
|
85e75ecc13 | ||
|
|
281a2a77ec | ||
|
|
c7e967c456 | ||
|
|
2e45e6ec0e | ||
|
|
5826bf7ed7 | ||
|
|
034a808604 | ||
|
|
70d308731a | ||
|
|
cd6ff4a64d | ||
|
|
1b15a4e9db | ||
|
|
adbcfb1e07 | ||
|
|
f1b13a850a | ||
|
|
b575f7c8f5 | ||
|
|
4a255c4301 | ||
|
|
83ee7e662f | ||
|
|
a9f7570892 | ||
|
|
26bd70e301 | ||
|
|
e83b0715a1 | ||
|
|
3fec4e718e | ||
|
|
c94469b9a0 | ||
|
|
758099ab3b | ||
|
|
9411a940ea | ||
|
|
e567b50df8 | ||
|
|
53e0486855 | ||
|
|
f00ff4f5e3 | ||
|
|
ea7ed9a9db | ||
|
|
e4eb997f41 | ||
|
|
ded6244035 | ||
|
|
7a101d68ea | ||
|
|
bb758fd745 | ||
|
|
ceec2ee64b | ||
|
|
680f521746 | ||
|
|
bc9909bacb | ||
|
|
22d4ba1037 | ||
|
|
388b768262 | ||
|
|
1cede3cb3f | ||
|
|
2e3e49fed5 | ||
|
|
e2fde33b4b | ||
|
|
f4234577ad | ||
|
|
228f2f5c46 | ||
|
|
fe042bdc0d | ||
|
|
7d0d24e7da | ||
|
|
1119ae4885 | ||
|
|
a18c8f83e3 | ||
|
|
90d7ea8196 | ||
|
|
5435007e6a | ||
|
|
de26ea8c6a | ||
|
|
8bbb8f506e | ||
|
|
130bdd4748 | ||
|
|
0fb1b5588e | ||
|
|
b5f8aaf010 | ||
|
|
5ef4fa2989 | ||
|
|
43cd3ce647 | ||
|
|
8d2c78d160 | ||
|
|
18182903cd | ||
|
|
7f5d679a98 | ||
|
|
6e72d90866 | ||
|
|
ba1c7006b7 | ||
|
|
d205e03352 | ||
|
|
e1e1c5feaf | ||
|
|
5618203821 | ||
|
|
530ca98176 | ||
|
|
00bb6789b3 | ||
|
|
0e4b10b112 | ||
|
|
6342f9140a | ||
|
|
6c05042cbc | ||
|
|
62f493827f | ||
|
|
4fd9d6ce9a | ||
|
|
ec3aef8fec | ||
|
|
5be2ea84e5 | ||
|
|
09f4459a77 | ||
|
|
295f0f2a43 | ||
|
|
85fd7389e0 | ||
|
|
2a2995951b | ||
|
|
1e60df0f82 | ||
|
|
4b515504fd | ||
|
|
12c5fe04c0 | ||
|
|
cbb25bb186 | ||
|
|
312bae8660 | ||
|
|
5861e1fd52 | ||
|
|
69e1d707f8 | ||
|
|
0d2a03dbba | ||
|
|
58c674a72e | ||
|
|
80f94a636e | ||
|
|
7d4e57dff1 | ||
|
|
f4687fc25a | ||
|
|
981c182a7f | ||
|
|
2c584abf7e | ||
|
|
c125cf67f0 | ||
|
|
95d905a9e9 | ||
|
|
c702950294 | ||
|
|
9f774e2b8c | ||
|
|
dfdf9141e5 | ||
|
|
22bbc7e12e | ||
|
|
3867acf109 | ||
|
|
a6e9f51859 | ||
|
|
84e4762069 | ||
|
|
b31579920e | ||
|
|
4b5a6edc95 | ||
|
|
cb65f75739 | ||
|
|
4a30076686 | ||
|
|
bfa5f4e6ae | ||
|
|
6ddf63ed92 | ||
|
|
68f5ef835b | ||
|
|
49e8b99296 | ||
|
|
fa5a6c1519 | ||
|
|
e612a4f2ab | ||
|
|
a518312ce2 | ||
|
|
21581f4ec5 | ||
|
|
f2459c16dc | ||
|
|
3076874c32 | ||
|
|
70ed5b4702 | ||
|
|
74641a344e | ||
|
|
dd1d4de29b | ||
|
|
34eaffc668 | ||
|
|
7a670998b0 | ||
|
|
3d31e72633 | ||
|
|
cdeae44c6b | ||
|
|
d73b4417e1 | ||
|
|
0684f8644c | ||
|
|
3b030512ff | ||
|
|
3db74e8ae7 | ||
|
|
06506023c5 | ||
|
|
62375dca3a | ||
|
|
167f8855a2 | ||
|
|
2c46fb7f61 | ||
|
|
7ed7d42f58 | ||
|
|
2d9fa3fa99 | ||
|
|
97510de5d4 | ||
|
|
b399c67d5a | ||
|
|
2c20fa45fb | ||
|
|
2a9d0ccdb2 | ||
|
|
64b4cde663 | ||
|
|
ed011f2e31 | ||
|
|
a36619060c | ||
|
|
57e4b0cd17 | ||
|
|
e5854c84a1 | ||
|
|
9e16711b54 | ||
|
|
be6428690d | ||
|
|
2b714406eb | ||
|
|
3748ef8f8a | ||
|
|
bca85d4641 | ||
|
|
5c07ee700b | ||
|
|
461ec392a5 | ||
|
|
797a01ee2b | ||
|
|
b6dcc95d3c | ||
|
|
79ab90b5f9 | ||
|
|
2864379937 | ||
|
|
d8e80fea88 | ||
|
|
80414a247b | ||
|
|
18f6a3a6e2 | ||
|
|
e8bc04d5df | ||
|
|
d3c94cc062 | ||
|
|
0f4e084208 | ||
|
|
d86b1cebe1 | ||
|
|
ea2cb8549e | ||
|
|
c3b8ffa11e | ||
|
|
f924741bf2 | ||
|
|
a3cbe80909 | ||
|
|
015222105a | ||
|
|
d469e628f3 | ||
|
|
bd065d4704 | ||
|
|
a4c6b2a359 | ||
|
|
cb87c0893b | ||
|
|
331172f0a3 | ||
|
|
c91c2fbdc5 | ||
|
|
461bcef128 | ||
|
|
47b321f1fa | ||
|
|
32bc47eefe | ||
|
|
b20c97009c | ||
|
|
288c4c7555 | ||
|
|
9f108554af | ||
|
|
f1e02f149f | ||
|
|
3f093b602a | ||
|
|
39dfee39b8 | ||
|
|
638acd0c38 | ||
|
|
87fc840bf7 | ||
|
|
0264f411b8 | ||
|
|
9fd2742dfa | ||
|
|
2de88f9d9c | ||
|
|
08f14db4c4 | ||
|
|
3f05361b41 | ||
|
|
5560ee8870 | ||
|
|
fcd6e384bd | ||
|
|
2e0d30cfcf | ||
|
|
a47717934a | ||
|
|
0b3b83a809 | ||
|
|
76df897b77 | ||
|
|
de0a28644b | ||
|
|
de9cb9a133 | ||
|
|
bb0e745e25 | ||
|
|
da5b047dbe | ||
|
|
cd1b772cbf | ||
|
|
a7f4531bfa | ||
|
|
d4ac09edbd | ||
|
|
1b292fa924 | ||
|
|
e7530bd9ff | ||
|
|
2007e135f1 | ||
|
|
89c1700424 | ||
|
|
ad82a6693a | ||
|
|
8d411e9b6a | ||
|
|
80fb309c8a | ||
|
|
0c6d7fc98d | ||
|
|
dcac8ac4c1 | ||
|
|
90caafbcd4 | ||
|
|
44480c4ba4 | ||
|
|
82115c060f | ||
|
|
f6353aeedc | ||
|
|
2a6f06cb4c | ||
|
|
45e98d4f67 | ||
|
|
57c9313eb7 | ||
|
|
0cbf969cf7 | ||
|
|
7e083e34fb | ||
|
|
ba8e4087ca | ||
|
|
e7aad77f31 | ||
|
|
b6b7b045e9 | ||
|
|
d02b30fc3f | ||
|
|
cecd19e9ba | ||
|
|
a2854b615a | ||
|
|
194236a1b4 | ||
|
|
3654e945b6 | ||
|
|
da5d3e0c5b | ||
|
|
8b7ef3d908 | ||
|
|
9c1fb785b3 | ||
|
|
b0ab1171ad | ||
|
|
b00562e989 | ||
|
|
05dc2ac924 | ||
|
|
67a7e2caf0 | ||
|
|
2d19377a8d | ||
|
|
436f5a7df5 | ||
|
|
294b26eb7a | ||
|
|
9f3feed545 | ||
|
|
e0f2d491aa | ||
|
|
2b77e39fbb | ||
|
|
866254ef12 | ||
|
|
fbb4a5a167 | ||
|
|
d453c12bfa | ||
|
|
511b4111f2 | ||
|
|
649c5f0176 | ||
|
|
ff3514f257 | ||
|
|
f949713ce8 | ||
|
|
954d999126 | ||
|
|
3650236abb | ||
|
|
8ca2e06b72 | ||
|
|
00a4cdbd5b | ||
|
|
a620057d76 | ||
|
|
c6c01f4b79 | ||
|
|
ea4fca604f | ||
|
|
c203003b17 | ||
|
|
ff4ecd9f50 | ||
|
|
be9a07907c | ||
|
|
599ecdc4a1 | ||
|
|
fe17bab2bb | ||
|
|
702e529d31 | ||
|
|
49b08b414d | ||
|
|
e72233f8b7 | ||
|
|
e5980f1dcb | ||
|
|
2f07ce2c6c | ||
|
|
123e5c1cd6 | ||
|
|
8f5529f30d | ||
|
|
7c1f8d675b | ||
|
|
cd12cebb87 | ||
|
|
ef706cddf1 | ||
|
|
306be3ddf6 | ||
|
|
b5acb0ffc2 | ||
|
|
0c9d6f6b85 | ||
|
|
329c95e3b9 | ||
|
|
4f707beade | ||
|
|
b23d6c1afe | ||
|
|
b08e51fa91 | ||
|
|
dbfe830108 | ||
|
|
f5367befba | ||
|
|
b403a10e51 | ||
|
|
e646ea23e9 | ||
|
|
17435c4533 | ||
|
|
498abf6961 | ||
|
|
9dc1c020a1 | ||
|
|
b734048799 | ||
|
|
db59034793 | ||
|
|
06259cc6c3 | ||
|
|
cfd99f3f3f | ||
|
|
99dee47fb7 | ||
|
|
a48ae42864 | ||
|
|
e4df304367 | ||
|
|
b9fdd2a7cf | ||
|
|
baee21aa7a | ||
|
|
1dfe456fe8 | ||
|
|
5de6ee0c61 | ||
|
|
d3a753a0d4 | ||
|
|
1de1e36d6f | ||
|
|
48124d1706 | ||
|
|
bebcd6b8bb | ||
|
|
03b94e9cb3 | ||
|
|
030fa1a479 | ||
|
|
00003dcbf2 | ||
|
|
6e3a923056 | ||
|
|
baa104b50b | ||
|
|
4ab713b1c6 | ||
|
|
69dcdde885 | ||
|
|
df93dd00bf | ||
|
|
53775accd5 | ||
|
|
9acba58c49 | ||
|
|
8050af5484 | ||
|
|
5334e2819d | ||
|
|
3d935f2d49 | ||
|
|
3e6219ba4d | ||
|
|
37e2956271 | ||
|
|
49d192fefe | ||
|
|
8c669a7c2e | ||
|
|
ca9bdb9780 | ||
|
|
4ac7cd1393 | ||
|
|
b95c6b1f3e | ||
|
|
2673378260 | ||
|
|
59615c93f6 | ||
|
|
8492a82916 | ||
|
|
3ef03a4087 | ||
|
|
0eecb25011 | ||
|
|
d99abb6d65 | ||
|
|
0266970e97 | ||
|
|
4cf4116dad | ||
|
|
dcd19ae9bc | ||
|
|
58a51495dd | ||
|
|
c258f3d6f8 | ||
|
|
86166e0a2d | ||
|
|
9d230f923c | ||
|
|
9c72bf9758 | ||
|
|
a8594a401f | ||
|
|
6394a48d06 | ||
|
|
9a7b0e08d0 | ||
|
|
4f6f087f2e | ||
|
|
721d41153e | ||
|
|
9f358ccb24 | ||
|
|
e2ae4f5324 | ||
|
|
783b4f7b6a | ||
|
|
58060eafdc | ||
|
|
3cefbd55c7 | ||
|
|
d7c424b00f | ||
|
|
929cf40ecb | ||
|
|
6df8bb7307 | ||
|
|
43f2ae75ca | ||
|
|
86cc2b98cb | ||
|
|
2f6cc2f7e7 | ||
|
|
5a77fd9d11 | ||
|
|
c5872e7f67 | ||
|
|
df8fbc22e8 | ||
|
|
1eb6f38b96 | ||
|
|
0dcb1cb065 | ||
|
|
18dd0e4c22 | ||
|
|
33af80e980 | ||
|
|
c5d0fff5a0 | ||
|
|
d6fc9b828c | ||
|
|
64b3548126 | ||
|
|
fc64f8db3f | ||
|
|
8d5a97ae0f | ||
|
|
e17219582e | ||
|
|
98c5793ffd | ||
|
|
3859735e3b | ||
|
|
1276b0a4f7 | ||
|
|
e1be738ccb | ||
|
|
3ba6f2b32c | ||
|
|
6b2b783a20 | ||
|
|
f5f4813d16 | ||
|
|
74a723f22f | ||
|
|
fcc981a5b7 | ||
|
|
8fcb22f88e | ||
|
|
f6300c97cd | ||
|
|
3d89af0f72 | ||
|
|
85705f04e0 | ||
|
|
f8a0810a5a | ||
|
|
bdcec144b9 | ||
|
|
5961aacd3c | ||
|
|
fda4a82bba | ||
|
|
eea7985e5a | ||
|
|
e96e9410bd | ||
|
|
07a50207b7 | ||
|
|
505535813f | ||
|
|
43d082665e | ||
|
|
cb6b778e1b | ||
|
|
50e14fe15b | ||
|
|
fca6b342c0 | ||
|
|
47824c5568 | ||
|
|
d16df5843e | ||
|
|
87cee860e0 | ||
|
|
4747484273 | ||
|
|
4833cc89b2 | ||
|
|
f4f74c1f2e | ||
|
|
a2c90781f1 | ||
|
|
861e55c246 | ||
|
|
c205e7ee49 | ||
|
|
b144aac447 | ||
|
|
2612b8b55a | ||
|
|
ed1d9efc15 | ||
|
|
8230b85175 | ||
|
|
2aa2a7221c | ||
|
|
9b3c0c328c | ||
|
|
1d9cc717e2 | ||
|
|
09331b75bf | ||
|
|
ee6433c297 | ||
|
|
0f49e50868 | ||
|
|
89c5d03023 | ||
|
|
8575c0dace | ||
|
|
6330704974 | ||
|
|
33c9b61b26 | ||
|
|
741bbddcf9 | ||
|
|
f30956fc9c | ||
|
|
b1269c9121 | ||
|
|
dbf7c20be6 | ||
|
|
811351f67c | ||
|
|
5b4559df24 | ||
|
|
bfca3ccaac | ||
|
|
29111fd195 | ||
|
|
df6a8c877c | ||
|
|
e0bb2ccdeb | ||
|
|
b5f10c4a1c | ||
|
|
19c13048d2 | ||
|
|
7fe330119e | ||
|
|
f374427f60 | ||
|
|
996378821c | ||
|
|
8a5f045992 | ||
|
|
e730bce02f | ||
|
|
571d12abfb | ||
|
|
bb822ba38a | ||
|
|
77e0c9e371 | ||
|
|
234cbe2c17 | ||
|
|
55a51fa9bd | ||
|
|
f79f03dad5 | ||
|
|
f57ef9ebf7 | ||
|
|
31871cc14f | ||
|
|
1393face12 | ||
|
|
80ee559205 | ||
|
|
c86a2bd7d7 | ||
|
|
7f044eeb7a | ||
|
|
0ce0d1aa5d | ||
|
|
87e31395da | ||
|
|
512a679aba | ||
|
|
81ad37be05 | ||
|
|
a723bdf494 | ||
|
|
bf6b3236a3 | ||
|
|
6bdcd6d30f | ||
|
|
475703cd40 | ||
|
|
f783a84d2f | ||
|
|
16aae80199 | ||
|
|
4059be5964 | ||
|
|
fcca13200f | ||
|
|
3aa8f9fda1 | ||
|
|
81dfbdf3b6 | ||
|
|
c626c6df5c | ||
|
|
9907ca8ea3 | ||
|
|
94197b84b8 | ||
|
|
4962050f47 | ||
|
|
5489287998 | ||
|
|
16b934636a | ||
|
|
e3ebc7aac5 | ||
|
|
bac48c8f9d | ||
|
|
fc3ca702e9 | ||
|
|
9bb82e60a4 | ||
|
|
4cfe96c508 | ||
|
|
335c403618 | ||
|
|
9df5f09d8f | ||
|
|
7d825cb204 | ||
|
|
53f4ddf278 | ||
|
|
143dd6ad6f | ||
|
|
66c8326280 | ||
|
|
039ecd6fd0 | ||
|
|
398489b915 | ||
|
|
91732e7c55 | ||
|
|
008fddfaac | ||
|
|
e951f4aec4 | ||
|
|
a7b2d9dae1 | ||
|
|
2a7c465284 | ||
|
|
c882c94d83 | ||
|
|
205144e391 | ||
|
|
2f8749a026 | ||
|
|
2fef6b937f | ||
|
|
fb31d9b54b | ||
|
|
397cbb9530 | ||
|
|
a67bb90150 | ||
|
|
32d279a437 | ||
|
|
8528bef596 | ||
|
|
406d90000f | ||
|
|
c9fae4bda4 | ||
|
|
470e44c551 | ||
|
|
d0290c03db | ||
|
|
23081486ff | ||
|
|
06ef8867f3 | ||
|
|
44c7137ae5 |
+1
-1
@@ -6,4 +6,4 @@
|
||||
# for running Bazel commands while ensuring, through configuration, that only a
|
||||
# specific version of Bazel is executed.
|
||||
|
||||
USE_BAZEL_VERSION=4.1.0
|
||||
USE_BAZEL_VERSION=6.0.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# © 2024 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
|
||||
# By default, build ICU4C as C11 & C++17.
|
||||
|
||||
build --enable_platform_specific_config
|
||||
|
||||
build:android --conlyopt=-std=c11
|
||||
build:android --host_conlyopt=-std=c11
|
||||
build:ios --conlyopt=-std=c11
|
||||
build:ios --host_conlyopt=-std=c11
|
||||
build:linux --conlyopt=-std=c11
|
||||
build:linux --host_conlyopt=-std=c11
|
||||
build:macos --conlyopt=-std=c11
|
||||
build:macos --host_conlyopt=-std=c11
|
||||
build:windows --conlyopt=/std:c11
|
||||
build:windows --host_conlyopt=/std:c11
|
||||
|
||||
build:android --cxxopt=-std=c++17
|
||||
build:android --host_cxxopt=-std=c++17
|
||||
build:ios --cxxopt=-std=c++17
|
||||
build:ios --host_cxxopt=-std=c++17
|
||||
build:linux --cxxopt=-std=c++17
|
||||
build:linux --host_cxxopt=-std=c++17
|
||||
build:macos --cxxopt=-std=c++17
|
||||
build:macos --host_cxxopt=-std=c++17
|
||||
build:windows --cxxopt=/std:c++17
|
||||
build:windows --host_cxxopt=/std:c++17
|
||||
@@ -17,7 +17,8 @@ trigger:
|
||||
- '*'
|
||||
exclude:
|
||||
- .github/*
|
||||
- .ci-builds/.azure-pipelines.yml
|
||||
- .ci-builds/.azure-pipelines-icu4c.yml
|
||||
- .ci-builds/.azure-pipelines-icu4j.yml
|
||||
- .ci-builds/.azure-valgrind.yml
|
||||
- docs/*
|
||||
- tools/*
|
||||
@@ -27,42 +28,45 @@ trigger:
|
||||
- KEYS
|
||||
- README.md
|
||||
|
||||
variables:
|
||||
MAVEN_ARGS: '--show-version --no-transfer-progress'
|
||||
|
||||
jobs:
|
||||
#-------------------------------------------------------------------------
|
||||
# Note: The exhaustive tests can take more than 1 hour to complete.
|
||||
- job: ICU4J_OpenJDK_Ubuntu_1804
|
||||
displayName: 'J: Linux OpenJDK (Ubuntu 18.04)'
|
||||
timeoutInMinutes: 120
|
||||
- job: ICU4J_OpenJDK_Ubuntu_2204
|
||||
displayName: 'J: Linux OpenJDK (Ubuntu 22.04)'
|
||||
timeoutInMinutes: 180
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
vmImage: 'ubuntu-22.04'
|
||||
demands: ant
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
echo "Building ICU4J" && cd icu4j && ant init && ant exhaustiveCheck
|
||||
echo "Building ICU4J" && cd icu4j && mvn install -DICU.exhaustive=10
|
||||
displayName: 'Build and Exhaustive Tests'
|
||||
env:
|
||||
BUILD: ICU4J
|
||||
- script: |
|
||||
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`
|
||||
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`
|
||||
condition: failed() # only run if the build fails.
|
||||
displayName: 'List failures (if any)'
|
||||
timeoutInMinutes: 2
|
||||
#-------------------------------------------------------------------------
|
||||
# Note: The exhaustive tests can take more than 1 hour to complete.
|
||||
- job: ICU4C_Clang_Exhaustive_Ubuntu_1804
|
||||
displayName: 'C: Linux Clang Exhaustive Tests (Ubuntu 18.04)'
|
||||
- job: ICU4C_Clang_Exhaustive_Ubuntu_2204
|
||||
displayName: 'C: Linux Clang Exhaustive Tests (Ubuntu 22.04)'
|
||||
timeoutInMinutes: 120
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
vmImage: 'ubuntu-22.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j2
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5
|
||||
displayName: 'Build'
|
||||
- script: |
|
||||
cd icu4c/source && make check-exhaustive
|
||||
@@ -71,4 +75,3 @@ jobs:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,665 @@
|
||||
# Azure Pipelines (VSTS) configuration for CI builds for ICU.
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- maint/maint-*
|
||||
paths:
|
||||
include:
|
||||
- icu4c
|
||||
- .ci-builds/.azure-pipelines-icu4c.yml
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- maint/maint-*
|
||||
paths:
|
||||
include:
|
||||
- icu4c
|
||||
- .ci-builds/.azure-pipelines-icu4c.yml
|
||||
|
||||
|
||||
variables:
|
||||
MAVEN_ARGS: '--show-version --no-transfer-progress'
|
||||
|
||||
jobs:
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Ubuntu_2204
|
||||
displayName: 'C: Linux Clang (Ubuntu 22.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-22.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
- script: |
|
||||
cd icu4c/source/test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
|
||||
displayName: 'Test C Default locale'
|
||||
- script: |
|
||||
cd icu4c/source/test/cintltst && LANG=C.UTF-8 LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
|
||||
displayName: 'Test C.UTF-8 Default locale'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Ubuntu_DataFilter_2204
|
||||
displayName: 'C: Linux Clang DataFilter (Ubuntu 22.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-22.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Note: This job uses `make -j2` instead of `make -j -l2.5` because with more parallelism (PR #2456)
|
||||
# this check became flaky. The build apparently was not done copying one or another .ucm file before
|
||||
# calling makeconv for it, although the Makefile has appropriate dependencies.
|
||||
- script: |
|
||||
cd icu4c/source && \
|
||||
ICU_DATA_FILTER_FILE=../../.ci-builds/data-filter.json ./runConfigureICU Linux && \
|
||||
make -j2 tests && \
|
||||
\[ ! -d data/out/build/icudt66l/translit \] && \
|
||||
(cd test/intltest && LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./intltest translit/TransliteratorTest/TestBasicTransliteratorEvenWithoutData) && \
|
||||
(cd test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestEnglishExemplarCharacters /tsutil/cldrtest/TestCoverage)
|
||||
displayName: 'Build with Data Filter'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Cpp17_Debug_Ubuntu_2204
|
||||
displayName: 'C: Linux Clang C++17 Debug (Ubuntu 22.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-22.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
export CXXFLAGS="-std=c++17 -Winvalid-constexpr" && cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j -l2.5 check
|
||||
displayName: 'Build and Test C++17'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_GCC_Ubuntu_2004
|
||||
displayName: 'C: Linux GCC (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_GCC11_Cpp20_Ubuntu_2004
|
||||
displayName: 'C: Linux GCC-11 C++20 (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt install gcc-11 g++-11
|
||||
displayName: 'Install GCC-11'
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: gcc-11
|
||||
CXX: g++-11
|
||||
CXXFLAGS: '-std=c++20 -fext-numeric-literals'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Ubuntu_2004_LANG
|
||||
displayName: 'C: Linux Clang (Ubuntu 20.04) - LANG has extension tags'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
LANG: "en_US@calendar=gregorian;hours=h12"
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang16_Ubuntu_2004_WarningsAsErrors
|
||||
displayName: 'C: Linux Clang-16 WarningsAsErrors (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Install Clang-16 from https://apt.llvm.org/
|
||||
- script: |
|
||||
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
|
||||
sudo apt update
|
||||
sudo apt install -qy clang-16 lld-16 libc++-16-dev libc++abi-16-dev
|
||||
displayName: 'Install Clang-16'
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 tests
|
||||
displayName: 'Build only (WarningsAsErrors)'
|
||||
env:
|
||||
CC: clang-16
|
||||
CPPFLAGS: '-Werror -Wno-strict-prototypes -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor -Wsuggest-override'
|
||||
CXX: clang++-16
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang16_Cpp20_Ubuntu_2004
|
||||
displayName: 'C: Linux Clang-16 C++20 (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Install Clang-16 from https://apt.llvm.org/
|
||||
- script: |
|
||||
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
|
||||
sudo apt update
|
||||
sudo apt install -qy clang-16 lld-16 libc++-16-dev libc++abi-16-dev
|
||||
displayName: 'Install Clang-16'
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: clang-16
|
||||
CPPFLAGS: '-Werror -Wno-strict-prototypes'
|
||||
CXX: clang++-16
|
||||
CXXFLAGS: '-std=c++20'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang16_Cpp20_libcpp_Ubuntu_2004
|
||||
displayName: 'C: Linux Clang-16 C++20 libc++ (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Install Clang-16 from https://apt.llvm.org/
|
||||
- script: |
|
||||
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
|
||||
sudo apt update
|
||||
sudo apt install -qy clang-16 lld-16 libc++-16-dev libc++abi-16-dev
|
||||
displayName: 'Install Clang-16'
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: clang-16
|
||||
CPPFLAGS: '-Werror -Wno-strict-prototypes'
|
||||
CXX: clang++-16
|
||||
CXXFLAGS: '-std=c++20 -stdlib=libc++'
|
||||
#-------------------------------------------------------------------------
|
||||
# VS 2022 Builds
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Release_Distrelease
|
||||
displayName: 'C: MSVC 64-bit Release (VS 2022) + Distrelease'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
- task: PowerShell@2
|
||||
displayName: 'PowerShell: Distrelease script (x64)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: 'icu4c/packaging/distrelease.ps1'
|
||||
arguments: '-arch x64'
|
||||
workingDirectory: icu4c
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish x64 Artifacts: icu-windows.zip'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
|
||||
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x64_Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Release_DataFilter
|
||||
displayName: 'C: MSVC 64-bit Release DataFilter (VS 2022)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- powershell: |
|
||||
$filterPath = $Env:BUILD_SOURCESDIRECTORY + "\.ci-builds\data-filter.json"
|
||||
$vstsCommandString = "vso[task.setvariable variable=ICU_DATA_FILTER_FILE]" + $filterPath
|
||||
Write-Host "##$vstsCommandString"
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution with Data Filter'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
msbuildArgs: '/p:SkipUWP=true'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x86_Release_Distrelease
|
||||
displayName: 'C: MSVC 32-bit Release (VS 2022) + Distrelease'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: Win32
|
||||
configuration: Release
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x86 Release'
|
||||
- task: PowerShell@2
|
||||
displayName: 'PowerShell: Distrelease script (x86)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: 'icu4c/packaging/distrelease.ps1'
|
||||
arguments: '-arch x86'
|
||||
workingDirectory: icu4c
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish x86 Artifacts: icu-windows.zip'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
|
||||
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x86_Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_ARM32_Release
|
||||
displayName: 'C: MSVC x64 ARM32 Release (VS 2022)'
|
||||
timeoutInMinutes: 35
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build ARM32'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: ARM
|
||||
configuration: Release
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_ARM64_Release_Distrelease
|
||||
displayName: 'C: MSVC x64 ARM64 Release (VS 2022) + Distrelease'
|
||||
timeoutInMinutes: 35
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build ARM64'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: ARM64
|
||||
configuration: Release
|
||||
- task: PowerShell@2
|
||||
displayName: 'PowerShell: Distrelease script (ARM64)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: 'icu4c/packaging/distrelease.ps1'
|
||||
arguments: '-arch ARM64'
|
||||
workingDirectory: icu4c
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish ARM64 Artifacts: icu-windows.zip'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
|
||||
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_ARM64_Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Debug
|
||||
displayName: 'C: MSVC x64 Debug (VS 2022)'
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Debug
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run x64 Debug Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Debug'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_ARM64_Debug
|
||||
displayName: 'C: MSVC ARM64 Debug (VS 2022)'
|
||||
timeoutInMinutes: 35
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Debug
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build ARM64 Debug'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: ARM64
|
||||
configuration: Debug
|
||||
#-------------------------------------------------------------------------
|
||||
# There is no /std:c++20 yet, so use c++latest as that includes many of
|
||||
# the C++20 compiler and library changes.
|
||||
- job: ICU4C_MSVC_x64_Release_CppLatest
|
||||
displayName: 'C: MSVC 64-bit Release (VS 2022) /std:c++latest'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
msbuildArgs: '/p:LanguageStandard="stdcpplatest"'
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
#-------------------------------------------------------------------------
|
||||
# VS 2019 Builds
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Release_VS2019
|
||||
displayName: 'C: MSVC 64-bit Release (VS 2019)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x86_Debug_VS2019
|
||||
displayName: 'C: MSVC 32-bit Debug (VS 2019)'
|
||||
timeoutInMinutes: 90
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: Win32
|
||||
configuration: Debug
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x86 Debug'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSYS2_GCC_x86_64_Release
|
||||
displayName: 'C: MSYS2 GCC x86_64 Release'
|
||||
timeoutInMinutes: 45
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
choco install -y msys2
|
||||
rem refreshenv
|
||||
displayName: 'Install MSYS2'
|
||||
- script: |
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Hello World' && uname -a"
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain"
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S make"
|
||||
exit
|
||||
displayName: 'Install mingw-w64-x86_64-toolchain'
|
||||
- script: |
|
||||
set MSYSTEM=MINGW64
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && ./runConfigureICU MinGW --prefix='/tmp/build-icu' && make -j -l2.5 check"
|
||||
displayName: 'Build and Test'
|
||||
- script: |
|
||||
set MSYSTEM=MINGW64
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && make install && cd /tmp/build-icu && echo 'Recursive ls' && ls -lR"
|
||||
displayName: 'make install'
|
||||
- script: |
|
||||
set MSYSTEM=MINGW64
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Run icuinfo from MSYS shell' && cd /tmp/build-icu/bin && ./icuinfo.exe"
|
||||
echo 'Run icuinfo from CMD shell' && cd /d C:\tools\msys64\tmp\build-icu\bin && set PATH=C:\tools\msys64\mingw64\bin;%PATH% && icuinfo.exe"
|
||||
displayName: 'run icuinfo'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_MacOS_WarningsAsErrors
|
||||
displayName: 'C: macOS(Latest) Clang WarningsAsErrors'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'macOS-latest'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor" && cd icu4c/source && ./runConfigureICU MacOSX && make -j -l2.5 check
|
||||
displayName: 'Build and Test (WarningsAsErrors)'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_icuexportdata_Ubuntu_2204
|
||||
displayName: 'C: Create Artifacts from icuexportdata'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-22.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5
|
||||
displayName: 'Build'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
- script: |
|
||||
cd icu4c/source
|
||||
mkdir -p icuexportdata/uprops/fast
|
||||
./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/fast --trie-type fast --all
|
||||
mkdir -p icuexportdata/uprops/small
|
||||
./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/small --trie-type small --all
|
||||
displayName: 'Build property data files'
|
||||
env:
|
||||
LD_LIBRARY_PATH: lib
|
||||
- script: |
|
||||
cd icu4c/source
|
||||
mkdir -p icuexportdata/norm/fast
|
||||
./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/fast --trie-type fast --all
|
||||
mkdir -p icuexportdata/norm/small
|
||||
./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/small --trie-type small --all
|
||||
displayName: 'Build normalization data files'
|
||||
env:
|
||||
LD_LIBRARY_PATH: lib
|
||||
- script: |
|
||||
cd icu4c/source
|
||||
mkdir -p icuexportdata/ucase/fast
|
||||
./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/fast --trie-type fast --all
|
||||
mkdir -p icuexportdata/ucase/small
|
||||
./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/small --trie-type small --all
|
||||
displayName: 'Build case data files'
|
||||
env:
|
||||
LD_LIBRARY_PATH: lib
|
||||
- script: |
|
||||
cd icu4c/source
|
||||
FILES=`ls data/coll "*.txt"`
|
||||
mkdir -p icuexportdata/collation/unihan
|
||||
./bin/genrb -X -s data/coll/ --ucadata data/in/coll/ucadata-unihan-icu4x.icu -d icuexportdata/collation/unihan $FILES
|
||||
rm icuexportdata/collation/unihan/*.res
|
||||
mkdir -p icuexportdata/collation/implicithan
|
||||
./bin/genrb -X -s data/coll/ --ucadata data/in/coll/ucadata-implicithan-icu4x.icu -d icuexportdata/collation/implicithan $FILES
|
||||
rm icuexportdata/collation/implicithan/*.res
|
||||
displayName: 'Build collation data files'
|
||||
env:
|
||||
LD_LIBRARY_PATH: lib
|
||||
- script: |
|
||||
cd icu4c/source
|
||||
mkdir -p icuexportdata/segmenter/dictionary
|
||||
for FILE in `ls data/brkitr/dictionaries`
|
||||
do
|
||||
./bin/gendict --uchars --toml data/brkitr/dictionaries/$FILE icuexportdata/segmenter/dictionary/`basename $FILE .txt`.toml
|
||||
done
|
||||
displayName: 'Build segmenter dictionary files'
|
||||
env:
|
||||
LD_LIBRARY_PATH: lib
|
||||
- task: ArchiveFiles@2
|
||||
displayName: 'Zip'
|
||||
inputs:
|
||||
rootFolderOrFile: 'icu4c/source/icuexportdata'
|
||||
includeRootFolder: false
|
||||
archiveFile: 'icuexportdata_tag-goes-here.zip'
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact'
|
||||
inputs:
|
||||
PathtoPublish: 'icuexportdata_tag-goes-here.zip'
|
||||
ArtifactName: 'icuexportdata_output'
|
||||
#-------------------------------------------------------------------------
|
||||
# Builds MSVC with cpp exceptions turned off
|
||||
- job: ICU4C_MSVC_x64_Release_NoExceptions
|
||||
displayName: 'C: MSVC 64-bit Release No Exceptions'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
msbuildArgs: '/p:_HAS_EXCEPTIONS=0'
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
@@ -0,0 +1,47 @@
|
||||
# Azure Pipelines (VSTS) configuration for CI builds for ICU.
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- maint/maint-*
|
||||
paths:
|
||||
include:
|
||||
- icu4j
|
||||
- .ci-builds/.azure-pipelines-icu4j.yml
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- maint/maint-*
|
||||
paths:
|
||||
include:
|
||||
- icu4j
|
||||
- .ci-builds/.azure-pipelines-icu4j.yml
|
||||
|
||||
variables:
|
||||
MAVEN_ARGS: '--show-version --no-transfer-progress'
|
||||
|
||||
jobs:
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4J_OpenJDK_Ubuntu_2204
|
||||
displayName: 'J: Linux OpenJDK (Ubuntu 22.04)'
|
||||
timeoutInMinutes: 20
|
||||
pool:
|
||||
vmImage: 'ubuntu-22.04'
|
||||
demands: ant
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
echo "Building ICU4J" && cd icu4j && mvn install
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
BUILD: ICU4J
|
||||
# exit with a non-zero status in order to make this step show as a red X in the UI.
|
||||
- script: |
|
||||
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;` && exit 1
|
||||
condition: failed() # only run if the build fails.
|
||||
displayName: 'List failures (if any)'
|
||||
@@ -1,631 +0,0 @@
|
||||
# Azure Pipelines (VSTS) configuration for CI builds for ICU.
|
||||
|
||||
jobs:
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4J_OpenJDK_Ubuntu_1804
|
||||
displayName: 'J: Linux OpenJDK (Ubuntu 18.04)'
|
||||
timeoutInMinutes: 20
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
demands: ant
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
echo "Building ICU4J" && cd icu4j && ant init && ant check && ant localespiCheck
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
BUILD: ICU4J
|
||||
# exit with a non-zero status in order to make this step show as a red X in the UI.
|
||||
- script: |
|
||||
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;` && exit 1
|
||||
condition: failed() # only run if the build fails.
|
||||
displayName: 'List failures (if any)'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Ubuntu_1804
|
||||
displayName: 'C: Linux Clang (Ubuntu 18.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
- script: |
|
||||
cd icu4c/source/test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
|
||||
displayName: 'Test C Default locale'
|
||||
- script: |
|
||||
cd icu4c/source/test/cintltst && LANG=C.UTF-8 LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
|
||||
displayName: 'Test C.UTF-8 Default locale'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang13_Ubuntu_2004_WarningsAsErrors
|
||||
displayName: 'C: Linux Clang-13 WarningsAsErrors (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Install Clang-13 from https://apt.llvm.org/
|
||||
- script: |
|
||||
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
|
||||
sudo apt update
|
||||
sudo apt install -qy clang-13 lld-13 libc++-13-dev libc++abi-13-dev
|
||||
displayName: 'Install Clang-13'
|
||||
- script: |
|
||||
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor -Wsuggest-override" && cd icu4c/source && ./runConfigureICU Linux && make -j2 tests
|
||||
displayName: 'Build only (WarningsAsErrors)'
|
||||
env:
|
||||
CC: clang-13
|
||||
CXX: clang++-13
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Ubuntu_DataFilter_1804
|
||||
displayName: 'C: Linux Clang DataFilter (Ubuntu 18.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && \
|
||||
ICU_DATA_FILTER_FILE=../../.ci-builds/data-filter.json ./runConfigureICU Linux && \
|
||||
make -j2 tests && \
|
||||
\[ ! -d data/out/build/icudt66l/translit \] && \
|
||||
(cd test/intltest && LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./intltest translit/TransliteratorTest/TestBasicTransliteratorEvenWithoutData)
|
||||
displayName: 'Build with Data Filter'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Cpp14_Debug_Ubuntu_1804
|
||||
displayName: 'C: Linux Clang C++17 Debug (Ubuntu 18.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
export CXXFLAGS="-std=c++17 -Winvalid-constexpr" && cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j2 check
|
||||
displayName: 'Build and Test C++17'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_GCC_Ubuntu_2004
|
||||
displayName: 'C: Linux GCC (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_GCC11_Cpp20_Ubuntu_2004
|
||||
displayName: 'C: Linux GCC-11 C++20 (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt install gcc-11 g++-11
|
||||
displayName: 'Install GCC-11'
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: gcc-11
|
||||
CXX: g++-11
|
||||
CXXFLAGS: '-std=c++20 -fext-numeric-literals'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Ubuntu_2004_LANG
|
||||
displayName: 'C: Linux Clang (Ubuntu 20.04) - LANG has extension tags'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
LANG: "en_US@calendar=gregorian;hours=h12"
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang13_Cpp20_Ubuntu_2004
|
||||
displayName: 'C: Linux Clang-13 C++20 (Ubuntu 20.04)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Install Clang-13 from https://apt.llvm.org/
|
||||
- script: |
|
||||
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
|
||||
sudo apt update
|
||||
sudo apt install -qy clang-13 lld-13 libc++-13-dev libc++abi-13-dev
|
||||
displayName: 'Install Clang-13'
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
|
||||
displayName: 'Build and Test'
|
||||
env:
|
||||
CC: clang-13
|
||||
CXX: clang++-13
|
||||
CXXFLAGS: '-std=c++20'
|
||||
#-------------------------------------------------------------------------
|
||||
# VS 2019 Builds
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Release_Distrelease
|
||||
displayName: 'C: MSVC 64-bit Release (VS 2019) + Distrelease'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
- task: PowerShell@2
|
||||
displayName: 'PowerShell: Distrelease script (x64)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: 'icu4c/packaging/distrelease.ps1'
|
||||
arguments: '-arch x64'
|
||||
workingDirectory: icu4c
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish x64 Artifacts: icu-windows.zip'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
|
||||
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x64_Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Release_DataFilter
|
||||
displayName: 'C: MSVC 64-bit Release DataFilter (VS 2019)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- powershell: |
|
||||
$filterPath = $Env:BUILD_SOURCESDIRECTORY + "\.ci-builds\data-filter.json"
|
||||
$vstsCommandString = "vso[task.setvariable variable=ICU_DATA_FILTER_FILE]" + $filterPath
|
||||
Write-Host "##$vstsCommandString"
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution with Data Filter'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
msbuildArgs: '/p:SkipUWP=true'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x86_Release_Distrelease
|
||||
displayName: 'C: MSVC 32-bit Release (VS 2019) + Distrelease'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: Win32
|
||||
configuration: Release
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x86 Release'
|
||||
- task: PowerShell@2
|
||||
displayName: 'PowerShell: Distrelease script (x86)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: 'icu4c/packaging/distrelease.ps1'
|
||||
arguments: '-arch x86'
|
||||
workingDirectory: icu4c
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish x86 Artifacts: icu-windows.zip'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
|
||||
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x86_Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_ARM32_ARM64_Release_Distrelease
|
||||
displayName: 'C: MSVC x64 ARM32 ARM64 Release (VS 2019) + Distrelease ARM64'
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build ARM32'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: ARM
|
||||
configuration: Release
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build ARM64'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: ARM64
|
||||
configuration: Release
|
||||
- task: PowerShell@2
|
||||
displayName: 'PowerShell: Distrelease script (ARM64)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: 'icu4c/packaging/distrelease.ps1'
|
||||
arguments: '-arch ARM64'
|
||||
workingDirectory: icu4c
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish ARM64 Artifacts: icu-windows.zip'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
|
||||
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_ARM64_Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_ARM64_Debug
|
||||
displayName: 'C: MSVC x64 ARM64 Debug (VS 2019)'
|
||||
timeoutInMinutes: 45
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Debug
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run x64 Debug Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Debug'
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build ARM64 Debug'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: ARM64
|
||||
configuration: Debug
|
||||
#-------------------------------------------------------------------------
|
||||
# There is no /std:c++20 yet, so use c++latest as that includes many of
|
||||
# the C++20 compiler and library changes.
|
||||
- job: ICU4C_MSVC_x64_Release_CppLatest
|
||||
displayName: 'C: MSVC 64-bit Release (VS 2019) /std:c++latest'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
msbuildArgs: '/p:LanguageStandard="stdcpplatest"'
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
#-------------------------------------------------------------------------
|
||||
# VS2019 using the VS2017 toolset builds
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Release_VS2017
|
||||
displayName: 'C: MSVC 64-bit Release (VS 2017)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
msbuildArgs: /p:DefaultPlatformToolset=v141
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x86_Debug_VS2017
|
||||
displayName: 'C: MSVC 32-bit Debug (VS 2017)'
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: Win32
|
||||
configuration: Debug
|
||||
msbuildArgs: /p:DefaultPlatformToolset=v141
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x86 Debug'
|
||||
#-------------------------------------------------------------------------
|
||||
# VS2019 using the VS2015 toolset
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSVC_x64_Release_VS2015
|
||||
displayName: 'C: MSVC 64-bit Release (VS 2015)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: x64
|
||||
configuration: Release
|
||||
msbuildArgs: /p:SkipUWP=true /p:DefaultPlatformToolset=v140 /p:AutodetectWin10SDK=true
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: 'x64 Release'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_MSYS2_GCC_x86_64_Release
|
||||
displayName: 'C: MSYS2 GCC x86_64 Release'
|
||||
timeoutInMinutes: 45
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
demands:
|
||||
- Cmd
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
choco install -y msys2
|
||||
rem refreshenv
|
||||
displayName: 'Install MSYS2'
|
||||
- script: |
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Hello World' && uname -a"
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain"
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S make"
|
||||
exit
|
||||
displayName: 'Install mingw-w64-x86_64-toolchain'
|
||||
- script: |
|
||||
set MSYSTEM=MINGW64
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && ./runConfigureICU MinGW --prefix='/tmp/build-icu' && make -j2 check"
|
||||
displayName: 'Build and Test'
|
||||
- script: |
|
||||
set MSYSTEM=MINGW64
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && make install && cd /tmp/build-icu && echo 'Recursive ls' && ls -lR"
|
||||
displayName: 'make install'
|
||||
- script: |
|
||||
set MSYSTEM=MINGW64
|
||||
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Run icuinfo from MSYS shell' && cd /tmp/build-icu/bin && ./icuinfo.exe"
|
||||
echo 'Run icuinfo from CMD shell' && cd /d C:\tools\msys64\tmp\build-icu\bin && set PATH=C:\tools\msys64\mingw64\bin;%PATH% && icuinfo.exe"
|
||||
displayName: 'run icuinfo'
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_MacOSX_WarningsAsErrors
|
||||
displayName: 'C: macOSX Clang WarningsAsErrors (Catalina 10.15)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'macOS-10.15'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor" && cd icu4c/source && ./runConfigureICU MacOSX && make -j2 check
|
||||
displayName: 'Build and Test (WarningsAsErrors)'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Cygwin_GCC_x86_64_Release
|
||||
displayName: 'C: Cygwin GCC x86_64 Release'
|
||||
timeoutInMinutes: 180
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
variables:
|
||||
ICU_CI_CACHE: c:\icu-ci-cache
|
||||
CYG_URL: https://cygwin.com/setup-x86_64.exe
|
||||
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
|
||||
CYG_PACKAGES: automake,gcc-core,gcc-g++,make,pkg-config,perl,python3
|
||||
CYG_ROOT: c:\cygwin-root
|
||||
CYG_CACHE: '$(ICU_CI_CACHE)\cygwin64-v3'
|
||||
CYG_CACHED_SETUP: '$(CYG_CACHE)\setup.exe'
|
||||
CYG_VERSION_KEY: cygwin-3.2
|
||||
steps:
|
||||
# Use 'autocrlf input' since checked-in files may already be using CRLF.
|
||||
- script: |
|
||||
git config --global core.autocrlf input
|
||||
displayName: 'Configure Git to checkout with Unix line endings (LF)'
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Cache expires after 7 days of no activity.
|
||||
- task: Cache@2
|
||||
displayName: 'Restore Cygwin cache'
|
||||
inputs:
|
||||
# Use the contents of the file ".azure-pipelines.yml" as part of the key, as that contains the list of CYG_PACKAGES.
|
||||
# Also include the Cygwin version as part of the key. If we want to use a newer version of Cygwin, we can update CYG_VERSION_KEY.
|
||||
# Note: CYG_VERSION_KEY may become out of sync with (older than) the version we actually use if we update this file
|
||||
# without updating CYG_VERSION_KEY. Any updates to this file guarantees that we're using the latest version.
|
||||
key: '"$(CYG_VERSION_KEY)" | .ci-builds/.azure-pipelines.yml'
|
||||
path: "$(CYG_CACHE)"
|
||||
- task: PowerShell@2
|
||||
displayName: 'Download Cygwin setup'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
if ( !(Test-Path "${env:CYG_CACHED_SETUP}" -NewerThan (Get-Date).AddDays(-7)) )
|
||||
{
|
||||
Write-Host "Cached Cygwin setup does not exist or is older than 7 days, downloading from external site."
|
||||
|
||||
New-Item -Force -Type Directory $env:CYG_CACHE
|
||||
Write-Host "Downloading Cygwin setup..."
|
||||
|
||||
$start_time = Get-Date
|
||||
(New-Object System.Net.WebClient).DownloadFile($env:CYG_URL, $env:CYG_CACHED_SETUP)
|
||||
|
||||
Write-Output "Download took: $((Get-Date).Subtract($start_time).Seconds) second(s)."
|
||||
}
|
||||
- script: |
|
||||
%CYG_CACHED_SETUP% --no-verify --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site "%CYG_MIRROR%" --root "%CYG_ROOT%" --local-package-dir "%CYG_CACHE%" --packages "%CYG_PACKAGES%"
|
||||
displayName: 'Install Cygwin'
|
||||
- script: |
|
||||
%CYG_ROOT%\\bin\\sh -lc 'echo Hello' && %CYG_ROOT%\\bin\\sh -lc 'uname -a'
|
||||
displayName: 'Check Cygwin environment'
|
||||
- script: |
|
||||
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && ./runConfigureICU Cygwin && make tests"
|
||||
displayName: 'Build ICU (source and test)'
|
||||
env:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
- script: |
|
||||
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && make check"
|
||||
displayName: 'Run Tests'
|
||||
env:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_icuexportdata_Ubuntu_1804
|
||||
displayName: 'C: Create Artifacts from icuexportdata'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU Linux && make -j2
|
||||
displayName: 'Build'
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
- script: |
|
||||
mkdir -p icu4c/source/icuexportdata_uprops_full/fast
|
||||
mkdir -p icu4c/source/icuexportdata_uprops_full/small
|
||||
cd icu4c/source
|
||||
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_full/fast --trie-type fast --all
|
||||
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_full/small --trie-type small --all
|
||||
displayName: 'Build Unicode property data export file (Full)'
|
||||
# In the sample file, include:
|
||||
# - Basic binary properties: AHex WSpace
|
||||
# - Property of strings: Basic_Emoji
|
||||
# - POSIX binary property: blank
|
||||
# - Enumerated properties: gc nt sc
|
||||
- script: |
|
||||
mkdir -p icu4c/source/icuexportdata_uprops_sample/fast
|
||||
mkdir -p icu4c/source/icuexportdata_uprops_sample/small
|
||||
cd icu4c/source
|
||||
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_sample/fast --trie-type fast AHex gc nt Basic_Emoji sc WSpace blank
|
||||
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_sample/small --trie-type small AHex gc nt Basic_Emoji sc WSpace blank
|
||||
displayName: 'Build Unicode property data export file (Sample)'
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: icuexportdata_uprops_full'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/icuexportdata_uprops_full'
|
||||
ArtifactName: 'icuexportdata_uprops_full'
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: icuexportdata_uprops_sample'
|
||||
inputs:
|
||||
PathtoPublish: 'icu4c/source/icuexportdata_uprops_sample'
|
||||
ArtifactName: 'icuexportdata_uprops_sample'
|
||||
@@ -0,0 +1,139 @@
|
||||
# Azure Pipelines (VSTS) configuration for testing things post merging
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- maint/*
|
||||
|
||||
|
||||
jobs:
|
||||
#-------------------------------------------------------------------------
|
||||
# VS 2022 Builds for testing C Samples on Windows
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Samples_MSVC
|
||||
displayName: 'C: Test Samples MSVC (VS 2022)'
|
||||
timeoutInMinutes: 30
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
demands:
|
||||
- msbuild
|
||||
- visualstudio
|
||||
- Cmd
|
||||
strategy:
|
||||
maxParallel: 0
|
||||
matrix:
|
||||
x64_Debug:
|
||||
arch: x64
|
||||
config: Debug
|
||||
platform: x64
|
||||
x64_Release:
|
||||
arch: x64
|
||||
config: Release
|
||||
platform: x64
|
||||
x86_Debug:
|
||||
arch: x86
|
||||
config: Debug
|
||||
platform: Win32
|
||||
x86_Release:
|
||||
arch: x86
|
||||
config: Release
|
||||
platform: Win32
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/allinone/allinone.sln
|
||||
platform: $(platform)
|
||||
configuration: $(config)
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run Tests (icucheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/allinone/icucheck.bat
|
||||
arguments: '$(arch) $(config)'
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build Sample Solution'
|
||||
inputs:
|
||||
solution: icu4c/source/samples/all/all.sln
|
||||
platform: $(arch)
|
||||
configuration: $(config)
|
||||
- task: BatchScript@1
|
||||
displayName: 'Test Samples (samplecheck.bat)'
|
||||
inputs:
|
||||
filename: icu4c/source/samples/all/samplecheck.bat
|
||||
arguments: '$(arch) $(config)'
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Other C tests
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
- job: ICU4C_Cygwin_GCC_x86_64_Release
|
||||
displayName: 'C: Cygwin GCC x86_64 Release'
|
||||
timeoutInMinutes: 50
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
variables:
|
||||
ICU_CI_CACHE: c:\icu-ci-cache
|
||||
CYG_URL: https://cygwin.com/setup-x86_64.exe
|
||||
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
|
||||
CYG_PACKAGES: automake,gcc-core,gcc-g++,make,pkg-config,perl,python3
|
||||
CYG_ROOT: c:\cygwin-root
|
||||
CYG_CACHE: '$(ICU_CI_CACHE)\cygwin64-v3'
|
||||
CYG_CACHED_SETUP: '$(CYG_CACHE)\setup.exe'
|
||||
CYG_VERSION_KEY: cygwin-3.2
|
||||
steps:
|
||||
# Use 'autocrlf input' since checked-in files may already be using CRLF.
|
||||
- script: |
|
||||
git config --global core.autocrlf input
|
||||
displayName: 'Configure Git to checkout with Unix line endings (LF)'
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
# Cache expires after 7 days of no activity.
|
||||
- task: Cache@2
|
||||
displayName: 'Restore Cygwin cache'
|
||||
inputs:
|
||||
# Use the contents of the file ".azure-pipelines-icu4c.yml" as part of the key, as that contains the list of CYG_PACKAGES.
|
||||
# Also include the Cygwin version as part of the key. If we want to use a newer version of Cygwin, we can update CYG_VERSION_KEY.
|
||||
# Note: CYG_VERSION_KEY may become out of sync with (older than) the version we actually use if we update this file
|
||||
# without updating CYG_VERSION_KEY. Any updates to this file guarantees that we're using the latest version.
|
||||
key: '"$(CYG_VERSION_KEY)" | .ci-builds/.azure-pipelines-icu4c.yml'
|
||||
path: "$(CYG_CACHE)"
|
||||
- task: PowerShell@2
|
||||
displayName: 'Download Cygwin setup'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
if ( !(Test-Path "${env:CYG_CACHED_SETUP}" -NewerThan (Get-Date).AddDays(-7)) )
|
||||
{
|
||||
Write-Host "Cached Cygwin setup does not exist or is older than 7 days, downloading from external site."
|
||||
|
||||
New-Item -Force -Type Directory $env:CYG_CACHE
|
||||
Write-Host "Downloading Cygwin setup..."
|
||||
|
||||
$start_time = Get-Date
|
||||
(New-Object System.Net.WebClient).DownloadFile($env:CYG_URL, $env:CYG_CACHED_SETUP)
|
||||
|
||||
Write-Output "Download took: $((Get-Date).Subtract($start_time).Seconds) second(s)."
|
||||
}
|
||||
- script: |
|
||||
%CYG_CACHED_SETUP% --no-verify --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site "%CYG_MIRROR%" --root "%CYG_ROOT%" --local-package-dir "%CYG_CACHE%" --packages "%CYG_PACKAGES%"
|
||||
displayName: 'Install Cygwin'
|
||||
- script: |
|
||||
%CYG_ROOT%\\bin\\sh -lc 'echo Hello' && %CYG_ROOT%\\bin\\sh -lc 'uname -a'
|
||||
displayName: 'Check Cygwin environment'
|
||||
- script: |
|
||||
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && ./runConfigureICU Cygwin && make tests -j -l2.5"
|
||||
displayName: 'Build ICU (source and test)'
|
||||
env:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
- script: |
|
||||
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && make -j -l2.5 check"
|
||||
displayName: 'Run Tests'
|
||||
env:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
@@ -1,70 +0,0 @@
|
||||
# Azure Pipelines configuration for Valgrind for ICU4C.
|
||||
#
|
||||
# Note: The valgrind test configuration is in a separate file
|
||||
# as it used to be run independently from the regular CI builds.
|
||||
#
|
||||
# The Ubuntu images don't have valgrind installed by default, so we need
|
||||
# install it first.
|
||||
#
|
||||
# Run Valgrind for every Pull Request that goes into main
|
||||
# or a maint- branch. This lets us catch any issues sooner rather than later.
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- maint/maint-*
|
||||
paths:
|
||||
include:
|
||||
- '*'
|
||||
exclude:
|
||||
- docs/*
|
||||
- icu4j/*
|
||||
- tools/*
|
||||
- vendor/*
|
||||
- .cpyskip.txt
|
||||
- .travis.yml
|
||||
- KEYS
|
||||
- README.md
|
||||
|
||||
jobs:
|
||||
#-------------------------------------------------------------------------
|
||||
- job: ICU4C_Clang_Valgrind_Ubuntu_1804
|
||||
displayName: 'C: Linux Clang Valgrind (Ubuntu 18.04)'
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- checkout: self
|
||||
lfs: true
|
||||
fetchDepth: 10
|
||||
- script: |
|
||||
set -ex
|
||||
sudo apt -y update
|
||||
sudo apt install -y valgrind
|
||||
displayName: 'Install valgrind'
|
||||
timeoutInMinutes: 5
|
||||
- script: |
|
||||
cd icu4c/source && ./runConfigureICU --enable-debug Linux --disable-renaming && make -j2 tests
|
||||
displayName: 'Build'
|
||||
timeoutInMinutes: 10
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
- script: |
|
||||
cd icu4c/source/test/intltest && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./intltest
|
||||
displayName: 'Valgrind intltest'
|
||||
timeoutInMinutes: 45
|
||||
- script: |
|
||||
cd icu4c/source/test/cintltst && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./cintltst
|
||||
displayName: 'Valgrind cintltst'
|
||||
timeoutInMinutes: 15
|
||||
- script: |
|
||||
cd icu4c/source/test/iotest && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./iotest
|
||||
displayName: 'Valgrind iotest'
|
||||
timeoutInMinutes: 5
|
||||
- script: |
|
||||
cd icu4c/source/tools/icuinfo && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./icuinfo
|
||||
displayName: 'Valgrind icuinfo'
|
||||
timeoutInMinutes: 5
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -24,7 +24,8 @@
|
||||
},
|
||||
"brkitr_dictionaries": {
|
||||
"blacklist": ["cjdict"]
|
||||
}
|
||||
},
|
||||
"lang_tree": "exclude"
|
||||
},
|
||||
"resourceFilters": [
|
||||
{
|
||||
|
||||
+4
-4
@@ -92,10 +92,10 @@ icu4c/source/tools/tzcode/zic.c
|
||||
#
|
||||
icu4j/eclipse-build/pdebuild/allElements.xml
|
||||
icu4j/eclipse-build/pdebuild/customTargets.xml
|
||||
icu4j/main/tests/core/src/com/ibm/icu/dev/data/IDNATestInput.txt
|
||||
icu4j/main/tests/core/src/com/ibm/icu/dev/data/unicode/confusablesWholeScript.txt
|
||||
icu4j/main/tests/core/src/com/ibm/icu/dev/data/unicode/UnicodeData.txt
|
||||
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/testdata/*
|
||||
icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/IDNATestInput.txt
|
||||
icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/unicode/confusablesWholeScript.txt
|
||||
icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/unicode/UnicodeData.txt
|
||||
icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/message2/*.json
|
||||
icu4j/perf-tests/data/conversion/*
|
||||
icu4j/perf-tests/data/udhr/*
|
||||
icu4j/perf-tests/data/collation/thesis.txt
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// © 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
|
||||
//
|
||||
// Include Japanese adaboost model.
|
||||
{
|
||||
"featureFilters": {
|
||||
"brkitr_adaboost": {
|
||||
"includelist": [
|
||||
"jaml"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -0,0 +1,61 @@
|
||||
# Copyright (C) 2023 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# This workflow is designed to keep specific caches on the main
|
||||
# branch from getting evicted according to the Github Actions policy
|
||||
# (currently in 2023: 7 days) in cases where the cost to construct
|
||||
# the cache is high, especially in cases where there is flakiness
|
||||
# (ex: network loss / throttling when downloading artifacts) involved in
|
||||
# constructing the cache.
|
||||
#
|
||||
# Preventing a cache from eviction using this workflow requires that:
|
||||
# - the cache is not too big that it starves other caches
|
||||
# from using the shared cache quota for the repository
|
||||
# - the cache key is specific enough to avoid cache collisions, according
|
||||
# to good cache key design
|
||||
# - the cache key is not overly specific to cause unnecessary cache misses
|
||||
# (resulting in duplicate caches values, thereby wasting space), according
|
||||
# to good cache key design
|
||||
# - For more details, see: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
|
||||
|
||||
name: Retain Specific Caches
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Because the Github Actions cache eviction policy is every 7 days,
|
||||
# this cron schedule is set to run every 6 days to ensure retention
|
||||
- cron: '0 12 */6 * *'
|
||||
|
||||
env:
|
||||
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
retain-maven-cache:
|
||||
name: Run all tests with Maven
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '11'
|
||||
- name: Restore read-only cache of local Maven repository
|
||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
id: cache
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- name: Run Maven unit & integration tests
|
||||
run: |
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify
|
||||
@@ -0,0 +1,573 @@
|
||||
# Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# GitHub Action configuration script for ICU continuous integration tasks.
|
||||
|
||||
name: GHA ICU4C
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'maint/maint*'
|
||||
paths:
|
||||
- 'icu4c/**'
|
||||
- '.github/workflows/**'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
paths:
|
||||
- 'icu4c/**'
|
||||
- '.github/workflows/**'
|
||||
workflow_dispatch:
|
||||
# To trigger the Env Test workflow manually, follow the instructions in
|
||||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
# ICU4C docs build using doxygen..
|
||||
icu4c-docs-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C doc
|
||||
run: |
|
||||
sudo apt-get -y install doxygen;
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux --disable-renaming;
|
||||
# Fail if 'warning:' appears in doxygen's output, but ignore warnings from file Doxyfile.
|
||||
# Regex note: (?! ... ) is a negative lookahead. Succeed if the pattern is not present.
|
||||
set +o pipefail && make doc 2>&1 | tee doxygen.log && ( ! grep -P 'warning:(?! .* file .?Doxyfile)' doxygen.log )
|
||||
|
||||
# gcc debug build.
|
||||
# Includes dependency checker.
|
||||
# Note - the dependency checker needs to be run on both a debug and an optimized build.
|
||||
# This one (gcc) for debug, and linux clang (see job below) for optimized.
|
||||
#
|
||||
# Test both out-of-source and in-source builds. This one (gcc) for out-of-source,
|
||||
# and linux clang (below) for in-source.
|
||||
#
|
||||
# Invokes test/hdrtst to check public headers compliance.
|
||||
gcc-debug-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C with gcc
|
||||
env:
|
||||
PREFIX: /tmp/icu-prefix
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
../icu4c/source/runConfigureICU --enable-debug --disable-release Linux/gcc --prefix=$PREFIX --enable-tracing;
|
||||
make -j -l4.5 check;
|
||||
( cd ../icu4c/source/test/depstest && ./depstest.py ../../../../build/ );
|
||||
make install;
|
||||
PATH=$PREFIX/bin:$PATH make -C test/hdrtst check
|
||||
|
||||
# clang release build with some options to enforce useful constraints.
|
||||
# Includes dependency checker on an in-source, optimized build.
|
||||
# Includes checking @draft etc. API tags vs. ifndef guards like
|
||||
# U_HIDE_DRAFT_API and U_FORCE_HIDE_DRAFT_API.
|
||||
# (FORCE guards make this tool pass but won't compile to working code.
|
||||
# See the testtagsguards.sh script for details.)
|
||||
clang-release-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Install doxygen
|
||||
run: |
|
||||
sudo apt-get -y install doxygen;
|
||||
- name: Build ICU4C with clang
|
||||
env:
|
||||
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
|
||||
CFLAGS: -Wimplicit-fallthrough
|
||||
CXXFLAGS: -Wimplicit-fallthrough
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux/clang;
|
||||
make -j -l4.5 check;
|
||||
- name: Test Dependency
|
||||
run: |
|
||||
cd icu4c/source/test/depstest;
|
||||
python3 depstest.py ../../../source/;
|
||||
- name: Test Tags Guards
|
||||
run: |
|
||||
cd icu4c;
|
||||
source/test/hdrtst/testtagsguards.sh;
|
||||
- name: Make Dist
|
||||
env:
|
||||
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
|
||||
CFLAGS: -Wimplicit-fallthrough
|
||||
CXXFLAGS: -Wimplicit-fallthrough
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
make dist
|
||||
|
||||
# clang build with some options
|
||||
clang-options-build-and-test:
|
||||
strategy:
|
||||
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other options.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_option:
|
||||
[ --enable-static, --enable-static --disable-shared ]
|
||||
# --disable-shared has a build problem.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Build ICU4C with clang
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux/clang ${{ matrix.build_option }};
|
||||
make -j -l4.5 tests;
|
||||
- name: Test
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
make check;
|
||||
|
||||
# Out of source build with gcc 10, c++14, and extra warnings; executes icuinfo.
|
||||
gcc-10-stdlib17:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C with gcc 10 and c++17 and extra warnings.
|
||||
env:
|
||||
PREFIX: /tmp/icu-prefix
|
||||
CC: gcc-10
|
||||
CXX: g++-10
|
||||
CXXFLAGS: -std=c++17 -Wextra
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
../icu4c/source/runConfigureICU Linux --disable-layout --disable-layoutex --prefix=$PREFIX;
|
||||
make -j -l4.5 check;
|
||||
make -j -l4.5 install;
|
||||
cd $PREFIX/bin;
|
||||
LD_LIBRARY_PATH=../lib ./icuinfo
|
||||
|
||||
# Clang Linux with address sanitizer.
|
||||
clang-asan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C with clang and asan
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming --enable-tracing;
|
||||
make -j -l4.5 check;
|
||||
env:
|
||||
CPPFLAGS: -fsanitize=address
|
||||
LDFLAGS: -fsanitize=address
|
||||
# Clang Linux with undefined-behavior sanitizer.
|
||||
clang-ubsan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C with clang and ubsan +alignment
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming;
|
||||
make -j -l4.5 check;
|
||||
env:
|
||||
CPPFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
|
||||
CFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
|
||||
LDFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
|
||||
# Control Flow Integrity.
|
||||
clang-cfi:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C with clang using CFI
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux --disable-renaming;
|
||||
make -j -l4.5 check;
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
# add -fsanitize=cfi-vcall -fsanitize=cfi-icall later
|
||||
CXXFLAGS: -flto -fvisibility=hidden -fsanitize=cfi-derived-cast -fno-sanitize-trap=cfi -fno-inline-functions -fno-inline -fno-omit-frame-pointer -O1
|
||||
# add -fsanitize=cfi-vcall -fsanitize=cfi-icall later
|
||||
LDFLAGS: -flto -fvisibility=hidden -fuse-ld=gold -fsanitize=cfi-derived-cast -fsanitize=cfi-unrelated-cast -fno-sanitize-trap=cfi -fsanitize-cfi-icall-generalize-pointers
|
||||
|
||||
# Clang Linux with thread sanitizer.
|
||||
clang-tsan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C with clang and tsan
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming
|
||||
make -j -l4.5;
|
||||
make -j -l4.5 -C test;
|
||||
make -j -l4.5 -C test/intltest check
|
||||
env:
|
||||
INTLTEST_OPTS: utility/MultithreadTest
|
||||
CPPFLAGS: -fsanitize=thread
|
||||
LDFLAGS: -fsanitize=thread
|
||||
|
||||
# MacOS with clang
|
||||
macos-clang:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C with clang on MacOS
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
PYTHON=python3 ./runConfigureICU MacOSX;
|
||||
make -j -l4.5 check
|
||||
|
||||
# Run ICU4C tests with stubdata.
|
||||
run-with-stubdata:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C tests with stubdata
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
make -j -l4.5 check;
|
||||
rm lib/libicudata.so*;
|
||||
cp -P stubdata/libicudata.so* lib;
|
||||
|
||||
cd test/cintltst;
|
||||
echo 'Running ICU4C cintltst with stubdata.';
|
||||
# Note: 'Elapsed Time: ' is printed by makefile upon final success.
|
||||
CINTLTST_OPTS=-w make -j -l4.5 check 2>&1 | tee stubdata_ctest.log;
|
||||
if ! grep 'Elapsed Time: ' stubdata_ctest.log
|
||||
then
|
||||
echo
|
||||
echo cintltst run with stubdata failed
|
||||
echo
|
||||
echo See
|
||||
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
|
||||
echo for how to reproduce and debug the failure
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ../intltest;
|
||||
echo 'Running ICU4C intltest with stubdata.';
|
||||
INTLTEST_OPTS=-w make -j -l4.5 check 2>&1 | tee stubdata_intltest.log;
|
||||
if ! grep 'Elapsed Time: ' stubdata_intltest.log
|
||||
then
|
||||
echo
|
||||
echo intltest run with stubdata failed
|
||||
echo
|
||||
echo See
|
||||
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
|
||||
echo for how to reproduce and debug the failure
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test U_CHARSET_IS_UTF8
|
||||
u-charset-is-utf8-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1";
|
||||
make -j -l4.5 check
|
||||
|
||||
# Test U_OVERRIDE_CXX_ALLOCATION-is-0-test
|
||||
u-override-cxx-allocation-is-0-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0";
|
||||
make clean;
|
||||
make -j -l4.5 check
|
||||
|
||||
# Test LSTM
|
||||
lstm-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
|
||||
make clean;
|
||||
make -j -l4.5 check
|
||||
|
||||
# Test adaboost
|
||||
adaboost-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
ICU_DATA_FILTER_FILE=../../.github/adaboost.json CPPFLAGS=-DUCONFIG_USE_ML_PHRASE_BREAKING=1 ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
|
||||
make clean;
|
||||
make -j -l4.5 check
|
||||
|
||||
# Build and run testmap
|
||||
testmap:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
make -j -l4.5 check;
|
||||
CONFIG_FILES=test/testmap/Makefile ./config.status;
|
||||
cd test/testmap;
|
||||
make -j -l4.5 check | grep '*** PASS PASS PASS, test PASSED!!!!!!!!'
|
||||
|
||||
# Copyright scan
|
||||
copyright-scan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: perl tools/scripts/cpysearch/cpyscan.pl
|
||||
|
||||
# Check compilation of internal headers.
|
||||
internal-header-compilation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: cd icu4c/source; test/hdrtst/testinternalheaders.sh
|
||||
|
||||
# Check source files for valid UTF-8 and for absence of BOM.
|
||||
valid-UTF-8-and-no-BOM-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- run: tools/scripts/icu-file-utf8-check.py
|
||||
|
||||
# Run unit tests with UCONFIG_NO_XXX variations.
|
||||
uconfig-unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other uconfig.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
uconfig_cppflags:
|
||||
# Ignore the following two.
|
||||
# - "-DUCONFIG_NO_FILE_IO=1"
|
||||
# - "-DUCONFIG_NO_CONVERSION=1"
|
||||
- "-DUCONFIG_NO_LEGACY_CONVERSION=1"
|
||||
- "-DUCONFIG_NO_NORMALIZATION=1"
|
||||
- "-DUCONFIG_NO_BREAK_ITERATION=1"
|
||||
- "-DUCONFIG_NO_IDNA=1"
|
||||
- "-DUCONFIG_NO_COLLATION=1"
|
||||
- "-DUCONFIG_NO_FORMATTING=1"
|
||||
- "-DUCONFIG_NO_MF2=1"
|
||||
- "-DUCONFIG_NO_TRANSLITERATION=1"
|
||||
- "-DUCONFIG_NO_REGULAR_EXPRESSIONS=1"
|
||||
- "-DUCONFIG_NO_SERVICE=1"
|
||||
- "-DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
|
||||
# Turn on all the options in one test.
|
||||
- "-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_NORMALIZATION=1 -DUCONFIG_NO_BREAK_ITERATION=1 -DUCONFIG_NO_IDNA=1 -DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_MF2=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DUCONFIG_NO_SERVICE=1 -DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Verify no additional new UCONFIG_NO_xxx added
|
||||
run: |
|
||||
# Test that we have exactly 13 "#ifndef UCONFIG_NO_" in uconfig.h. If the number changes, we need to also
|
||||
# adjust the uconfig_cppflags above to include the new one and update the "13" below.
|
||||
expected_count="13";
|
||||
count=`egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h| wc -l`;
|
||||
if [ $expected_count != $count ]; then
|
||||
echo "More than %s UCONFIG_NO_* defined in uconfig.h, please adjust uconfig_cppflags above to include any newly added flag" % $expected_count;
|
||||
echo "Currently UCONFIG_NO_* defined in uconfig.h:";
|
||||
egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h;
|
||||
exit -1
|
||||
fi
|
||||
- name: Build and Test
|
||||
env:
|
||||
CPPFLAGS: ${{ matrix.uconfig_cppflags }}
|
||||
run: |
|
||||
cd icu4c/source/;
|
||||
./runConfigureICU Linux;
|
||||
make -j -l4.5 tests;
|
||||
|
||||
# Run header tests with UCONFIG_NO_XXX variations.
|
||||
uconfig-header-tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other uconfig.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
uconfig_cppflags:
|
||||
# Ignore the following two.
|
||||
# - "-DUCONFIG_NO_FILE_IO=1"
|
||||
# - "-DUCONFIG_NO_CONVERSION=1"
|
||||
- "-DUCONFIG_NO_LEGACY_CONVERSION=1"
|
||||
- "-DUCONFIG_NO_NORMALIZATION=1"
|
||||
- "-DUCONFIG_NO_BREAK_ITERATION=1"
|
||||
- "-DUCONFIG_NO_IDNA=1"
|
||||
- "-DUCONFIG_NO_COLLATION=1"
|
||||
- "-DUCONFIG_NO_FORMATTING=1"
|
||||
- "-DUCONFIG_NO_MF2=1"
|
||||
- "-DUCONFIG_NO_TRANSLITERATION=1"
|
||||
- "-DUCONFIG_NO_REGULAR_EXPRESSIONS=1"
|
||||
- "-DUCONFIG_NO_SERVICE=1"
|
||||
- "-DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
|
||||
# Turn on all the options in one test.
|
||||
- "-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_NORMALIZATION=1 -DUCONFIG_NO_BREAK_ITERATION=1 -DUCONFIG_NO_IDNA=1 -DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_MF2=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DUCONFIG_NO_SERVICE=1 -DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Verify no additional new UCONFIG_NO_xxx added
|
||||
run: |
|
||||
# Test that we have exactly 13 "#ifndef UCONFIG_NO_" in uconfig.h. If the number changes, we need to also
|
||||
# adjust the uconfig_cppflags above to include the new one and update the "13" below.
|
||||
count=`egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h| wc -l`;
|
||||
if [ "13" != $count ]; then
|
||||
echo "More than %s UCONFIG_NO_* defined in uconfig.h, please adjust uconfig_cppflags above to include any newly added flag" % $count;
|
||||
echo "Currently UCONFIG_NO_* defined in uconfig.h:";
|
||||
egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h;
|
||||
exit -1
|
||||
fi
|
||||
- name: Build and Install
|
||||
run: |
|
||||
cd icu4c/source/;
|
||||
mkdir /tmp/icu_cnfg;
|
||||
./runConfigureICU Linux --prefix=/tmp/icu_cnfg;
|
||||
make -j -l4.5 install;
|
||||
- name: Test
|
||||
env:
|
||||
UCONFIG_NO: ${{ matrix.uconfig_cppflags }}
|
||||
run: |
|
||||
cd icu4c/source/;
|
||||
PATH=/tmp/icu_cnfg/bin:$PATH make -C test/hdrtst check;
|
||||
|
||||
# Build Unicode update tools
|
||||
unicode-update-tools:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3.0.0
|
||||
- name: Get CI Linux runner VM version
|
||||
id: linux-version
|
||||
run: |
|
||||
echo "LINUX_VERSION=$(grep -F VERSION_ID /etc/os-release | cut -d'"' -f2)" >> $GITHUB_OUTPUT
|
||||
- name: Mount bazel cache
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: "~/.cache/bazel"
|
||||
key: bazel-${{ runner.os }}-${{ steps.linux-version.outputs.LINUX_VERSION }}
|
||||
|
||||
- name: Generate the data
|
||||
run: |
|
||||
export ICU_SRC=`pwd`;
|
||||
icu4c/source/data/unidata/generate.sh;
|
||||
if $?
|
||||
then
|
||||
echo
|
||||
echo Build of Unicode update tools failed.
|
||||
echo See
|
||||
echo https://unicode-org.github.io/icu/processes/unicode-update#bazel-build-process
|
||||
echo for how to reproduce and debug the failure
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git diff --exit-code;
|
||||
if $?
|
||||
then
|
||||
echo
|
||||
echo ICU unicode data has changed!
|
||||
echo Did you forget to include the changed data files in this PR?
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build and run ICU4C samples
|
||||
icu4c-test-samples:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: ICU4C configure and build
|
||||
run: |
|
||||
# Perform an out-of-source build of icu4c
|
||||
mkdir /tmp/icu_samples
|
||||
cd icu4c/source
|
||||
./runConfigureICU Linux -prefix=/tmp/icu_samples
|
||||
make install
|
||||
# Reference the paths in the new build
|
||||
cd samples
|
||||
# To clean all the test binaries
|
||||
make clean-samples-recursive
|
||||
# To rebuild them all
|
||||
echo "Make all samples"
|
||||
PATH=$PATH:/tmp/icu_samples/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/icu_samples/lib make all-samples-recursive
|
||||
# To run all tests serially
|
||||
echo "Run all samples"
|
||||
pwd
|
||||
PATH=$PATH:/tmp/icu_samples/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/icu_samples/lib make check-samples-recursive
|
||||
|
||||
# https://unicode-org.github.io/icu/processes/release/tasks/integration.html#verify-that-icu4c-tests-pass-without-collation-rule-strings
|
||||
icu4c-without-collation-rule-strings:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Install hjson dependency
|
||||
run: |
|
||||
sudo apt-get install python3-pip
|
||||
pip3 install hjson
|
||||
- name: Create data filter file to remove collation rule strings
|
||||
run: |
|
||||
cat > icu4c/coll-norules.hjson <<EOL
|
||||
{
|
||||
resourceFilters: [
|
||||
{
|
||||
categories: [
|
||||
coll_tree
|
||||
]
|
||||
rules: [
|
||||
-/UCARules
|
||||
-/collations/*/Sequence
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
EOL
|
||||
- name: Configure ICU4C with the data filter file
|
||||
env:
|
||||
ICU_DATA_FILTER_FILE: ../coll-norules.hjson
|
||||
run: |
|
||||
cd icu4c/source
|
||||
./runConfigureICU Linux
|
||||
- name: Run tests with data-errors-as-warnings
|
||||
env:
|
||||
INTLTEST_OPTS: -w
|
||||
CINTLTST_OPTS: -w
|
||||
run: |
|
||||
cd icu4c/source
|
||||
make -j -l4.5 check
|
||||
|
||||
# https://unicode-org.github.io/icu/processes/release/tasks/healthy-code.html#test-uconfig_no_conversion
|
||||
icu4c-uconfig-no-conversion:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Set UCONFIG_NO_CONVERSION and configure ICU4C
|
||||
env:
|
||||
UCONFIG_NO_CONVERSION: 1
|
||||
run: |
|
||||
cd icu4c/source
|
||||
./runConfigureICU Linux
|
||||
- name: Run make for stubdata, common, i18n
|
||||
run: |
|
||||
cd icu4c/source
|
||||
pushd stubdata && make -j -l4.5 && popd
|
||||
# Ensure lib directory for output object file exists
|
||||
mkdir -p lib
|
||||
pushd common && make -j -l4.5 && popd
|
||||
pushd i18n && make -j -l4.5 && popd
|
||||
@@ -0,0 +1,180 @@
|
||||
# Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# GitHub Action configuration script for ICU continuous integration tasks.
|
||||
|
||||
name: GHA ICU4J
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'maint/maint*'
|
||||
paths:
|
||||
- 'icu4j/**'
|
||||
- '.github/workflows/**'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
paths:
|
||||
- 'icu4j/**'
|
||||
- '.github/workflows/**'
|
||||
workflow_dispatch:
|
||||
# To trigger the Env Test workflow manually, follow the instructions in
|
||||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
|
||||
|
||||
env:
|
||||
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
# Initialize the Maven artifact cache
|
||||
#
|
||||
# This job is created according to the cache strategy of reuse from a single job:
|
||||
# https://github.com/actions/cache/blob/main/caching-strategies.md#make-cache-read-only--reuse-cache-from-centralized-job
|
||||
icu4j-mvn-init-cache:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
# Download all of the artifacts needed for the code and build plugins, but
|
||||
# exclude any needed by profiles depending on system artifacts
|
||||
- name: Download all artifacts
|
||||
run: |
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
|
||||
|
||||
# ICU4J build and unit test using Maven
|
||||
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
|
||||
icu4j-mvn-build-and-test:
|
||||
needs: icu4j-mvn-init-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java-version: [ '8', '11', '17' ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Restore read-only cache of local Maven repository
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ matrix.java-version }}
|
||||
- name: ICU4J
|
||||
run: |
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify
|
||||
- name: List failures (if any)
|
||||
run: |
|
||||
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`;
|
||||
if: ${{ failure() }}
|
||||
|
||||
# ICU4J build and unit test under lstm
|
||||
lstm-icu4j-build-and-test:
|
||||
if: false # TODO(ICU-22505)
|
||||
needs: icu4j-mvn-init-cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Restore read-only cache of local Maven repository
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '11'
|
||||
- name: Config LSTM and Rebuild data jar
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
|
||||
make clean;
|
||||
make -j -l4.5 ICU4J_ROOT=../../../icu4j icu4j-data-install;
|
||||
cd ../..
|
||||
- name: ICU4J
|
||||
run: |
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify
|
||||
- name: List failures (if any)
|
||||
run: |
|
||||
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`;
|
||||
if: ${{ failure() }}
|
||||
|
||||
# ICU4J build and unit test under adaboost
|
||||
adaboost-icu4j-build-and-test:
|
||||
if: false # Temporary disable, until we disable the .jar creation from C and distribute the individual files
|
||||
needs: icu4j-mvn-init-cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Restore read-only cache of local Maven repository
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '11'
|
||||
- name: Config Adaboost and Rebuild data jar
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/adaboost.json CPPFLAGS=-DUCONFIG_USE_ML_PHRASE_BREAKING=1 ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
|
||||
make clean;
|
||||
make -j -l4.5 ICU4J_ROOT=../../../icu4j icu4j-data-install;
|
||||
cd ../..
|
||||
- name: ICU4J
|
||||
run: |
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} -Dcom.ibm.icu.impl.breakiter.useMLPhraseBreaking=true verify
|
||||
- name: List failures (if any)
|
||||
run: |
|
||||
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`;
|
||||
if: ${{ failure() }}
|
||||
|
||||
@@ -1,442 +0,0 @@
|
||||
# Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# GitHub Action configuration script for ICU continuous integration tasks.
|
||||
|
||||
name: GHA CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'maint/maint*'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
|
||||
jobs:
|
||||
|
||||
# ICU4C docs build using doxygen..
|
||||
icu4c-docs-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C doc
|
||||
run: |
|
||||
sudo apt-get -y install doxygen;
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux --disable-renaming;
|
||||
# Fail if 'warning:' appears in doxygen's output, but ignore warnings from file Doxyfile.
|
||||
# Regex note: (?! ... ) is a negative lookahead. Succeed if the pattern is not present.
|
||||
set +o pipefail && make doc 2>&1 | tee doxygen.log && ( ! grep -P 'warning:(?! .* file .?Doxyfile)' doxygen.log )
|
||||
|
||||
# Java7 ICU4J build and unit test
|
||||
java7-icu4j-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '8'
|
||||
- name: Cache for Java 7 tarball
|
||||
id: cache-java7
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: java7-tarball
|
||||
key: ${{ runner.os }}-java7-tarball
|
||||
- name: Download Java 7
|
||||
if: steps.cache-java7.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p java7-tarball
|
||||
download_url="https://download.java.net/openjdk/jdk7u75/ri/openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz"
|
||||
wget -O java7-tarball/java_package.tar.gz $download_url
|
||||
pushd java7-tarball
|
||||
gunzip java_package.tar.gz
|
||||
tar xvf java_package.tar
|
||||
popd
|
||||
- name: Configure Ant build to use Java 7 JRE
|
||||
run: |
|
||||
echo "java7.bootclasspath" > $RUNNER_TEMP/draft
|
||||
ls java7-tarball/java-se-7u75-ri/jre/lib/*.jar|paste -sd ":" - >> $RUNNER_TEMP/draft
|
||||
paste -sd "=" < $RUNNER_TEMP/draft > icu4j/build-local.properties
|
||||
- name: ICU4J
|
||||
run: |
|
||||
cd icu4j;
|
||||
ant init;
|
||||
ant check;
|
||||
ant localespiCheck
|
||||
- name: List failures (if any)
|
||||
run: |
|
||||
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
|
||||
if: ${{ failure() }}
|
||||
|
||||
|
||||
# ICU4J build and unit test under Java11
|
||||
java11-icu4j-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '11'
|
||||
- name: ICU4J
|
||||
run: |
|
||||
cd icu4j;
|
||||
ant init;
|
||||
ant check;
|
||||
ant localespiCheck
|
||||
- name: List failures (if any)
|
||||
run: |
|
||||
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
|
||||
if: ${{ failure() }}
|
||||
|
||||
# ICU4J build and unit test under Java16
|
||||
java16-icu4j-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '16'
|
||||
- name: ICU4J
|
||||
run: |
|
||||
cd icu4j;
|
||||
ant init;
|
||||
ant check;
|
||||
ant localespiCheck
|
||||
- name: List failures (if any)
|
||||
run: |
|
||||
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
|
||||
if: ${{ failure() }}
|
||||
|
||||
# ICU4J build and unit test under lstm
|
||||
lstm-icu4j-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '11'
|
||||
- name: Config LSTM and Rebuild data jar
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
|
||||
make clean;
|
||||
make -j2 ICU4J_ROOT=../../../icu4j icu4j-data-install;
|
||||
cd ../..
|
||||
- name: ICU4J
|
||||
run: |
|
||||
cd icu4j;
|
||||
ant init;
|
||||
ant check;
|
||||
ant localespiCheck
|
||||
- name: List failures (if any)
|
||||
run: |
|
||||
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
|
||||
if: ${{ failure() }}
|
||||
|
||||
# gcc debug build.
|
||||
# Includes dependency checker.
|
||||
# Note - the dependency checker needs to be run on both a debug and an optimized build.
|
||||
# This one (gcc) for debug, and linux clang (see job below) for optimized.
|
||||
#
|
||||
# Test both out-of-source and in-source builds. This one (gcc) for out-of-source,
|
||||
# and linux clang (below) for in-source.
|
||||
#
|
||||
# Invokes test/hdrtst to check public headers compliance.
|
||||
gcc-debug-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C with gcc
|
||||
env:
|
||||
PREFIX: /tmp/icu-prefix
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
../icu4c/source/runConfigureICU --enable-debug --disable-release Linux/gcc --prefix=$PREFIX --enable-tracing;
|
||||
make -j2;
|
||||
make -j2 check;
|
||||
( cd ../icu4c/source/test/depstest && ./depstest.py ../../../../build/ );
|
||||
make install;
|
||||
PATH=$PREFIX/bin:$PATH make -C test/hdrtst check
|
||||
|
||||
# clang release build with some options to enforce useful constraints.
|
||||
# Includes dependency checker on an in-source, optimized build.
|
||||
# Includes checking @draft etc. API tags vs. ifndef guards like
|
||||
# U_HIDE_DRAFT_API and U_FORCE_HIDE_DRAFT_API.
|
||||
# (FORCE guards make this tool pass but won't compile to working code.
|
||||
# See the testtagsguards.sh script for details.)
|
||||
clang-release-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C with clang
|
||||
env:
|
||||
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
|
||||
CFLAGS: -Wimplicit-fallthrough
|
||||
CXXFLAGS: -Wimplicit-fallthrough
|
||||
run: |
|
||||
sudo apt-get -y install doxygen;
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
make -j 2;
|
||||
make -j 2 check;
|
||||
( cd test/depstest && python3 depstest.py ../../../source/ );
|
||||
( cd .. && source/test/hdrtst/testtagsguards.sh );
|
||||
make dist
|
||||
|
||||
# Out of source build with gcc 10, c++14, and extra warnings; executes icuinfo.
|
||||
gcc-10-stdlib14:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C with gcc 10 and c++14 and extra warnings.
|
||||
env:
|
||||
PREFIX: /tmp/icu-prefix
|
||||
CC: gcc-10
|
||||
CXX: g++-10
|
||||
CXXFLAGS: -std=c++14 -Wextra
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
../icu4c/source/runConfigureICU Linux --disable-layout --disable-layoutex --prefix=$PREFIX;
|
||||
make -j2;
|
||||
make -j2 check;
|
||||
make install;
|
||||
cd $PREFIX/bin;
|
||||
LD_LIBRARY_PATH=../lib ./icuinfo
|
||||
|
||||
# Clang Linux with address sanitizer.
|
||||
clang-asan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C with clang and asan
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU --enable-debug --disable-release Linux --disable-renaming --enable-tracing;
|
||||
make -j2;
|
||||
make -j2 check
|
||||
env:
|
||||
CPPFLAGS: -fsanitize=address
|
||||
LDFLAGS: -fsanitize=address
|
||||
|
||||
# Clang Linux with thread sanitizer.
|
||||
clang-tsan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C with clang and tsan
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU --enable-debug --disable-release Linux --disable-renaming
|
||||
make -j2;
|
||||
make -j2 -C test;
|
||||
make -j2 -C test/intltest check
|
||||
env:
|
||||
INTLTEST_OPTS: utility/MultithreadTest
|
||||
CPPFLAGS: -fsanitize=thread
|
||||
LDFLAGS: -fsanitize=thread
|
||||
|
||||
# MacOS with clang
|
||||
macos-clang:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C with clang on MacOS
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
PYTHON=python3 ./runConfigureICU MacOSX;
|
||||
make -j2 check
|
||||
|
||||
# Run ICU4C tests with stubdata.
|
||||
run-with-stubdata:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: ICU4C tests with stubdata
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
make -j2 check;
|
||||
rm lib/libicudata.so*;
|
||||
cp -P stubdata/libicudata.so* lib;
|
||||
|
||||
cd test/cintltst;
|
||||
echo 'Running ICU4C cintltst with stubdata.';
|
||||
# Note: 'Elapsed Time: ' is printed by makefile upon final success.
|
||||
CINTLTST_OPTS=-w make check 2>&1 | tee stubdata_ctest.log;
|
||||
if ! grep 'Elapsed Time: ' stubdata_ctest.log
|
||||
then
|
||||
echo
|
||||
echo cintltst run with stubdata failed
|
||||
echo
|
||||
echo See
|
||||
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
|
||||
echo for how to reproduce and debug the failure
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ../intltest;
|
||||
echo 'Running ICU4C intltest with stubdata.';
|
||||
INTLTEST_OPTS=-w make check 2>&1 | tee stubdata_intltest.log;
|
||||
if ! grep 'Elapsed Time: ' stubdata_intltest.log
|
||||
then
|
||||
echo
|
||||
echo intltest run with stubdata failed
|
||||
echo
|
||||
echo See
|
||||
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
|
||||
echo for how to reproduce and debug the failure
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test U_CHARSET_IS_UTF8
|
||||
u-charset-is-utf8-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1";
|
||||
make -j2 check
|
||||
|
||||
# Test U_OVERRIDE_CXX_ALLOCATION-is-0-test
|
||||
u-override-cxx-allocation-is-0-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0";
|
||||
make clean;
|
||||
make -j2 check
|
||||
|
||||
# Test LSTM
|
||||
lstm-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
|
||||
make clean;
|
||||
make -j2 check
|
||||
|
||||
# Build and run testmap
|
||||
testmap:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
make -j2 check;
|
||||
CONFIG_FILES=test/testmap/Makefile ./config.status;
|
||||
cd test/testmap;
|
||||
make check | grep '*** PASS PASS PASS, test PASSED!!!!!!!!'
|
||||
|
||||
# Copyright scan
|
||||
copyright-scan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: perl tools/scripts/cpysearch/cpyscan.pl
|
||||
|
||||
# Check compilation of internal headers.
|
||||
internal-header-compilation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: cd icu4c/source; test/hdrtst/testinternalheaders.sh
|
||||
|
||||
# Check source files for valid UTF-8 and for absence of BOM.
|
||||
valid-UTF-8-and-no-BOM-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: tools/scripts/icu-file-utf8-check.py
|
||||
|
||||
# Verify icu4c release tools buildability.
|
||||
icu4c-release-tools:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: mvn -f tools/release/java/pom.xml package dependency:analyze
|
||||
|
||||
# Run unit tests with UCONFIG_NO_XXX variations.
|
||||
uconfig_variation-check-unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: python3 tools/scripts/uconfig_vars_test.py -u
|
||||
|
||||
# Run header tests with UCONFIG_NO_XXX variations.
|
||||
uconfig_variation-check-all-header-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: python3 tools/scripts/uconfig_vars_test.py -p
|
||||
|
||||
# Build Unicode update tools
|
||||
unicode-update-tools:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: bazelbuild/setup-bazelisk@v1
|
||||
- name: Mount bazel cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: "~/.cache/bazel"
|
||||
key: bazel
|
||||
|
||||
- name: Generate the data
|
||||
run: |
|
||||
export ICU_SRC=`pwd`;
|
||||
icu4c/source/data/unidata/generate.sh;
|
||||
if $?
|
||||
then
|
||||
echo
|
||||
echo Build of Unicode update tools failed.
|
||||
echo See
|
||||
echo https://unicode-org.github.io/icu/processes/unicode-update#bazel-build-process
|
||||
echo for how to reproduce and debug the failure
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git diff --exit-code;
|
||||
if $?
|
||||
then
|
||||
echo
|
||||
echo ICU unicode data has changed!
|
||||
echo Did you forget to include the changed data files in this PR?
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,84 @@
|
||||
# Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# GitHub Action configuration script for ICU continuous integration tasks.
|
||||
|
||||
name: ICU Common
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'maint/maint*'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
workflow_dispatch:
|
||||
# To trigger the Env Test workflow manually, follow the instructions in
|
||||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
|
||||
|
||||
env:
|
||||
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
# Copyright scan
|
||||
copyright-scan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: perl tools/scripts/cpysearch/cpyscan.pl
|
||||
|
||||
# Check source files for valid UTF-8 and for absence of BOM.
|
||||
valid-UTF-8-and-no-BOM-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: tools/scripts/icu-file-utf8-check.py
|
||||
|
||||
# Initialize the Maven artifact cache
|
||||
#
|
||||
# This job is created according to the cache strategy of reuse from a single job:
|
||||
# https://github.com/actions/cache/blob/main/caching-strategies.md#make-cache-read-only--reuse-cache-from-centralized-job
|
||||
icu4j-mvn-init-cache:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
# Download all of the artifacts needed for the code and build plugins, but
|
||||
# exclude any needed by profiles depending on system artifacts
|
||||
- name: Download all artifacts
|
||||
run: |
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
|
||||
|
||||
# Verify icu4c release tools buildability.
|
||||
icu4c-release-tools:
|
||||
needs: icu4j-mvn-init-cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Restore read-only cache of local Maven repository
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- run: mvn ${SHARED_MVN_ARGS} -f tools/release/java/pom.xml package dependency:analyze
|
||||
@@ -0,0 +1,56 @@
|
||||
# Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# GitHub Action configuration script for ICU continuous integration tasks.
|
||||
|
||||
name: GHA ICU Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'maint/maint*'
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '.github/workflows/**'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '.github/workflows/**'
|
||||
workflow_dispatch:
|
||||
# To trigger the Env Test workflow manually, follow the instructions in
|
||||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# Build job
|
||||
# Keep in sync with deploy workflow in `jekyll-gh-pages.yml`
|
||||
test-docs-build:
|
||||
name: Test build of User Guide docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '2.7.4' # Not needed with a .ruby-version file
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
cache-version: 0 # Increment this number if you need to re-download cached gems
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v3
|
||||
with:
|
||||
generator_config_file: docs/_config.yml
|
||||
- name: Build with Jekyll
|
||||
# Outputs to the './_site' directory by default
|
||||
run: |
|
||||
cd docs # root directory of markdown, also contains Jekyll configs, etc.
|
||||
bundle install
|
||||
# The baseurl arg is parsed from the `baseurl` field of _config.yml.
|
||||
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
|
||||
env:
|
||||
JEKYLL_ENV: production
|
||||
@@ -0,0 +1,146 @@
|
||||
# Copyright (C) 2023 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# GitHub Action configuration script for ICU environment test tasks.
|
||||
#
|
||||
|
||||
name: GHA EnvTest
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# To trigger the Env Test workflow manually, follow the instructions in
|
||||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
|
||||
|
||||
schedule:
|
||||
# This cron schedule is set to run 10:23 UTC every SAT
|
||||
- cron: '23 10 * * SAT'
|
||||
# In addition, during the major release cycle (in March/April, September/October),
|
||||
# this cron schedule is set to run 10:21 UTC every Workday and Sunday.
|
||||
- cron: '21 10 * MAR,APR,SEP,OCT MON-FRI,SUN'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
#=================================================================
|
||||
# locale env tests.
|
||||
env-test-locale:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# "fail-fast: false" let other jobs keep running even if the test break in some locales.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Since we have total 500+ locales to run on three set of test, we create
|
||||
# many jobs to test concurrently.
|
||||
# shard is used to bucket the lines from the locale list into jobs.
|
||||
# Currently we run testing of 30 locales per shard, and we have total 17 shards.
|
||||
# 17x30 = 510 > 502 (the number of locales in 'locale -a').
|
||||
tests_per_shard: [30]
|
||||
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
|
||||
steps:
|
||||
- name: Install all locales by apt-get
|
||||
run: |
|
||||
sudo apt-get update -y;
|
||||
sudo apt-get install -y locales-all;
|
||||
- name: Show installed locales post apt-get
|
||||
run: |
|
||||
locale -a;
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Build
|
||||
run: |
|
||||
cd icu4c/source/;
|
||||
./runConfigureICU Linux;
|
||||
make -j -l4.5 tests;
|
||||
- name: Test different locales as LC_ALL
|
||||
run: |
|
||||
echo "This job run the environment test of the following Locales";
|
||||
begin=$(( ${{matrix.shard}} * ${{matrix.tests_per_shard}} + 1));
|
||||
end=$(( (${{matrix.shard}}+1) * ${{matrix.tests_per_shard}} ));
|
||||
sedarg=${begin},${end}p;
|
||||
locale -a |sed -n ${sedarg};
|
||||
|
||||
cd icu4c/source/test;
|
||||
for loc in `locale -a |sed -n ${sedarg}`;
|
||||
do
|
||||
echo "============================================";
|
||||
echo "Start Tests under LC_ALL=$loc locale";
|
||||
for test_dir in iotest cintltst intltest
|
||||
do
|
||||
cd $test_dir;
|
||||
LC_ALL=$loc make -j -l4.5 check;
|
||||
cd ..;
|
||||
done
|
||||
|
||||
echo "Complete Tests under LC_ALL=$loc locale";
|
||||
echo "============================================";
|
||||
done
|
||||
|
||||
echo "This job completed the test of the following Locales";
|
||||
locale -a |sed -n ${sedarg};
|
||||
|
||||
#=================================================================
|
||||
# tz env tests.
|
||||
env-test-tz:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# "fail-fast: false" let other jobs keep running even if the test break in some timezones.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Since we have total 600+ timezones to run on three set of test, we create
|
||||
# many jobs to test concurrently.
|
||||
# shard is used to bucket the lines from the timezone list into jobs.
|
||||
# Currently we run testing of 30 timezones per shard, and we have total 21 shards.
|
||||
# 21x30 = 630 > 604 (the number of known timezones).
|
||||
tests_per_shard: [30]
|
||||
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
|
||||
steps:
|
||||
- name: Install all locales by apt-get
|
||||
run: |
|
||||
sudo apt-get update -y;
|
||||
sudo apt-get install -y tzdata;
|
||||
- name: Show all the TimeZones
|
||||
run: |
|
||||
echo "Total number of TimeZone is "
|
||||
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|wc -l;
|
||||
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|cut -d '/' -f5-50;
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Build
|
||||
run: |
|
||||
cd icu4c/source/;
|
||||
./runConfigureICU Linux;
|
||||
make -j -l4.5 tests;
|
||||
- name: Test different locales as TZ
|
||||
run: |
|
||||
echo "This job run the environment test of the following TimeZones";
|
||||
begin=$(( ${{matrix.shard}} * ${{matrix.tests_per_shard}} + 1));
|
||||
end=$(( (${{matrix.shard}}+1) * ${{matrix.tests_per_shard}} ));
|
||||
sedarg=${begin},${end}p;
|
||||
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|sed -n ${sedarg}|cut -d '/' -f5-50;
|
||||
|
||||
echo "The tzdb version on this machine is:";
|
||||
head -1 /usr/share/zoneinfo/tzdata.zi;
|
||||
cd icu4c/source/test;
|
||||
for tz in `find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|sed -n ${sedarg}|cut -d '/' -f5-50`;
|
||||
|
||||
do
|
||||
echo "============================================";
|
||||
echo "zdump of the system timezone $tz";
|
||||
zdump $tz;
|
||||
echo "Start Tests under TZ=$tz TimeZone";
|
||||
for test_dir in iotest cintltst intltest
|
||||
do
|
||||
cd $test_dir;
|
||||
TZ=$tz make -j -l4.5 check;
|
||||
cd ..;
|
||||
done
|
||||
|
||||
echo "Complete Tests under TZ=$tz TimeZone";
|
||||
echo "============================================";
|
||||
done
|
||||
|
||||
echo "This job completed the test of the following TimeZones";
|
||||
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|sed -n ${sedarg}|cut -d '/' -f5-50;
|
||||
|
||||
#=================================================================
|
||||
@@ -8,31 +8,812 @@ name: GHA ICU Merge CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- main
|
||||
- 'maint/maint*'
|
||||
workflow_dispatch:
|
||||
# To trigger the Env Test workflow manually, follow the instructions in
|
||||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
|
||||
|
||||
env:
|
||||
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
# Test ICU4J with little-endian ICU4C data only
|
||||
icu4j-little-endian-data-test:
|
||||
# Initialize the Maven artifact cache
|
||||
# Uses Java 8 because Java version not deemed significant for downloading
|
||||
# artifacts
|
||||
#
|
||||
# This job is created according to the cache strategy of reuse from a single job:
|
||||
# https://github.com/actions/cache/blob/main/caching-strategies.md#make-cache-read-only--reuse-cache-from-centralized-job
|
||||
icu4j-mvn-init-cache:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- uses: actions/setup-java@v1
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
# Download all of the artifacts needed for the code and build plugins
|
||||
- name: Download all artifacts
|
||||
run: |
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
|
||||
|
||||
# Test ICU4J with little-endian ICU4C data only
|
||||
icu4j-little-endian-data-test:
|
||||
needs: icu4j-mvn-init-cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Lookup read-only cache of local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '11'
|
||||
- name: ICU4J little-endian
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ./runConfigureICU Linux;
|
||||
make -j2 check;
|
||||
make -j -l4.5 check;
|
||||
mkdir /tmp/icu4j_data_test;
|
||||
cp -P data/out/tmp/icudt*l* /tmp/icu4j_data_test/
|
||||
cd ../../icu4j;
|
||||
ant clean;
|
||||
ant -Dicu4c.data.path=/tmp/icu4j_data_test check;
|
||||
mvn ${SHARED_MVN_ARGS} clean;
|
||||
mvn ${SHARED_MVN_ARGS} -Dicu4c.data.path=/tmp/icu4j_data_test install
|
||||
|
||||
# Compile libraries used by all ICU4C performance tests.
|
||||
icu4c-store-perf-libs:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Build ICU libraries
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
make -j -l4.5 all;
|
||||
cd lib;
|
||||
cp -Ps ../tools/ctestfw/libicutest* .
|
||||
- name: Upload ICU libraries
|
||||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
||||
with:
|
||||
name: icu-perf-libs
|
||||
path: icu4c/source/lib
|
||||
retention-days: 1
|
||||
|
||||
# Assorted ICU4C performance tests
|
||||
icu4c-performance-tests:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4c-store-perf-libs
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
perf: [charperf, usetperf, utfperf]
|
||||
include:
|
||||
- perf: charperf
|
||||
tests: TestIsAlpha TestIsUpper TestIsLower TestIsDigit TestIsSpace TestIsAlphaNumeric TestIsPrint TestIsControl TestToLower TestToUpper TestIsWhiteSpace
|
||||
- perf: usetperf
|
||||
tests: titlecase_letter_add titlecase_letter_contains titlecase_letter_iterator unassigned_add unassigned_contains unassigned_iterator pattern1 pattern2 pattern3
|
||||
- perf: utfperf
|
||||
tests: Roundtrip FromUnicode FromUTF8
|
||||
file: "-f ../../icu4j/perf-tests/data/conversion/xuzhimo.txt"
|
||||
flag: "-e gb18030"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Create directory for lib files
|
||||
run: mkdir icu4c/source/perflib
|
||||
- name: Get ICU libs
|
||||
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
|
||||
with:
|
||||
name: icu-perf-libs
|
||||
path: icu4c/source/lib
|
||||
|
||||
- name: Build and run ICU4C perf tests
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/${{ matrix.perf }})
|
||||
LD_LIBRARY_PATH=lib ./test/perf/${{ matrix.perf }}/${{ matrix.perf }} ${{ matrix.flag }} -t 5 -p 10 ${{ matrix.file }} ${{ matrix.tests }} | tee test/perf/results/${{ matrix.perf }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4c/source/test/perf/results/${{ matrix.perf }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/${{ matrix.perf }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# Assorted ICU4C performance tests using data files
|
||||
icu4c-performance-tests-with-files:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4c-store-perf-libs
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# Matrix of test drivers and test data and, if applicable, flags. Note
|
||||
# that GHA first excludes the 'exclude:' items from the total of
|
||||
# combinations and then adds the 'include:' items.
|
||||
matrix:
|
||||
perf: [collperf, ustrperf, normperf]
|
||||
data: [TestNames_Asian, TestNames_Chinese, TestNames_Japanese, TestNames_Japanese_h, TestNames_Japanese_k, TestNames_Korean, TestNames_Latin, TestNames_Russian, TestNames_SerbianSH, TestNames_SerbianSR, TestNames_Simplified_Chinese, TestNames_Thai, th18057, thesis, vfear11a]
|
||||
include:
|
||||
- perf: collperf
|
||||
tests: TestIcu_KeyGen_null TestIcu_qsort_strcoll_null TestIcu_qsort_usekey TestIcu_BinarySearch_strcoll_null TestIcu_BinarySearch_usekey
|
||||
- perf: ustrperf
|
||||
tests: TestCtor TestCtor1 TestCtor2 TestCtor3 TestAssign TestAssign1 TestAssign2 TestGetch TestCatenate TestScan TestScan1 TestScan2
|
||||
flag: "-l -u"
|
||||
- perf: normperf
|
||||
tests: TestICU_NFC_NFD_Text TestICU_NFC_NFC_Text TestICU_NFC_Orig_Text TestICU_NFD_NFD_Text TestICU_NFD_NFC_Text TestICU_NFD_Orig_Text
|
||||
exclude:
|
||||
- perf: collperf
|
||||
data: th18057
|
||||
- perf: collperf
|
||||
data: thesis
|
||||
- perf: collperf
|
||||
data: vfear11a
|
||||
- perf: ustrperf
|
||||
data: TestNames_Japanese
|
||||
- perf: ustrperf
|
||||
data: thesis
|
||||
- perf: ustrperf
|
||||
data: vfear11a
|
||||
- perf: normperf
|
||||
data: TestNames_Simplified_Chinese
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Create directory for lib files
|
||||
run: mkdir icu4c/source/perflib
|
||||
- name: Get ICU libs
|
||||
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
|
||||
with:
|
||||
name: icu-perf-libs
|
||||
path: icu4c/source/lib
|
||||
|
||||
- name: Build and run ICU4C perf tests
|
||||
env:
|
||||
DATA_FILE_PATH: ../../icu4j/perf-tests/data/collation
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/${{ matrix.perf }} && mkdir -p results/${{ matrix.perf }}/${{ matrix.data }})
|
||||
LD_LIBRARY_PATH=lib ./test/perf/${{ matrix.perf }}/${{ matrix.perf }} ${{ matrix.flag }} -t 5 -p 10 -f $DATA_FILE_PATH/${{ matrix.data }}.txt ${{ matrix.tests }} | tee test/perf/results/${{ matrix.perf }}/${{ matrix.data }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4c/source/test/perf/results/${{ matrix.perf }}/${{ matrix.data }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/${{ matrix.perf }}/${{ matrix.data }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# String search performance test
|
||||
icu4c-strsrchperf:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4c-store-perf-libs
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# Matrix of locales and corresponding test data.
|
||||
matrix:
|
||||
locale: [de, en, fr, ja, ru, th, zh]
|
||||
include:
|
||||
- locale: de
|
||||
data: udhr_deu_1996
|
||||
- locale: en
|
||||
data: udhr_eng
|
||||
- locale: fr
|
||||
data: udhr_fra
|
||||
- locale: ja
|
||||
data: udhr_jpn
|
||||
- locale: ru
|
||||
data: udhr_rus
|
||||
- locale: th
|
||||
data: udhr_tha
|
||||
- locale: zh
|
||||
data: udhr_cmn_hans
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Create directory for lib files
|
||||
run: mkdir icu4c/source/perflib
|
||||
- name: Get ICU libs
|
||||
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
|
||||
with:
|
||||
name: icu-perf-libs
|
||||
path: icu4c/source/lib
|
||||
|
||||
- name: Build and run strschrperf test
|
||||
env:
|
||||
DATA_FILE_PATH: ../../icu4j/perf-tests/data/udhr
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU Linux;
|
||||
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/strsrchperf && mkdir -p results/strsrchperf/${{ matrix.locale }})
|
||||
LD_LIBRARY_PATH=lib ./test/perf/strsrchperf/strsrchperf -b Test_ICU_Forward_Search Test_ICU_Backward_Search -t 5 -p 10 -L ${{ matrix.locale }} -f $DATA_FILE_PATH/${{ matrix.data }}.txt | tee test/perf/results/strsrchperf/${{ matrix.locale }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4c/source/test/perf/results/strsrchperf/${{ matrix.locale }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/strsrchperf/${{ matrix.locale }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# ICU4J performance test for Unicode sets
|
||||
icu4j-unicodesetperf:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4j-mvn-init-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
perf: [UnicodeSetAdd, UnicodeSetContains, UnicodeSetIterate]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Lookup read-only cache of local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
|
||||
- name: Build and run unicodesetperf test
|
||||
run: |
|
||||
# This file needs to be restored otherwise GHA cannot
|
||||
# check-out the perfdata branch. Setting up this task with GH lfs
|
||||
# modifies the file but the details of why and how are unknown.
|
||||
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
|
||||
git status
|
||||
cd perf-tests;
|
||||
mkdir -p perf/results/j_unicodesetperf/${{ matrix.perf }};
|
||||
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.UnicodeSetPerf ${{ matrix.perf }} -a -t 2 -p 4 [:Lt:] | tee perf/results/j_unicodesetperf/${{ matrix.perf }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4j/perf-tests/perf/results/j_unicodesetperf/${{ matrix.perf }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/j_unicodesetperf/${{ matrix.perf }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# ICU4J performance test for character APIs
|
||||
icu4j-ucharacterperf:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4j-mvn-init-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Lookup read-only cache of local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
|
||||
- name: Build and run ucharacterperf test
|
||||
run: |
|
||||
# This file needs to be restored otherwise GHA cannot
|
||||
# check-out the perfdata branch. Setting up this task with GH lfs
|
||||
# modifies the file but the details of why and how are unknown.
|
||||
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
|
||||
cd perf-tests;
|
||||
mkdir -p perf/results/j_ucharacterperf;
|
||||
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.UCharacterPerf -a -t 2 -p 4 0 ffff | tee perf/results/j_ucharacterperf/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4j/perf-tests/perf/results/j_ucharacterperf/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/j_ucharacterperf
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# ICU4J performance test for decimal formatting
|
||||
icu4j-decimalformatperf:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4j-mvn-init-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
perf: [TestICUConstruction, TestICUParse, TestICUFormat]
|
||||
locale: [en_US, de_DE]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Lookup read-only cache of local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
|
||||
- name: Build and run decimalformatperf
|
||||
run: |
|
||||
# This file needs to be restored otherwise GHA cannot
|
||||
# check-out the perfdata branch. Setting up this task with GH lfs
|
||||
# modifies the file but the details of why and how are unknown.
|
||||
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
|
||||
cd perf-tests;
|
||||
mkdir -p perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }};
|
||||
# Delay execution by random number of seconds. Spreading execution of multiple
|
||||
# tests over 180 secs. minimizes the possibility of push conflicts when storing
|
||||
# tests results in the data branch.
|
||||
sleep $(($RANDOM % 180));
|
||||
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.DecimalFormatPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -L ${{ matrix.locale }} "#,###.##" "1.234,56" -r 1 | tee perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4j/perf-tests/perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# ICU4J performance test for normalization
|
||||
icu4j-normperf:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4j-mvn-init-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
perf: [TestICU_NFD_NFC_Text, TestICU_NFC_NFC_Text, TestICU_NFC_Orig_Text, TestICU_NFD_NFC_Text, TestICU_NFD_NFD_Text, TestICU_NFD_Orig_Text]
|
||||
source_text: [TestNames_Asian, TestNames_Chinese, TestNames_SerbianSH]
|
||||
mode: [-l]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Lookup read-only cache of local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
|
||||
- name: Build and run normperf
|
||||
env:
|
||||
DATA_FILE_PATH: data/collation
|
||||
run: |
|
||||
# This file needs to be restored otherwise GHA cannot
|
||||
# check-out the perfdata branch. Setting up this task with GH lfs
|
||||
# modifies the file but the details of why and how are unknown.
|
||||
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
|
||||
cd perf-tests;
|
||||
mkdir -p perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }};
|
||||
# Delay execution by random number of seconds. Spreading execution of multiple
|
||||
# tests over 180 secs. minimizes the possibility of push conflicts when storing
|
||||
# tests results in the data branch.
|
||||
sleep $(($RANDOM % 180));
|
||||
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.NormalizerPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -f $DATA_FILE_PATH/${{ matrix.source_text }}.txt -e UTF-8 ${{ matrix.mode }} | tee perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
|
||||
cat perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4j/perf-tests/perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# ICU4J performance test for encoding conversion
|
||||
icu4j-converterperf:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4j-mvn-init-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
source_text: [arabic, english, french, greek, hebrew, hindi, japanese, korean, s-chinese]
|
||||
perf: [TestCharsetDecoderICU, TestCharsetEncoderICU]
|
||||
test_enc: [UTF-8]
|
||||
include:
|
||||
- test_enc: csisolatinarabic
|
||||
source_text: arabic
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: csisolatinarabic
|
||||
source_text: arabic
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: csisolatin1
|
||||
source_text: french
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: csisolatin1
|
||||
source_text: french
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: csisolatingreek
|
||||
source_text: greek
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: csisolatingreek
|
||||
source_text: greek
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: csisolatinhebrew
|
||||
source_text: hebrew
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: csisolatinhebrew
|
||||
source_text: hebrew
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: EUC-JP
|
||||
source_text: japanese
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: EUC-JP
|
||||
source_text: japanese
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: csiso2022jp
|
||||
source_text: japanese
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: csiso2022jp
|
||||
source_text: japanese
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: csiso2022kr
|
||||
source_text: korean
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: csiso2022kr
|
||||
source_text: korean
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: EUC-CN
|
||||
source_text: s-chinese
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: EUC-CN
|
||||
source_text: s-chinese
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: UTF-16BE
|
||||
source_text: french
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: UTF-16BE
|
||||
source_text: french
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: UTF-16LE
|
||||
source_text: french
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: UTF-16LE
|
||||
source_text: french
|
||||
perf: TestCharsetEncoderICU
|
||||
- test_enc: US-ASCII
|
||||
source_text: english
|
||||
perf: TestCharsetDecoderICU
|
||||
- test_enc: US-ASCII
|
||||
source_text: english
|
||||
perf: TestCharsetEncoderICU
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Lookup read-only cache of local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
|
||||
- name: Build and run converterperf
|
||||
env:
|
||||
DATA_FILE_PATH: data/conversion
|
||||
run: |
|
||||
# This file needs to be restored otherwise GHA cannot
|
||||
# check-out the perfdata branch. Setting up this task with GH lfs
|
||||
# modifies the file but the details of why and how are unknown.
|
||||
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
|
||||
cd perf-tests;
|
||||
mkdir -p perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }};
|
||||
# Delay execution by random number of seconds. Spreading execution of multiple
|
||||
# tests over 180 secs. minimizes the possibility of push conflicts when storing
|
||||
# tests results in the data branch.
|
||||
sleep $(($RANDOM % 180));
|
||||
java -cp ./target/*:../tools/misc/target/*:../main/core/target/*:../main/charset/target/* com.ibm.icu.dev.test.perf.ConverterPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -f $DATA_FILE_PATH/${{ matrix.source_text }}.txt -e UTF-8 -T ${{ matrix.test_enc }} | tee perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4j/perf-tests/perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# ICU4J performance test for date formatting
|
||||
icu4j-dateformatperf:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
needs: icu4j-mvn-init-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
perf: [TestICUConstruction, TestICUParse, TestICUFormat]
|
||||
locale: [en_US]
|
||||
# The parameters don't make for good directory names. Add an identifying digit
|
||||
# at the end to be used as directory name for the results.
|
||||
parms: ['"dddd MMM yyyy" "15 Jan 2007" 1', '"HH:mm" "13:13" 2', '"HH:mm zzzz" "13:13 Pacific Standard Time" 3', '"HH:mm z" "13:13 PST" 4', '"HH:mm Z" "13:13 -0800" 5']
|
||||
include:
|
||||
- locale: sw_KE
|
||||
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
|
||||
perf: TestICUConstruction
|
||||
- locale: sw_KE
|
||||
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
|
||||
perf: TestICUParse
|
||||
- locale: sw_KE
|
||||
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
|
||||
perf: TestICUFormat
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and setup
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout lfs objects
|
||||
run: git lfs pull
|
||||
- name: Lookup read-only cache of local Maven repository
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
lookup-only: true
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
|
||||
- name: Extract identifying digit and parameter.
|
||||
run: |
|
||||
ddir='${{ matrix.parms }}';
|
||||
echo "PARM=${ddir:: -2}" >> $GITHUB_ENV;
|
||||
echo "DDIR=${ddir: -1}" >> $GITHUB_ENV
|
||||
- name: Build and run dateformatperf
|
||||
run: |
|
||||
# This file needs to be restored otherwise GHA cannot
|
||||
# check-out the perfdata branch. Setting up this task with GH lfs
|
||||
# modifies the file but the details of why and how are unknown.
|
||||
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2
|
||||
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2
|
||||
cd icu4j;
|
||||
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
|
||||
cd perf-tests;
|
||||
mkdir -p perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }};
|
||||
# Delay execution by random number of seconds. Spreading execution of multiple
|
||||
# tests over 180 secs. minimizes the possibility of push conflicts when storing
|
||||
# tests results in the data branch.
|
||||
sleep $(($RANDOM % 180));
|
||||
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.DateFormatPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -L ${{ matrix.locale }} ${{ env.PARM }} -r 1 | tee perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}/output.txt
|
||||
|
||||
- name: Store performance test results
|
||||
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
|
||||
with:
|
||||
# The perf tests result data is in ndjson format.
|
||||
tool: 'ndjson'
|
||||
output-file-path: icu4j/perf-tests/perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}/output.txt
|
||||
# Tentative setting.
|
||||
alert-threshold: '200%'
|
||||
fail-on-alert: true
|
||||
gh-pages-branch: perfdata
|
||||
benchmark-data-dir-path: perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}
|
||||
auto-push: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
# Retrieve performance test results and upload results to remote repository
|
||||
perf-test-data-move:
|
||||
# Run performance tests only on the main branch of the ICU repository.
|
||||
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
|
||||
name: Copy perf data to remote repo for visualization
|
||||
needs: [icu4c-performance-tests, icu4c-performance-tests-with-files, icu4c-strsrchperf, icu4j-unicodesetperf, icu4j-ucharacterperf, icu4j-decimalformatperf, icu4j-normperf, icu4j-converterperf, icu4j-dateformatperf]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Switch to benchmark data storage branch.
|
||||
run: |
|
||||
git fetch
|
||||
git checkout perfdata
|
||||
|
||||
- name: Publish data
|
||||
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
|
||||
with:
|
||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
external_repository: unicode-org/icu-perf
|
||||
publish_branch: main
|
||||
publish_dir: ./perf
|
||||
keep_files: true
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
# Copyright (C) 2023 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# GitHub Action configuration script for ICU continuous integration tasks
|
||||
# for Valgrind
|
||||
|
||||
name: GHA CI Valgrind
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'maint/maint*'
|
||||
paths:
|
||||
- 'icu4c/**'
|
||||
- '.github/workflows/**'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
paths:
|
||||
- 'icu4c/**'
|
||||
- '.github/workflows/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
clang-valgrind-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install valgrind
|
||||
run: |
|
||||
set -ex;
|
||||
sudo apt-get -y update;
|
||||
sudo apt-get install -y valgrind;
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Build with debug enable
|
||||
env:
|
||||
CC: clang
|
||||
CFLAGS: -gdwarf-4
|
||||
CXX: clang++
|
||||
CXXFLAGS: -gdwarf-4
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU --enable-debug Linux --disable-renaming && make -j -l4.5 tests;
|
||||
- name: Test iotest with valgrind
|
||||
run: |
|
||||
cd icu4c/source/test/iotest
|
||||
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
|
||||
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
|
||||
--show-reachable=yes ./iotest
|
||||
- name: Test cintltst with valgrind
|
||||
run: |
|
||||
cd icu4c/source/test/cintltst
|
||||
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
|
||||
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
|
||||
--show-reachable=yes ./cintltst
|
||||
- name: Test icuinfo with valgrind
|
||||
run: |
|
||||
cd icu4c/source/tools/icuinfo
|
||||
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
|
||||
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
|
||||
--show-reachable=yes ./icuinfo;
|
||||
|
||||
clang-valgrind-intltest:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other test.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
case: [utility, normalize, collator, regex, format, translit,
|
||||
rbbi, rbnf, rbnfrt, icuserv, idna, convert, rbnfp, csdet,
|
||||
spoof, bidi]
|
||||
steps:
|
||||
- name: Install valgrind
|
||||
run: |
|
||||
set -ex;
|
||||
sudo apt-get -y update;
|
||||
sudo apt-get install -y valgrind;
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Build with debug enable
|
||||
env:
|
||||
CC: clang
|
||||
CFLAGS: -gdwarf-4
|
||||
CXX: clang++
|
||||
CXXFLAGS: -gdwarf-4
|
||||
run: |
|
||||
cd icu4c/source;
|
||||
./runConfigureICU --enable-debug Linux --disable-renaming && make -j -l4.5 tests;
|
||||
- name: Check all top path in intltest is covered
|
||||
run: |
|
||||
cd icu4c/source/test/intltest;
|
||||
if [ $(LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
|
||||
./intltest LIST |
|
||||
egrep "^ [a-z]+$" | awk '{print $1;}' | sort | tr '\n' '|') != \
|
||||
"bidi|collate|convert|csdet|format|icuserv|idna|normalize|rbbi|rbnf|rbnfp|rbnfrt|regex|spoof|translit|utility|" ]
|
||||
then
|
||||
echo ICU has made changes to the top level tests in intltest!
|
||||
echo Please update this workflow file to include those top level tests in
|
||||
echo the "case" list.
|
||||
exit -1
|
||||
fi
|
||||
|
||||
- name: Test with valgrind
|
||||
run: |
|
||||
cd icu4c/source/test/intltest
|
||||
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
|
||||
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
|
||||
--show-reachable=yes ./intltest ${{ matrix.case }};
|
||||
@@ -0,0 +1,79 @@
|
||||
# Copyright (C) 2023 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
#
|
||||
# Note: the workflow here is based on the Github Actions workflow used
|
||||
# by the Jekyll theme we are using:
|
||||
# https://github.com/just-the-docs/just-the-docs/blob/main/.github/workflows/deploy.yml
|
||||
#
|
||||
# The Jekyll theme (just-the-docs) configured its Github CI to manually run the Jekyll
|
||||
# build instead of relying on the default behavior from
|
||||
# https://github.com/actions/jekyll-build-pages . The default behavior of
|
||||
# actions/jekyll-build-pages seems to be causing errors with this theme.
|
||||
|
||||
name: Deploy User Guide
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch and only if in the `docs/` directory
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths: ["docs/**"]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# Build job
|
||||
# Keep in sync with docs test workflow in `icu_docs.yml`
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
|
||||
with:
|
||||
ruby-version: '2.7.4' # Not needed with a .ruby-version file
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
cache-version: 0 # Increment this number if you need to re-download cached gems
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 # v3.0.6
|
||||
with:
|
||||
generator_config_file: docs/_config.yml
|
||||
- name: Build with Jekyll
|
||||
# Outputs to the './_site' directory by default
|
||||
run: |
|
||||
cd docs # root directory of markdown, also contains Jekyll configs, etc.
|
||||
bundle install
|
||||
# The baseurl arg is parsed from the `baseurl` field of _config.yml.
|
||||
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
|
||||
env:
|
||||
JEKYLL_ENV: production
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
|
||||
with:
|
||||
path: docs/_site
|
||||
|
||||
# Deployment job
|
||||
deploy:
|
||||
permissions:
|
||||
pages: write # to deploy to Pages
|
||||
id-token: write # to verify the deployment originates from an appropriate source
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|
||||
@@ -2,39 +2,42 @@ name: Publish icu4j.jar/utilities.jar to GH Maven
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
workflow_dispatch:
|
||||
# To trigger the Env Test workflow manually, follow the instructions in
|
||||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
|
||||
|
||||
env:
|
||||
SHARED_MVN_ARGS: '--show-version'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
lfs: true
|
||||
- uses: actions/setup-java@v1
|
||||
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: icu4j ant releaseCLDR
|
||||
run: ant -noinput releaseCLDR -f icu4j/build.xml
|
||||
distribution: 'temurin'
|
||||
java-version: '11'
|
||||
- name: icu4j and releaseCLDR
|
||||
run: |
|
||||
cd icu4j
|
||||
mvn ${SHARED_MVN_ARGS} clean install -DskipTests -DskipIT -P with_sources
|
||||
- name: deploy it
|
||||
run: |
|
||||
MYVERSION=$(sed -n -e 's%^\s*maven.pom.ver[ =]*%%p' < icu4j/build.properties)-$(echo ${GITHUB_REF} | cut -d/ -f3- | tr ./ _-)
|
||||
echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA}, version ${MYVERSION}
|
||||
mvn deploy:deploy-file -DgroupId=com.ibm.icu \
|
||||
-DartifactId=icu4j-for-cldr \
|
||||
-Dversion=${MYVERSION} \
|
||||
-Dpackaging=jar \
|
||||
-Dfile=icu4j/release_cldr/icu4j.jar \
|
||||
-Dsources=icu4j/release_cldr/icu4j-src.jar \
|
||||
-DrepositoryId=github \
|
||||
-Durl=https://maven.pkg.github.com/${GITHUB_REPOSITORY}
|
||||
mvn deploy:deploy-file -DgroupId=com.ibm.icu \
|
||||
-DartifactId=utilities-for-cldr \
|
||||
-Dversion=${MYVERSION} \
|
||||
-Dpackaging=jar \
|
||||
-Dfile=icu4j/release_cldr/utilities.jar \
|
||||
-Dsources=icu4j/release_cldr/utilities-src.jar \
|
||||
-DrepositoryId=github \
|
||||
-Durl=https://maven.pkg.github.com/${GITHUB_REPOSITORY}
|
||||
echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA};
|
||||
cd icu4j
|
||||
mvn deploy ${SHARED_MVN_ARGS} \
|
||||
-pl :icu4j,:utilities-for-cldr,:icu4j-root \
|
||||
-DaltDeploymentRepository=github::https://maven.pkg.github.com/${GITHUB_REPOSITORY} \
|
||||
-P cldr_utilities,with_sources
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Note: can use 0.0.0-${GITHUB_SHA} as the version for hash-based.
|
||||
# i.e. build on every commit
|
||||
# i.e. build on every commit
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
# This workflow uses actions that are not certified by GitHub. They are provided
|
||||
# by a third-party and are governed by separate terms of service, privacy
|
||||
# policy, and support documentation.
|
||||
|
||||
name: Scorecard supply-chain security
|
||||
on:
|
||||
# For Branch-Protection check. Only the default branch is supported. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
||||
branch_protection_rule:
|
||||
# To guarantee Maintained check is occasionally updated. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
||||
schedule:
|
||||
- cron: "23 15 * * 6"
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Needed to publish results and get a badge (see publish_results below).
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
# (Optional) fine-grained personal access token. Uncomment the `repo_token` line below if
|
||||
# you want to enable the Branch-Protection check on a *public* repository
|
||||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-fine-grained-pat-optional.
|
||||
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
||||
|
||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||
# - Allows the repository to include the Scorecard badge.
|
||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
+14
@@ -9,6 +9,7 @@
|
||||
*.dll
|
||||
*.dylib
|
||||
*.exp
|
||||
*.iml
|
||||
*.lib
|
||||
*.lnk
|
||||
*.ncb
|
||||
@@ -63,6 +64,7 @@ lib/
|
||||
!tools/cldr/lib
|
||||
out/
|
||||
release/
|
||||
target/
|
||||
!docs/processes/release/
|
||||
tmp/
|
||||
x64/
|
||||
@@ -278,3 +280,15 @@ tools/unicode/c/genprops/genprops.[0-9]
|
||||
tools/unicode/c/genuca/genuca
|
||||
tools/unicode/c/genuca/genuca.8
|
||||
tools/unicode/c/icudefs.txt
|
||||
|
||||
# QNX files
|
||||
icu4c/build_qnx/linux-x86_64-o/*
|
||||
icu4c/build_qnx/nto-aarch64-le/*
|
||||
icu4c/build_qnx/nto-x86_64-o/*
|
||||
!icu4c/build_qnx/linux-x86_64-o/GNUmakefile
|
||||
!icu4c/build_qnx/nto-aarch64-le/GNUmakefile
|
||||
!icu4c/build_qnx/nto-x86_64-o/GNUmakefile
|
||||
!icu4c/build_qnx/**/Makefile
|
||||
icu4c/build_qnx/linux-x86_64-o/Makefile
|
||||
icu4c/build_qnx/nto-aarch64-le/Makefile
|
||||
icu4c/build_qnx/nto-x86_64-o/Makefile
|
||||
|
||||
+126
-7
@@ -2,13 +2,132 @@
|
||||
|
||||
Thank you for wanting to contribute to ICU!
|
||||
|
||||
Please see our instructions at <https://icu.unicode.org/processes/contribute>
|
||||
Starting with ICU 58, ICU is a project of the Unicode® Consortium and the ICU Project Management Committee is a Unicode Technical Committee, the ICU-TC. For more details, see [the Unicode announcement][unicode-announcement]. Since 2018-July, ICU is hosted on [GitHub][unicode-org/icu].
|
||||
|
||||
### License
|
||||
## Why contribute?
|
||||
|
||||
Please see [./icu4c/LICENSE](./icu4c/LICENSE) (C and J are under an identical license file.)
|
||||
ICU is an open source library that is a de-facto industry standard for internationalization libraries. Our goal is to provide top of the line i18n support on all widely used platforms. By contributing your code to the ICU library, you will get the benefit of continuing improvement by the ICU team and the community, as well as testing and multi-platform portability. In addition, it saves you from having to re-merge your own additions into ICU each time you upgrade to a new ICU release.
|
||||
|
||||
> Copyright © 2021 and later Unicode, Inc. and others. All Rights Reserved.
|
||||
Unicode and the Unicode Logo are registered trademarks
|
||||
of Unicode, Inc. in the U.S. and other countries.
|
||||
[Terms of Use and License](http://www.unicode.org/copyright.html)
|
||||
## Contributor License Agreement
|
||||
|
||||
In order to contribute to this project, the Unicode Consortium must have on file a Contributor License Agreement (CLA) covering your contributions, either an individual or a corporate CLA. Pull Requests, issues, and other contributions will not be merged/accepted until the correct CLA is signed. Which version needs to be signed depends on who owns the contribution being made: you as the individual making the contribution or your employer. **It is your responsibility to determine whether your contribution is owned by your employer.** Please review the [Unicode Intellectual Property, Licensing, & Technical Contribution Policy][policies] for further guidance on which CLA to sign, as well as other information and guidelines regarding the Consortium’s licensing and technical contribution policies and procedures.
|
||||
|
||||
To sign the CLA in Github, open a Pull Request (a comment will be automatically added with a link to the CLA Form), or go directly to [the CLA Form][sign-cla]. You may need to sign in to Github to see the entire CLA Form.
|
||||
|
||||
- **Individual CLA**: If you have determined that the Individual CLA is appropriate, then when you access the CLA Form, click the Individual CLA and complete the Form.
|
||||
|
||||
- **Corporate CLA**: If you have determined that a Corporate CLA is appropriate, please first check the [public list of Corporate CLAs][unicode-corporate-clas] that the Consortium has on file. If your employer is listed, then when you access the CLA Form, you can click the box indicating that you are covered by your employer’s corporate CLA. If your employer is not on the list, then it has not already signed a CLA and you will need to arrange for your employer to do so before you contribute, as described in [How to Sign a Unicode CLA][signing].
|
||||
|
||||
Unless otherwise noted in the [`LICENSE`](./LICENSE) file, this project is released under the [OSI-approved][osi-Unicode-License-3.0] free and open-source [Unicode License v3][unicode-license].
|
||||
|
||||
## Process
|
||||
|
||||
See also [git for ICU Developers][git4icu].
|
||||
|
||||
If you want to join the team, then please [contact us][contacts]. Once everything is agreed, the ICU team adds you to the [GitHub project][unicode-org/icu] and the [Jira issue tracker][bugs].
|
||||
|
||||
## General Contribution Requirements
|
||||
|
||||
We will be glad to take a look at the code you wish to contribute to ICU. We cannot guarantee that the code will be included. Contributions of general interest and written according to the following guidelines have a better chance of becoming a part of ICU.
|
||||
|
||||
For any significant new functionality, contact the ICU development team through the [icu-design][contacts] mailing list first, and discuss the features, design and scope of the possible contribution. This helps ensure that the contribution is expected and will be welcome, that it will fit in well with the rest of ICU, and that it does not overlap with other development work that may be underway.
|
||||
|
||||
While you are considering contributing code to ICU, make sure that the legal terms (see [Licenses](#licenses) above) are acceptable to you and your organization.
|
||||
|
||||
Here are several things to keep in mind when developing a potential contribution to the ICU project:
|
||||
|
||||
1. ICU has both C/C++ and Java versions. If you develop in one programming language, please either provide a port or make sure that the logic is clear enough so that the code can be reasonably ported. We cannot guarantee that we will port a contribution to the other library.
|
||||
|
||||
2. Before implementation, read and understand ICU's [coding guidelines][coding-guidelines]. Contributions that require too much adaptation to be included in the ICU tree will probably wait for a long time.
|
||||
|
||||
3. During implementation, try to mimic the style already present in the ICU source code.
|
||||
|
||||
4. Always develop the code as an integral part of the library, rather than an add-on.
|
||||
|
||||
5. Always provide enough test code and test cases. We require that our APIs are 100% tested and that tests cover at least 85% of the ICU library code. Make sure that your tests are integrated into one of ICU's test suites ([cintltst][cintltst] and [intltest][intltest] for ICU4C and [com.ibm.icu.dev.test][com.ibm.icu.dev.test] classes in ICU4J). New tests and the complete test suite should pass.
|
||||
|
||||
6. Compile using the strictest compiler options. Due to ICU's multi-platform nature, warnings on some platforms may mean disastrous errors on other platforms. This can be enabled for C++ by using the `--enable-strict` configure option on any platform using the gcc or clang compilers.
|
||||
|
||||
7. Test on more than one platform. For ICU4C, it is good to combine testing on Windows with testing on Linux, Mac OS X or another Unix platform. It is always good to try to mix big and little endian platforms. For ICU4J, test using both Oracle's and IBM's JDKs and/or on Android.
|
||||
|
||||
8. Each contribution should contain everything that will allow building, testing and running ICU with the contribution. This usually includes: source code, build files and test files.
|
||||
|
||||
|
||||
## Team
|
||||
|
||||
We have several [mailing lists][contacts]. Contributors should at least subscribe to the **icu-design** mailing list, and we also have a team-internal list that you should get added to.
|
||||
|
||||
We meet once a week by phone. See the [agenda & meeting minutes][meetings].
|
||||
|
||||
## Understand ICU
|
||||
|
||||
|
||||
* Home page: <https://icu.unicode.org>
|
||||
|
||||
* User Guide: <https://unicode-org.github.io/icu/userguide/>
|
||||
|
||||
* [Coding guidelines][coding-guidelines]
|
||||
|
||||
* [Introduction][introduction]
|
||||
|
||||
* [Design][design]
|
||||
|
||||
* [How to use ICU][howtouse]
|
||||
|
||||
* etc.
|
||||
|
||||
* API References: [C][icu4c-api] & [J][icu4j-api]
|
||||
|
||||
## Setup & Workflow
|
||||
|
||||
- [Source Code Access][repository]
|
||||
- [git for ICU Developers][git4icu]
|
||||
- [Tips for developers][tips]
|
||||
- [Eclipse and other setup][setup]
|
||||
- [Submitting ICU Bugs and Feature Requests][bugs]
|
||||
- [ICU Ticket Life cycle][ticket-lifecycle]
|
||||
|
||||
Significant/disruptive changes should be discussed on the icu-design list or on the team-internal list.
|
||||
|
||||
**API changes must be proposed** on the **icu-design** list, see the [API Proposal Email Template][proposal-template].
|
||||
|
||||
Proposed changes will be discussed at the ICU meeting that follows at least six days later. Proposals are frequently modified during email and in-meeting discussion. Please do not "jump the gun" unless you are very confident your proposal will go through as-is, or be prepared to revert your changes.
|
||||
|
||||
## Welcome
|
||||
|
||||
_… and thanks for contributing!_
|
||||
|
||||
### Copyright & Licenses
|
||||
|
||||
Copyright © 2016-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.
|
||||
|
||||
The project is released under [LICENSE](./LICENSE).
|
||||
|
||||
|
||||
[bugs]: https://icu.unicode.org/bugs
|
||||
[cintltst]: ./icu4c/source/test/cintltst/
|
||||
[coding-guidelines]: docs/userguide/dev/codingguidelines.md
|
||||
[com.ibm.icu.dev.test]: ./icu4j/main/framework/src/test/java/com/ibm/icu/dev/test/
|
||||
[contacts]: https://icu.unicode.org/contacts
|
||||
[copyright]: http://www.unicode.org/copyright.html
|
||||
[design]: docs/userguide/icu/design.md
|
||||
[git4icu]: https://icu.unicode.org/repository/gitdev
|
||||
[howtouse]: docs/userguide/icu/howtouseicu.md
|
||||
[icu4c-api]: https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/
|
||||
[icu4j-api]: https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/
|
||||
[intltest]: ./icu4c/source/test/intltest/
|
||||
[introduction]: docs/userguide/index.md
|
||||
[meetings]: https://icu.unicode.org/projectinfo/meetings
|
||||
[osi-Unicode-License-3.0]: https://opensource.org/license/unicode-license-v3/
|
||||
[policies]: https://www.unicode.org/policies/licensing_policy.html
|
||||
[proposal-template]: https://icu.unicode.org/processes/proposal-template
|
||||
[repository]: https://icu.unicode.org/repository
|
||||
[setup]: https://icu.unicode.org/setup
|
||||
[sign-cla]: https://cla-assistant.io/unicode-org/.github
|
||||
[signing]: https://www.unicode.org/policies/licensing_policy.html#signing
|
||||
[ticket-lifecycle]: https://icu.unicode.org/processes/ticket-lifecycle
|
||||
[tips]: https://icu.unicode.org/repository/tips
|
||||
[unicode-announcement]: http://blog.unicode.org/2016/05/icu-joins-unicode-consortium.html
|
||||
[unicode-corporate-clas]: https://www.unicode.org/policies/corporate-cla-list/
|
||||
[unicode-license]: https://www.unicode.org/license.txt
|
||||
[unicode-org/icu]: https://github.com/unicode.org/icu
|
||||
|
||||
@@ -1,38 +1,46 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
|
||||
UNICODE LICENSE V3
|
||||
|
||||
Copyright © 1991-2020 Unicode, Inc. All rights reserved.
|
||||
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Unicode data files and any associated documentation
|
||||
(the "Data Files") or Unicode software and any associated documentation
|
||||
(the "Software") to deal in the Data Files or Software
|
||||
without restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, and/or sell copies of
|
||||
the Data Files or Software, and to permit persons to whom the Data Files
|
||||
or Software are furnished to do so, provided that either
|
||||
(a) this copyright and permission notice appear with all copies
|
||||
of the Data Files or Software, or
|
||||
(b) this copyright and permission notice appear in associated
|
||||
Documentation.
|
||||
Copyright © 2016-2024 Unicode, Inc.
|
||||
|
||||
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
|
||||
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
|
||||
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
|
||||
NOTICE TO USER: Carefully read the following legal agreement. BY
|
||||
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
||||
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
|
||||
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
|
||||
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder
|
||||
shall not be used in advertising or otherwise to promote the sale,
|
||||
use or other dealings in these Data Files or Software without prior
|
||||
written authorization of the copyright holder.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of data files and any associated documentation (the "Data Files") or
|
||||
software and any associated documentation (the "Software") to deal in the
|
||||
Data Files or Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, and/or sell
|
||||
copies of the Data Files or Software, and to permit persons to whom the
|
||||
Data Files or Software are furnished to do so, provided that either (a)
|
||||
this copyright and permission notice appear with all copies of the Data
|
||||
Files or Software, or (b) this copyright and permission notice appear in
|
||||
associated Documentation.
|
||||
|
||||
---------------------
|
||||
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
THIRD PARTY RIGHTS.
|
||||
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
|
||||
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
|
||||
FILES OR SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder shall
|
||||
not be used in advertising or otherwise to promote the sale, use or other
|
||||
dealings in these Data Files or Software without prior written
|
||||
authorization of the copyright holder.
|
||||
|
||||
SPDX-License-Identifier: Unicode-3.0
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Third-Party Software Licenses
|
||||
|
||||
@@ -40,7 +48,9 @@ This section contains third-party software notices and/or additional
|
||||
terms for licensed third-party software components included within ICU
|
||||
libraries.
|
||||
|
||||
1. ICU License - ICU 1.8.1 to ICU 57.1
|
||||
----------------------------------------------------------------------
|
||||
|
||||
ICU License - ICU 1.8.1 to ICU 57.1
|
||||
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
@@ -75,7 +85,9 @@ of the copyright holder.
|
||||
All trademarks and registered trademarks mentioned herein are the
|
||||
property of their respective owners.
|
||||
|
||||
2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
|
||||
|
||||
# The Google Chrome software developed by Google is licensed under
|
||||
# the BSD license. Other software included in this distribution is
|
||||
@@ -279,7 +291,9 @@ property of their respective owners.
|
||||
#
|
||||
# ---------------COPYING.ipadic-----END----------------------------------
|
||||
|
||||
3. Lao Word Break Dictionary Data (laodict.txt)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Lao Word Break Dictionary Data (laodict.txt)
|
||||
|
||||
# Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
@@ -319,7 +333,9 @@ property of their respective owners.
|
||||
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
4. Burmese Word Break Dictionary Data (burmesedict.txt)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Burmese Word Break Dictionary Data (burmesedict.txt)
|
||||
|
||||
# Copyright (c) 2014 International Business Machines Corporation
|
||||
# and others. All Rights Reserved.
|
||||
@@ -359,7 +375,9 @@ property of their respective owners.
|
||||
# SUCH DAMAGE.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
5. Time Zone Database
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Time Zone Database
|
||||
|
||||
ICU uses the public domain data and code derived from Time Zone
|
||||
Database for its time zone support. The ownership of the TZ database
|
||||
@@ -382,7 +400,9 @@ Database section 7.
|
||||
# making a contribution to the database or code waives all rights to
|
||||
# future claims in that contribution or in the TZ Database.
|
||||
|
||||
6. Google double-conversion
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Google double-conversion
|
||||
|
||||
Copyright 2006-2011, the V8 project authors. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -410,3 +430,85 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
File: aclocal.m4 (only for ICU4C)
|
||||
Section: pkg.m4 - Macros to locate and utilise pkg-config.
|
||||
|
||||
|
||||
Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
|
||||
As a special exception to the GNU General Public License, if you
|
||||
distribute this file as part of a program that contains a
|
||||
configuration script generated by Autoconf, you may include it under
|
||||
the same distribution terms that you use for the rest of that
|
||||
program.
|
||||
|
||||
|
||||
(The condition for the exception is fulfilled because
|
||||
ICU4C includes a configuration script generated by Autoconf,
|
||||
namely the `configure` script.)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
File: config.guess (only for ICU4C)
|
||||
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception to the GNU General Public License, if you
|
||||
distribute this file as part of a program that contains a
|
||||
configuration script generated by Autoconf, you may include it under
|
||||
the same distribution terms that you use for the rest of that
|
||||
program. This Exception is an additional permission under section 7
|
||||
of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
(The condition for the exception is fulfilled because
|
||||
ICU4C includes a configuration script generated by Autoconf,
|
||||
namely the `configure` script.)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
File: install-sh (only for ICU4C)
|
||||
|
||||
|
||||
Copyright 1991 by the Massachusetts Institute of Technology
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation, and that the name of M.I.T. not be used in advertising or
|
||||
publicity pertaining to distribution of the software without specific,
|
||||
written prior permission. M.I.T. makes no representations about the
|
||||
suitability of this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.
|
||||
@@ -17,11 +17,15 @@ Around March 24-25, 2021 we renamed the `master` branch to `main`. You may need
|
||||
|
||||
Build | Status
|
||||
------|-------
|
||||
GitHub Actions | [](https://github.com/unicode-org/icu/actions?query=workflow%3A%22GHA+CI%22)
|
||||
Azure Pipelines | [](https://dev.azure.com/ms/icu/_build/latest?definitionId=360&branchName=main)
|
||||
GitHub Actions (ICU4C) | [](https://github.com/unicode-org/icu/actions?query=workflow%3A%22GHA+ICU4C%22+branch%3Amain)
|
||||
GitHub Actions (ICU4J) | [](https://github.com/unicode-org/icu/actions?query=workflow%3A%22GHA+ICU4J%22+branch%3Amain)
|
||||
Azure Pipelines (ICU4C) | [](https://dev.azure.com/ms/icu/_build/latest?definitionId=360&branchName=main)
|
||||
Azure Pipelines (ICU4J) | [](https://dev.azure.com/ms/icu/_build/latest?definitionId=631&branchName=main)
|
||||
Azure Pipelines (Exhaustive Tests) | [](https://dev.azure.com/ms/icu/_build/latest?definitionId=361&branchName=main)
|
||||
Azure Pipelines (Valgrind ICU4C) | [](https://dev.azure.com/ms/icu/_build/latest?definitionId=364&branchName=main)
|
||||
Github Actions (Valgrind) | [![GHA CI Valgrind]](https://github.com/unicode-org/icu/workflows/GHA%20CI%20Valgrind/badge.svg)](https://github.com/unicode-org/icu/actions/workflows/icu_valgrind.yml?query=workflow%3A%22GHA+CI%22+branch%3Amain)
|
||||
Fuzzing | [](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:icu)
|
||||
OpenSSF Scorecard | [](https://securityscorecards.dev/viewer/?uri=github.com/unicode-org/icu)
|
||||
|
||||
|
||||
|
||||
### Subdirectories and Information
|
||||
@@ -31,11 +35,11 @@ Fuzzing | [ Tools
|
||||
- [`vendor/`](./vendor/) Vendor dependencies
|
||||
|
||||
### License
|
||||
### Copyright & Licenses
|
||||
|
||||
Please see [./icu4c/LICENSE](./icu4c/LICENSE) (C and J are under an identical license file.)
|
||||
Copyright © 2016-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.
|
||||
|
||||
The project is released under [LICENSE](./LICENSE).
|
||||
|
||||
A CLA is required to contribute to this project - please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) file (or start a Pull Request) for more information.
|
||||
|
||||
> Copyright © 2016 and later Unicode, Inc. and others. All Rights Reserved.
|
||||
Unicode and the Unicode Logo are registered trademarks
|
||||
of Unicode, Inc. in the U.S. and other countries.
|
||||
[Terms of Use and License](http://www.unicode.org/copyright.html)
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
# Security Policy
|
||||
|
||||
If you have discovered a security vulnerability in this project, please report it
|
||||
privately. **Do not disclose it as a public issue.** This gives us time to work with you
|
||||
to fix the issue before public exposure, reducing the chance that the exploit will be
|
||||
used before a patch is released.
|
||||
|
||||
Please submit the bug report as an [ICU Jira issue](https://icu.unicode.org/bugs).
|
||||
Be sure to set "Security level: Sensitive".
|
||||
This ensures the report will only be visible to the ICU team.
|
||||
|
||||
Please provide the following information in your report:
|
||||
|
||||
- A description of the vulnerability and its impact
|
||||
- How to reproduce the issue
|
||||
|
||||
This project is maintained by volunteers on a reasonable-effort basis. As such, we ask
|
||||
that you give us 90 days to work on a fix before public exposure.
|
||||
|
||||
|
||||
> Copyright © 2023 and later Unicode, Inc. and others. All Rights Reserved.
|
||||
Unicode and the Unicode Logo are registered trademarks
|
||||
of Unicode, Inc. in the U.S. and other countries.
|
||||
[Terms of Use and License](http://www.unicode.org/copyright.html)
|
||||
+2
-8
@@ -11,15 +11,10 @@ source "https://rubygems.org"
|
||||
# This will help ensure the proper Jekyll version is running.
|
||||
# Happy Jekylling!
|
||||
|
||||
# gem "jekyll", "~> 3.8.7"
|
||||
|
||||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||
gem "minima", "~> 2.5"
|
||||
# If you aren't using GitHub Pages, then uncomment out the line above that starts with
|
||||
# 'gem "jekyll"' and then comment out the line below that starts with 'gem "github-pages"'.
|
||||
# To upgrade, run `bundle update github-pages`.
|
||||
gem "github-pages", "~> 213", group: :jekyll_plugins
|
||||
gem "just-the-docs"
|
||||
|
||||
gem "github-pages", "228", group: :jekyll_plugins
|
||||
# If you have any plugins, put them here!
|
||||
group :jekyll_plugins do
|
||||
gem "jekyll-feed", "~> 0.12"
|
||||
@@ -34,4 +29,3 @@ end
|
||||
|
||||
# Performance-booster for watching directories on Windows
|
||||
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ url: "https://unicode-org.github.io" # the base hostname & protocol for your sit
|
||||
twitter_username: unicode
|
||||
github_username: unicode-org
|
||||
|
||||
remote_theme: pmarsceill/just-the-docs
|
||||
theme: just-the-docs
|
||||
|
||||
# GitHub uses its own markdown renderer called CommonMarkGhPages.
|
||||
#
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// © 2020 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
|
||||
// Increase the side bar width as some of the page titles don't fit in the default size.
|
||||
$nav-width: 284px;
|
||||
|
||||
// Increase the main content area width as some tables assume a larger size.
|
||||
$content-width: 900px;
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
layout: default
|
||||
title: Demos
|
||||
nav_order: 350
|
||||
description: Demos
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Demos
|
||||
|
||||
## ICU4C Demos
|
||||
|
||||
[List of ICU Demonstrations](https://icu4c-demos.unicode.org/icu-bin/icudemos)
|
||||
|
||||
## ICU4J Demos
|
||||
|
||||
### Server Side Demos
|
||||
|
||||
#### Web Demos
|
||||
|
||||
These demos are running on the ICU server, and are implemented as Java Servlets
|
||||
and JSP pages.
|
||||
|
||||
* [Browse the Demos](http://demo.icu-project.org/icu4jweb/)
|
||||
* [View Demo Source](https://github.com/unicode-org/icu-demos/tree/master/icu4jweb/)
|
||||
|
||||
### Client Side demos
|
||||
|
||||
#### To build the client side samples:
|
||||
|
||||
1. Download the ICU4J source code ( see [Source Code Setup](../devsetup/source) )
|
||||
2. Run `ant jar` to build ICU4J jar
|
||||
3. Run `ant jarDemos` to build the demos
|
||||
4. Run `cp icu4j.jar demos/out/lib`
|
||||
5. Finally, run `java -jar demos/out/lib/icu4j-demos.jar` to launch the demos
|
||||
|
||||
**CalendarApp** This demo compares two calendars against each other. Choose the
|
||||
two calendar types, and the display language, from the pop-up menus. Navigate by
|
||||
days using the < and > buttons, or by years using the << and >> buttons.
|
||||
|
||||
**Translit** This demonstration shows ICU Transliteration. The transliteration
|
||||
mode chosen in the menu will be used as you type.
|
||||
|
||||
**HolidayCalendarDemo** This demo displays holidays from a certain locale,
|
||||
localized into the display language of your choice. Navigate by days using the <
|
||||
and > buttons, or by years using the << and >> buttons.
|
||||
|
||||
**RbnfDemo** This demo shows Rule Based Number Formatting. Please expand the
|
||||
window to show the entire demo. A number may be entered in the top left corner,
|
||||
or the navigation buttons may be used. The pop-up menus in the top right corner
|
||||
will pick the rule and the variant used.
|
||||
|
||||
**DetectingViewer** By opening a document using the Open file or Open URL menu
|
||||
items, this demo will statistically detect the probable file encoding of a file.
|
||||
Use the DetectedEncodings menu to see which encodings were detected.
|
||||
|
||||
*Note:* Due to security constraints, you must use the Downloadable Demo Jar in
|
||||
order to use these demos with files on your local disk. The Java Web Start
|
||||
application will not have permission to read local files.
|
||||
|
||||
---
|
||||
|
||||
### ICU Introduction Applets
|
||||
|
||||
#### About the Applets
|
||||
|
||||
This is a paper introducing ICU calendars, which has live applets throughout the
|
||||
text to demonstrate various features.
|
||||
|
||||
The paper is now archived, see <https://github.com/unicode-org/icu-demos/pull/5>
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Design Docs
|
||||
nav_order: 8000
|
||||
has_children: true
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Design Docs
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,333 @@
|
||||
---
|
||||
layout: default
|
||||
title: Preparsed UCD
|
||||
parent: Design Docs
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Preparsed UCD
|
||||
|
||||
## What
|
||||
|
||||
A text file with preparsed UCD ([Unicode Character
|
||||
Database](http://www.unicode.org/ucd/)) data.
|
||||
|
||||
* Preparser script:
|
||||
[tools/unicode/py/**preparseucd.py**](https://github.com/unicode-org/icu/blob/master/tools/unicode/py/preparseucd.py)
|
||||
* ppucd.txt output:
|
||||
[icu4c/source/data/unidata/**ppucd.txt**](https://github.com/unicode-org/icu/blob/master/icu4c/source/data/unidata/ppucd.txt)
|
||||
([raw text
|
||||
version](https://raw.githubusercontent.com/unicode-org/icu/master/icu4c/source/data/unidata/ppucd.txt))
|
||||
* Parser for ppucd.txt:
|
||||
[icu4c/source/tools/toolutil/**ppucd.h**](https://github.com/unicode-org/icu/blob/master/icu4c/source/tools/toolutil/ppucd.h)
|
||||
&
|
||||
[.cpp](https://github.com/unicode-org/icu/blob/master/icu4c/source/tools/toolutil/ppucd.cpp)
|
||||
* genprops tool rewritten to use that:
|
||||
[tools/unicode/c/**genprops**](https://github.com/unicode-org/icu/tree/master/tools/unicode/c/genprops)
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
# Preparsed UCD generated by ICU preparseucd.py
|
||||
```
|
||||
|
||||
Only whole-line comments starting with #, no inline comments.
|
||||
|
||||
```
|
||||
ucd;10.0.0
|
||||
```
|
||||
|
||||
Data lines start with a type keyword. Data fields are semicolon-separated. The
|
||||
number of fields per line is highly variable.
|
||||
|
||||
The ucd line should be the first data line. It provides the Unicode version
|
||||
number.
|
||||
|
||||
```
|
||||
property;Binary;Alpha;Alphabetic
|
||||
property;Enumerated;bc;Bidi_Class
|
||||
```
|
||||
|
||||
Property lines define properties with a type and two or more aliases.
|
||||
|
||||
```
|
||||
binary;N;No;F;False
|
||||
binary;Y;Yes;T;True
|
||||
value;bc;ON;Other_Neutral
|
||||
```
|
||||
|
||||
Property value lines define the values of enumerated and catalog properties,
|
||||
with the property short name and two or more aliases for each value.
|
||||
|
||||
There is only one shared definition of the values and aliases for binary
|
||||
properties.
|
||||
|
||||
```
|
||||
defaults;0000..10FFFF;age=NA;bc=L;blk=NB;bpt=n;cf=<code point>;dm=<code point>;dt=None;ea=N;FC_NFKC=<code point>;gc=Cn;GCB=XX;gcm=Cn;hst=NA;InPC=NA;InSC=Other;jg=No_Joining_Group;jt=U;lb=XX;lc=<code point>;NFC_QC=Y;NFD_QC=Y;NFKC_CF=<code point>;NFKC_QC=Y;NFKD_QC=Y;nt=None;SB=XX;sc=Zzzz;scf=<code point>;scx=<script>;slc=<code point>;stc=<code point>;suc=<code point>;tc=<code point>;uc=<code point>;vo=R;WB=XX
|
||||
```
|
||||
|
||||
After the version, property, and property value lines, and before other data
|
||||
lines, the defaults line defines default values for all code points
|
||||
(corresponding to @missing data in the UCD). Any properties not mentioned here
|
||||
default to null values according to their type, such as False or the empty
|
||||
string.
|
||||
|
||||
The general syntax of this line is the same as for the following data lines:
|
||||
|
||||
1. Line type keyword.
|
||||
2. Code point or start..end range (inclusive end).
|
||||
3. Zero or more property values.
|
||||
* Binary values are given by their property name alone if True ("Alpha"),
|
||||
or with a minus sign prepended ("-Alpha").
|
||||
* Other values are given as "pname=value" pairs, where pname is the
|
||||
property name.
|
||||
* In the ppucd.txt file, short names of properties and values are used,
|
||||
but parsers should be prepared to accept any of the aliases according to
|
||||
the earlier sections of the file.
|
||||
* In the ppucd.txt file, properties are listed in sorted order, but this
|
||||
is not required by the syntax.
|
||||
|
||||
```
|
||||
block;20000..2A6DF;age=3.1;Alpha;blk=CJK_Ext_B;ea=W;gc=Lo;Gr_Base;IDC;Ideo;IDS;lb=ID;SB=LE;sc=Hani;UIdeo;vo=U;XIDC;XIDS
|
||||
# 20000..2A6D6 CJK Unified Ideographs Extension B
|
||||
algnamesrange;20000..2A6D6;han;CJK UNIFIED IDEOGRAPH-
|
||||
cp;20001;nt=Nu;nv=7
|
||||
cp;20064;nt=Nu;nv=4
|
||||
unassigned;2A6D7..2A6DF;ea=W;lb=ID;vo=U
|
||||
# No block
|
||||
unassigned;2A6E0..2A6FF;ea=W;lb=ID;vo=U
|
||||
algnamesrange;AC00..D7A3;hangul
|
||||
```
|
||||
|
||||
Block lines specify a Unicode Block and provide an opportunity for compact data
|
||||
lines for ranges inside the block, by listing common property values once for
|
||||
the whole block. Block properties override the defaults for cp and unassigned
|
||||
lines with code point ranges inside the block. The file syntax and parser do not
|
||||
require the presence of block lines.
|
||||
|
||||
cp lines provide the data for a code point or range. They override the
|
||||
default+block properties. Properties that are not mentioned fall back to the
|
||||
block, then to the defaults.
|
||||
|
||||
Unassigned lines (new in ICU 60 for Unicode 10) provide the data for an
|
||||
unassigned code point or range (gc=Cn). They override only the default
|
||||
properties, except for the blk=Block property (if the range is inside a block).
|
||||
Properties that are not mentioned fall back to the defaults, except that the
|
||||
blk=Block property applies to unassigned lines as well.
|
||||
|
||||
A range is considered inside a block if it is fully inside the range of the last
|
||||
defined block. Otherwise it is considered outside a block and falls back only to
|
||||
the defaults. This is the case even if the range is inside an earlier block, to
|
||||
simplify parsing & processing (such data lines should be avoided).
|
||||
|
||||
A range inside the block for which there is no data line inherits all of the
|
||||
default+block properties (see Han blocks). Note that this is very different from
|
||||
the behavior of an unassigned line, in particular since such blocks typically
|
||||
default to gc!=Cn.
|
||||
|
||||
Non-default properties for unassigned ranges inside and outside of blocks are
|
||||
typically for [complex
|
||||
defaults](http://www.unicode.org/reports/tr44/#Default_Values_Table) and for
|
||||
noncharacters.
|
||||
|
||||
ppucd.txt data lines are in code point order, although this should not be
|
||||
strictly required.
|
||||
|
||||
Assigned characters normally have their unique na=Name property value. For
|
||||
Hangul syllables with their algorithmically computed names, the entire range is
|
||||
covered by the line "algnamesrange;AC00..D7A3;hangul". For ranges of ideographic
|
||||
characters, a line like "algnamesrange;20000..2A6D6;han;CJK UNIFIED IDEOGRAPH-"
|
||||
provides a Name prefix which is to be followed by the code point (in hex like
|
||||
%04lX).
|
||||
|
||||
## Why not UCD .txt files?
|
||||
|
||||
See [UAX #44 "Unicode Character Database"](http://www.unicode.org/reports/tr44/)
|
||||
|
||||
Nontrivial parsing:
|
||||
|
||||
* The UCD has grown from a couple of semicolon-delimited files plus an
|
||||
informative "Property dump" (early PropList.txt) to a collection of dozens
|
||||
of files with a variety of (now more regular) formats.
|
||||
* Related properties are scattered over several files.
|
||||
* Full information for Numeric_Value and Numeric_Type requires parsing two
|
||||
files.
|
||||
* Default values are "hidden" in comments.
|
||||
* The UCD folder structure (which file where) has changed over time.
|
||||
* UCD filenames change during each Unicode beta period. (A detailed version
|
||||
number is inserted into each filename.)
|
||||
* Many files are bloated with comments that show the General Category and name
|
||||
of each character or range start/end; if the data were combined into a
|
||||
single file, then all properties for a character or range would be listed
|
||||
together, without need for such comments.
|
||||
|
||||
Nontrivial patching: Adding characters (e.g., PUA or proposed/draft) requires
|
||||
adding data in many of the UCD files.
|
||||
|
||||
ICU already preprocesses some of the UCD .txt files. We strip comments from some
|
||||
files (because they are huge) and in some files merge adjacent same-property
|
||||
code points into ranges.
|
||||
|
||||
Some changes are manual, such as updating and adding ranges of algorithmic
|
||||
character names.
|
||||
|
||||
Then we run several tools, most of them twice, to parse different sets of .txt
|
||||
files and write several output files. We use several Python and shell scripts,
|
||||
and a "log" (unidata/changes.txt) with details of what was changed and run in
|
||||
each Unicode version upgrade.
|
||||
|
||||
Markus has done ICU Unicode updates since about 2002. Someone else might have a
|
||||
hard time picking this up for maintenance and future Unicode version updates.
|
||||
|
||||
### Why not UCD XML files?
|
||||
|
||||
See [UAX #42 "Unicode Character Database in
|
||||
XML"](http://www.unicode.org/reports/tr42/)
|
||||
|
||||
Good: The UCD XML file format stores all properties in a single file with a
|
||||
relatively simple structure, with property values as XML attributes.
|
||||
|
||||
Issues:
|
||||
|
||||
* **Missing data** which is needed for ICU
|
||||
* Name_Alias added in UCD 5.0 but missing in UCD XML as of UCD 6.1 beta.
|
||||
* Script_Extensions added in UCD 6.0 but not "blessed" as a Unicode
|
||||
property as of UCD 6.1. Useful, used in ICU, but not available in UCD
|
||||
XML.
|
||||
* Adopting UCD XML would require to either still also parse some UCD .txt
|
||||
files or write another tool to merge more data into the XML.
|
||||
* Dependency on third party
|
||||
* Lag time between UCD .txt vs. XML availability during beta.
|
||||
* Unable to fix/update/extend XML generator tools.
|
||||
* For new properties, need to wait for standardization (UAX #42), tool
|
||||
update, and XML publication.
|
||||
* Will not support custom/nonstandard data.
|
||||
* Could be simpler: Parsing XML is easy in Java, Python, etc. and doable in
|
||||
C++ (we have a "poor man's" XML parser), but not as easy as
|
||||
`line.split(";")`.
|
||||
* There is no need for complex structure for the UCD.
|
||||
* Could be easier to read for humans: By not storing defaults for all of
|
||||
Unicode in one place, each `<group>` carries them, making it hard to see which
|
||||
values are specific to each group. "Fluffy" XML makes for longer text lines,
|
||||
more horizontal scrolling.
|
||||
* Hard to diff: The XML format can be used in different ways, and Unicode
|
||||
publishes different forms of the same data. Also, the precise XML text
|
||||
depends on the XML formatting code used.
|
||||
* For diffing, a special tool needs to be run, parse old & new XML data,
|
||||
compare values and generate a diff report. Unicode publishes some of
|
||||
those too.
|
||||
* Some data still requires nontrivial parsing.
|
||||
* For algorithmic character names, the range needs to be determined by
|
||||
collecting a contiguous sequence of elements with a shared name pattern.
|
||||
There is not even any special notation for the algorithmic names for
|
||||
Hangul syllables.
|
||||
* Minor: Unnecessary data (for ICU)
|
||||
* Precomputed Hangul syllable names
|
||||
* Irrelevant contributory properties like "Other_Xyz"
|
||||
* Properties not used by ICU
|
||||
* Minor, just awkward: Blocks are treated as auxiliary data, rather than as a
|
||||
core means to organize and store the data. On the other hand, the "grouped"
|
||||
XML files also use them as the basis for the `<group>` elements and associated
|
||||
compaction. (The "flat" files don't.)
|
||||
|
||||
## Goals
|
||||
|
||||
* Single file with all data relevant for ICU.
|
||||
* Very easy to parse and use the data in C/C++ tools.
|
||||
* Easily human readable.
|
||||
* Easy-to-read diffs from standard diff tools.
|
||||
* Compact file format.
|
||||
* Conversion tool easy to write, maintain, extend.
|
||||
* Convert from UCD .txt files because those are maintained directly by the UTC
|
||||
& editorial committee. No waiting for third party to convert the files.
|
||||
* Able to extend for new kinds of data.
|
||||
* Easy format for manual data fixes/additions (e.g., PUA or proposed/draft).
|
||||
* Move much of the parsing from scattered C code into one Python script.
|
||||
|
||||
## Details
|
||||
|
||||
* All-Unicode defaults in one place, but only list non-null default values.
|
||||
(`blk=No_Block, cf=<code point>, ...`)
|
||||
* Line-oriented, always semicolon-separated, with type-of-line in the first
|
||||
field.
|
||||
* Block properties override defaults; only for few properties where properties
|
||||
in the block have common, non-default values.
|
||||
* Effective because blocks represent actual allocation & organization of
|
||||
Unicode. Maintained by UTC.
|
||||
* Code point/range properties override default+block properties.
|
||||
* Algorithmic names stored as ranges with type & shared name prefixes (for
|
||||
CJK).
|
||||
* No gratuitous white space or syntax characters.
|
||||
* Mostly key=value, simpler format for binary properties. Easy to read.
|
||||
* Comment lines with headings from NamesList.txt further improve readability.
|
||||
(There are few of them, so no significant size bloat.)
|
||||
* Simple, stable file generation allows diffing.
|
||||
* E.g., list properties in sorted order of property names.
|
||||
* No need to implement/store properties that are not used in ICU. (But format
|
||||
& tool are easy to extend.)
|
||||
|
||||
## Plan
|
||||
|
||||
* (done) Write Python tool to preparse UCD .txt files and generate one output
|
||||
ppucd.txt file.
|
||||
* (done) Subsume existing ucdcopy.py.
|
||||
* (done) Write toolutil C++ parser for ppucd.txt, add ppucd.txt to the unidata
|
||||
folder.
|
||||
* (done) Merge genbidi, gencase, gennames, gennorm into genprops
|
||||
* Replace scattered many-.txt parsers with calls to the toolutil ppucd.txt
|
||||
parser.
|
||||
* Generate all output files in one genprops invocation.
|
||||
* Update makeprops.sh (delete half of it) & changes.txt.
|
||||
* (done) Make preparseucd.py also parse uchar.h & uscript.h and write the
|
||||
property names data header file. (was: ~~Change genpname/preparse.pl to read
|
||||
ppucd.txt rather than Property\[Value\]Aliases.txt.~~)
|
||||
* (done) Consider changing pnames_data.h so that minor changes don't change
|
||||
most of the file contents.
|
||||
* (done) Write wiki/Markus/ReviewTicket8972 with diff links.
|
||||
* 2019-sep-27: The old Trac server is going away. I copied the wiki page
|
||||
contents into a comment on
|
||||
[ICU-8972](https://unicode-org.atlassian.net/browse/ICU-8972).
|
||||
* Move UCD tests from cintltst to intltest, change to use the toolutil
|
||||
ppucd.txt parser. ([ticket
|
||||
#9041](https://unicode-org.atlassian.net/browse/ICU-9041))
|
||||
* Change Java UCD tests to parse & use ppucd.txt. (ticket #9041)
|
||||
* (partially done) Change Python preparser to not copy input UCD .txt files
|
||||
any more, delete them from unidata & Java. (ticket #9041)
|
||||
|
||||
## Other tool improvements
|
||||
|
||||
**Bad**: Until **ICU 4.8**, the process is
|
||||
|
||||
build & install ICU -> build Unicode tools -> run genpname -> build & install
|
||||
ICU (now with updated property names) -> build Unicode tools -> run UCD parsers
|
||||
-> build & install ICU (now also with case properties & normalization etc.) ->
|
||||
build Unicode tools -> run genuca -> build & install ICU
|
||||
|
||||
It should be possible to
|
||||
|
||||
1. merge the Unicode tools into one binary
|
||||
2. parameterize the relevant properties code (property name lookup, case & some
|
||||
other properties, NFC)
|
||||
3. inject newly built data into the common library for the next part of the
|
||||
merged Unicode tool's processing.
|
||||
|
||||
**ICU 49**:
|
||||
|
||||
build & install ICU -> build Unicode tools -> run genprops -> build & install
|
||||
ICU (now with updated properties) -> build Unicode tools -> run genuca -> build
|
||||
& install ICU
|
||||
|
||||
genprops builds the property (value) names data and injects it into the live
|
||||
ppucd.txt parser for further processing.
|
||||
|
||||
**Goal**:
|
||||
|
||||
build & install ICU -> build Unicode tool -> run it -> build & install ICU (now
|
||||
with all updated Unicode data)
|
||||
|
||||
Requires [ticket #9040](https://unicode-org.atlassian.net/browse/ICU-9040),
|
||||
could be "hard".
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
layout: default
|
||||
title: Data Structures
|
||||
parent: Design Docs
|
||||
has_children: true
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Data Structures
|
||||
|
||||
## Subpage Listing
|
||||
|
||||
* [ICU Code Point Tries](./utrie)
|
||||
* [ICU String Tries](./tries/)
|
||||
* [BytesTrie](./tries/bytestrie/)
|
||||
* [UCharsTrie](./tries/ucharstrie)
|
||||
@@ -0,0 +1,358 @@
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
* file name: bytetrie.h
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 2010sep25
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
#ifndef __BYTETRIE_H__
|
||||
#define __BYTETRIE_H__
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief C++ API: Dictionary trie for mapping arbitrary byte sequences
|
||||
* to integer values.
|
||||
*/
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/uobject.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class ByteTrieBuilder;
|
||||
class ByteTrieIterator;
|
||||
|
||||
/**
|
||||
* Light-weight, non-const reader class for a ByteTrie.
|
||||
* Traverses a byte-serialized data structure with minimal state,
|
||||
* for mapping byte sequences to non-negative integer values.
|
||||
*/
|
||||
class /*U_COMMON_API*/ ByteTrie : public UMemory {
|
||||
public:
|
||||
ByteTrie(const void *trieBytes)
|
||||
: bytes(reinterpret_cast<const uint8_t *>(trieBytes)),
|
||||
pos(bytes), remainingMatchLength(-1), value(0) {}
|
||||
|
||||
ByteTrie &reset() {
|
||||
pos=bytes;
|
||||
remainingMatchLength=-1;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Traverses the trie from the current state for this input byte.
|
||||
* @return TRUE if the byte continues a matching byte sequence.
|
||||
*/
|
||||
UBool next(int inByte);
|
||||
|
||||
/**
|
||||
* @return TRUE if the trie contains the byte sequence so far.
|
||||
* In this case, an immediately following call to getValue()
|
||||
* returns the byte sequence's value.
|
||||
*/
|
||||
UBool contains();
|
||||
|
||||
/**
|
||||
* Traverses the trie from the current state for this byte sequence,
|
||||
* calls next(b) for each byte b in the sequence,
|
||||
* and calls contains() at the end.
|
||||
*/
|
||||
UBool containsNext(const char *s, int32_t length);
|
||||
|
||||
/**
|
||||
* Returns a byte sequence's value if called immediately after contains()
|
||||
* returned TRUE. Otherwise undefined.
|
||||
*/
|
||||
int32_t getValue() const { return value; }
|
||||
|
||||
// TODO: For startsWith() functionality, add
|
||||
// UBool getRemainder(ByteSink *remainingBytes, &value);
|
||||
// Returns TRUE if exactly one byte sequence can be reached from the current iterator state.
|
||||
// The remainingBytes sink will receive the remaining bytes of that one sequence.
|
||||
// It might receive some bytes even when the function returns FALSE.
|
||||
|
||||
private:
|
||||
friend class ByteTrieBuilder;
|
||||
friend class ByteTrieIterator;
|
||||
|
||||
inline void stop() {
|
||||
pos=NULL;
|
||||
}
|
||||
|
||||
// Reads a compact 32-bit integer and post-increments pos.
|
||||
// pos is already after the leadByte.
|
||||
// Returns TRUE if the integer is a final value.
|
||||
inline UBool readCompactInt(int32_t leadByte);
|
||||
inline UBool readCompactInt() {
|
||||
int32_t leadByte=*pos++;
|
||||
return readCompactInt(leadByte);
|
||||
}
|
||||
|
||||
// pos is on the leadByte.
|
||||
inline void skipCompactInt(int32_t leadByte);
|
||||
inline void skipCompactInt() { skipCompactInt(*pos); }
|
||||
|
||||
// Reads a fixed-width integer and post-increments pos.
|
||||
inline int32_t readFixedInt(int32_t bytesPerValue);
|
||||
|
||||
// Node lead byte values.
|
||||
|
||||
// 0..3: Branch node with one comparison byte, 1..4 bytes for less-than jump delta,
|
||||
// and compact int for equality.
|
||||
|
||||
// 04..0b: Branch node with a list of 2..9 bytes comparison bytes, each except last one
|
||||
// followed by compact int as final value or jump delta.
|
||||
static const int32_t kMinListBranch=4;
|
||||
// 0c..1f: Node with 1..20 bytes to match.
|
||||
static const int32_t kMinLinearMatch=0xc;
|
||||
// 20..ff: Intermediate value or jump delta, or final value, with 0..4 bytes following.
|
||||
static const int32_t kMinValueLead=0x20;
|
||||
// It is a final value if bit 0 is set.
|
||||
static const int32_t kValueIsFinal=1;
|
||||
// Compact int: After testing bit 0, shift right by 1 and then use the following thresholds.
|
||||
static const int32_t kMinOneByteLead=0x10;
|
||||
static const int32_t kMinTwoByteLead=0x51;
|
||||
static const int32_t kMinThreeByteLead=0x6d;
|
||||
static const int32_t kFourByteLead=0x7e;
|
||||
static const int32_t kFiveByteLead=0x7f;
|
||||
|
||||
static const int32_t kMaxOneByteValue=0x40; // At least 6 bits in the first byte.
|
||||
static const int32_t kMaxTwoByteValue=0x1bff;
|
||||
static const int32_t kMaxThreeByteValue=0x11ffff; // A little more than Unicode code points.
|
||||
|
||||
static const int32_t kMaxListBranchLength=kMinLinearMatch-kMinListBranch+1; // 9
|
||||
static const int32_t kMaxLinearMatchLength=kMinValueLead-kMinLinearMatch; // 20
|
||||
|
||||
// Map a shifted-right compact-int lead byte to its number of bytes.
|
||||
static const int8_t bytesPerLead[kFiveByteLead+1];
|
||||
|
||||
// Fixed value referencing the ByteTrie bytes.
|
||||
const uint8_t *bytes;
|
||||
|
||||
// Iterator variables.
|
||||
|
||||
// Pointer to next trie byte to read. NULL if no more matches.
|
||||
const uint8_t *pos;
|
||||
// Remaining length of a linear-match node, minus 1. Negative if not in such a node.
|
||||
int32_t remainingMatchLength;
|
||||
// Value for a match, after contains() returned TRUE.
|
||||
int32_t value;
|
||||
};
|
||||
|
||||
const int8_t ByteTrie::bytesPerLead[kFiveByteLead+1]={
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5
|
||||
};
|
||||
|
||||
UBool
|
||||
ByteTrie::readCompactInt(int32_t leadByte) {
|
||||
UBool isFinal=(UBool)(leadByte&kValueIsFinal);
|
||||
leadByte>>=1;
|
||||
int numBytes=bytesPerLead[leadByte]-1; // -1: lead byte was already consumed.
|
||||
switch(numBytes) {
|
||||
case 0:
|
||||
value=leadByte-kMinOneByteLead;
|
||||
break;
|
||||
case 1:
|
||||
value=((leadByte-kMinTwoByteLead)<<8)|*pos;
|
||||
break;
|
||||
case 2:
|
||||
value=((leadByte-kMinThreeByteLead)<<16)|(pos[0]<<8)|pos[1];
|
||||
break;
|
||||
case 3:
|
||||
value=(pos[0]<<16)|(pos[1]<<8)|pos[2];
|
||||
break;
|
||||
case 4:
|
||||
value=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
|
||||
break;
|
||||
}
|
||||
pos+=numBytes;
|
||||
return isFinal;
|
||||
}
|
||||
|
||||
void
|
||||
ByteTrie::skipCompactInt(int32_t leadByte) {
|
||||
pos+=bytesPerLead[leadByte>>1];
|
||||
}
|
||||
|
||||
int32_t
|
||||
ByteTrie::readFixedInt(int32_t bytesPerValue) {
|
||||
int32_t fixedInt;
|
||||
switch(bytesPerValue) { // Actually number of bytes minus 1.
|
||||
case 0:
|
||||
fixedInt=*pos;
|
||||
break;
|
||||
case 1:
|
||||
fixedInt=(pos[0]<<8)|pos[1];
|
||||
break;
|
||||
case 2:
|
||||
fixedInt=(pos[0]<<16)|(pos[1]<<8)|pos[2];
|
||||
break;
|
||||
case 3:
|
||||
fixedInt=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
|
||||
break;
|
||||
}
|
||||
pos+=bytesPerValue+1;
|
||||
return fixedInt;
|
||||
}
|
||||
|
||||
UBool
|
||||
ByteTrie::next(int inByte) {
|
||||
if(pos==NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
int32_t length=remainingMatchLength; // Actual remaining match length minus 1.
|
||||
if(length>=0) {
|
||||
// Remaining part of a linear-match node.
|
||||
if(inByte==*pos) {
|
||||
remainingMatchLength=length-1;
|
||||
++pos;
|
||||
return TRUE;
|
||||
} else {
|
||||
// No match.
|
||||
stop();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
int32_t node=*pos++;
|
||||
if(node>=kMinValueLead) {
|
||||
if(node&kValueIsFinal) {
|
||||
// No further matching bytes.
|
||||
stop();
|
||||
return FALSE;
|
||||
} else {
|
||||
// Skip intermediate value.
|
||||
skipCompactInt(node);
|
||||
// The next node must not also be a value node.
|
||||
node=*pos++;
|
||||
// TODO: U_ASSERT(node<kMinValueLead);
|
||||
}
|
||||
}
|
||||
if(node<kMinLinearMatch) {
|
||||
// Branch according to the current byte.
|
||||
while(node<kMinListBranch) {
|
||||
// Branching on a byte value,
|
||||
// with a jump delta for less-than, a compact int for equals,
|
||||
// and continuing for greater-than.
|
||||
// The less-than and greater-than branches must lead to branch nodes again.
|
||||
uint8_t trieByte=*pos++;
|
||||
if(inByte<trieByte) {
|
||||
int32_t delta=readFixedInt(node);
|
||||
pos+=delta;
|
||||
} else {
|
||||
pos+=node+1; // Skip fixed-width integer.
|
||||
node=*pos;
|
||||
if(inByte==trieByte) {
|
||||
// TODO: U_ASSERT(node>=KMinValueLead);
|
||||
if(node&kValueIsFinal) {
|
||||
// Leave the final value for contains() to read.
|
||||
} else {
|
||||
// Use the non-final value as the jump delta.
|
||||
++pos;
|
||||
readCompactInt(node);
|
||||
pos+=value;
|
||||
}
|
||||
return TRUE;
|
||||
} else { // inByte>trieByte
|
||||
skipCompactInt(node);
|
||||
}
|
||||
}
|
||||
node=*pos++;
|
||||
// TODO: U_ASSERT(node<kMinLinearMatch);
|
||||
}
|
||||
// Branch node with a list of key-value pairs where
|
||||
// values are compact integers: either final values or jump deltas.
|
||||
// If the last key byte matches, just continue after it rather
|
||||
// than jumping.
|
||||
length=node-(kMinListBranch-1); // Actual list length minus 1.
|
||||
for(;;) {
|
||||
uint8_t trieByte=*pos++;
|
||||
// U_ASSERT(listLength==0 || *pos>=KMinValueLead);
|
||||
if(inByte==trieByte) {
|
||||
if(length>0) {
|
||||
node=*pos;
|
||||
if(node&kValueIsFinal) {
|
||||
// Leave the final value for contains() to read.
|
||||
} else {
|
||||
// Use the non-final value as the jump delta.
|
||||
++pos;
|
||||
readCompactInt(node);
|
||||
pos+=value;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if(inByte<trieByte || length--==0) {
|
||||
stop();
|
||||
return FALSE;
|
||||
}
|
||||
skipCompactInt();
|
||||
}
|
||||
} else {
|
||||
// Match the first of length+1 bytes.
|
||||
length=node-kMinLinearMatch; // Actual match length minus 1.
|
||||
if(inByte==*pos) {
|
||||
remainingMatchLength=length-1;
|
||||
++pos;
|
||||
return TRUE;
|
||||
} else {
|
||||
// No match.
|
||||
stop();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UBool
|
||||
ByteTrie::contains() {
|
||||
int32_t node;
|
||||
if(pos!=NULL && remainingMatchLength<0 && (node=*pos)>=kMinValueLead) {
|
||||
// Deliver value for the matching bytes.
|
||||
++pos;
|
||||
if(readCompactInt(node)) {
|
||||
stop();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UBool
|
||||
ByteTrie::containsNext(const char *s, int32_t length) {
|
||||
if(length<0) {
|
||||
// NUL-terminated
|
||||
int b;
|
||||
while((b=(uint8_t)*s++)!=0) {
|
||||
if(!next(b)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while(length>0) {
|
||||
if(!next((uint8_t)*s++)) {
|
||||
return FALSE;
|
||||
}
|
||||
--length;
|
||||
}
|
||||
}
|
||||
return contains();
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif // __BYTETRIE_H__
|
||||
@@ -0,0 +1,536 @@
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
* file name: bytetriebuilder.h
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 2010sep25
|
||||
* created by: Markus W. Scherer
|
||||
*
|
||||
* Builder class for ByteTrie dictionary trie.
|
||||
*/
|
||||
|
||||
#ifndef __BYTETRIEBUILDER_H__
|
||||
#define __BYTETRIEBUILDER_H__
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/stringpiece.h"
|
||||
#include "bytetrie.h"
|
||||
#include "charstr.h"
|
||||
#include "cmemory.h"
|
||||
#include "uarrsort.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class ByteTrieElement;
|
||||
|
||||
class /*U_TOOLUTIL_API*/ ByteTrieBuilder : public UMemory {
|
||||
public:
|
||||
ByteTrieBuilder()
|
||||
: elements(NULL), elementsCapacity(0), elementsLength(0),
|
||||
bytes(NULL), bytesCapacity(0), bytesLength(0) {}
|
||||
~ByteTrieBuilder();
|
||||
|
||||
ByteTrieBuilder &add(const StringPiece &s, int32_t value, UErrorCode &errorCode);
|
||||
|
||||
StringPiece build(UErrorCode &errorCode);
|
||||
|
||||
ByteTrieBuilder &clear() {
|
||||
strings.clear();
|
||||
elementsLength=0;
|
||||
bytesLength=0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
void makeNode(int32_t start, int32_t limit, int32_t byteIndex);
|
||||
void makeListBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length);
|
||||
void makeThreeWayBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length);
|
||||
|
||||
UBool ensureCapacity(int32_t length);
|
||||
void write(int32_t byte);
|
||||
void write(const char *b, int32_t length);
|
||||
void writeCompactInt(int32_t i, UBool final);
|
||||
int32_t writeFixedInt(int32_t i); // Returns number of bytes.
|
||||
|
||||
CharString strings;
|
||||
ByteTrieElement *elements;
|
||||
int32_t elementsCapacity;
|
||||
int32_t elementsLength;
|
||||
|
||||
// Byte serialization of the trie.
|
||||
// Grows from the back: bytesLength measures from the end of the buffer!
|
||||
char *bytes;
|
||||
int32_t bytesCapacity;
|
||||
int32_t bytesLength;
|
||||
};
|
||||
|
||||
/*
|
||||
* Note: This builder implementation stores (bytes, value) pairs with full copies
|
||||
* of the byte sequences, until the ByteTrie is built.
|
||||
* It might(!) take less memory if we collected the data in a temporary, dynamic trie.
|
||||
*/
|
||||
|
||||
class ByteTrieElement : public UMemory {
|
||||
public:
|
||||
// Use compiler's default constructor, initializes nothing.
|
||||
|
||||
void setTo(const StringPiece &s, int32_t val, CharString &strings, UErrorCode &errorCode);
|
||||
|
||||
StringPiece getString(const CharString &strings) const {
|
||||
int32_t offset=stringOffset;
|
||||
int32_t length;
|
||||
if(offset>=0) {
|
||||
length=(uint8_t)strings[offset++];
|
||||
} else {
|
||||
offset=~offset;
|
||||
length=((int32_t)(uint8_t)strings[offset]<<8)|(uint8_t)strings[offset+1];
|
||||
offset+=2;
|
||||
}
|
||||
return StringPiece(strings.data()+offset, length);
|
||||
}
|
||||
int32_t getStringLength(const CharString &strings) const {
|
||||
int32_t offset=stringOffset;
|
||||
if(offset>=0) {
|
||||
return (uint8_t)strings[offset];
|
||||
} else {
|
||||
offset=~offset;
|
||||
return ((int32_t)(uint8_t)strings[offset]<<8)|(uint8_t)strings[offset+1];
|
||||
}
|
||||
}
|
||||
|
||||
char charAt(int32_t index, const CharString &strings) const { return data(strings)[index]; }
|
||||
|
||||
int32_t getValue() const { return value; }
|
||||
|
||||
int32_t compareStringTo(const ByteTrieElement &o, const CharString &strings) const;
|
||||
|
||||
private:
|
||||
const char *data(const CharString &strings) const {
|
||||
int32_t offset=stringOffset;
|
||||
if(offset>=0) {
|
||||
++offset;
|
||||
} else {
|
||||
offset=~offset+2;
|
||||
}
|
||||
return strings.data()+offset;
|
||||
}
|
||||
|
||||
// If the stringOffset is non-negative, then the first strings byte contains
|
||||
// the string length.
|
||||
// If the stringOffset is negative, then the first two strings bytes contain
|
||||
// the string length (big-endian), and the offset needs to be bit-inverted.
|
||||
// (Compared with a stringLength field here, this saves 3 bytes per string for most strings.)
|
||||
int32_t stringOffset;
|
||||
int32_t value;
|
||||
};
|
||||
|
||||
void
|
||||
ByteTrieElement::setTo(const StringPiece &s, int32_t val,
|
||||
CharString &strings, UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return;
|
||||
}
|
||||
int32_t length=s.length();
|
||||
if(length>0xffff) {
|
||||
// Too long: We store the length in 1 or 2 bytes.
|
||||
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return;
|
||||
}
|
||||
int32_t offset=strings.length();
|
||||
if(length>0xff) {
|
||||
offset=~offset;
|
||||
strings.append((char)(length>>8), errorCode);
|
||||
}
|
||||
strings.append((char)length, errorCode);
|
||||
stringOffset=offset;
|
||||
value=val;
|
||||
strings.append(s, errorCode);
|
||||
}
|
||||
|
||||
int32_t
|
||||
ByteTrieElement::compareStringTo(const ByteTrieElement &other, const CharString &strings) const {
|
||||
// TODO: add StringPiece.compareTo()
|
||||
StringPiece thisString=getString(strings);
|
||||
StringPiece otherString=other.getString(strings);
|
||||
int32_t lengthDiff=thisString.length()-otherString.length();
|
||||
int32_t commonLength;
|
||||
if(lengthDiff<=0) {
|
||||
commonLength=thisString.length();
|
||||
} else {
|
||||
commonLength=otherString.length();
|
||||
}
|
||||
int32_t diff=uprv_memcmp(thisString.data(), otherString.data(), commonLength);
|
||||
return diff!=0 ? diff : lengthDiff;
|
||||
}
|
||||
|
||||
ByteTrieBuilder::~ByteTrieBuilder() {
|
||||
delete[] elements;
|
||||
uprv_free(bytes);
|
||||
}
|
||||
|
||||
ByteTrieBuilder &
|
||||
ByteTrieBuilder::add(const StringPiece &s, int32_t value, UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return *this;
|
||||
}
|
||||
if(bytesLength>0) {
|
||||
// Cannot add elements after building.
|
||||
errorCode=U_NO_WRITE_PERMISSION;
|
||||
return *this;
|
||||
}
|
||||
bytesCapacity+=s.length()+1; // Crude bytes preallocation estimate.
|
||||
if(elementsLength==elementsCapacity) {
|
||||
int32_t newCapacity;
|
||||
if(elementsCapacity==0) {
|
||||
newCapacity=1024;
|
||||
} else {
|
||||
newCapacity=4*elementsCapacity;
|
||||
}
|
||||
ByteTrieElement *newElements=new ByteTrieElement[newCapacity];
|
||||
if(newElements==NULL) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
if(elementsLength>0) {
|
||||
uprv_memcpy(newElements, elements, elementsLength*sizeof(ByteTrieElement));
|
||||
}
|
||||
delete[] elements;
|
||||
elements=newElements;
|
||||
}
|
||||
elements[elementsLength++].setTo(s, value, strings, errorCode);
|
||||
return *this;
|
||||
}
|
||||
|
||||
U_CDECL_BEGIN
|
||||
|
||||
static int32_t U_CALLCONV
|
||||
compareElementStrings(const void *context, const void *left, const void *right) {
|
||||
const CharString *strings=reinterpret_cast<const CharString *>(context);
|
||||
const ByteTrieElement *leftElement=reinterpret_cast<const ByteTrieElement *>(left);
|
||||
const ByteTrieElement *rightElement=reinterpret_cast<const ByteTrieElement *>(right);
|
||||
return leftElement->compareStringTo(*rightElement, *strings);
|
||||
}
|
||||
|
||||
U_CDECL_END
|
||||
|
||||
StringPiece
|
||||
ByteTrieBuilder::build(UErrorCode &errorCode) {
|
||||
StringPiece result;
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return result;
|
||||
}
|
||||
if(bytesLength>0) {
|
||||
// Already built.
|
||||
result.set(bytes+(bytesCapacity-bytesLength), bytesLength);
|
||||
return result;
|
||||
}
|
||||
if(elementsLength==0) {
|
||||
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return result;
|
||||
}
|
||||
uprv_sortArray(elements, elementsLength, (int32_t)sizeof(ByteTrieElement),
|
||||
compareElementStrings, &strings,
|
||||
FALSE, // need not be a stable sort
|
||||
&errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return result;
|
||||
}
|
||||
// Duplicate strings are not allowed.
|
||||
StringPiece prev=elements[0].getString(strings);
|
||||
for(int32_t i=1; i<elementsLength; ++i) {
|
||||
StringPiece current=elements[i].getString(strings);
|
||||
if(prev==current) {
|
||||
errorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return result;
|
||||
}
|
||||
prev=current;
|
||||
}
|
||||
// Create and byte-serialize the trie for the elements.
|
||||
if(bytesCapacity<1024) {
|
||||
bytesCapacity=1024;
|
||||
}
|
||||
bytes=reinterpret_cast<char *>(uprv_malloc(bytesCapacity));
|
||||
if(bytes==NULL) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return result;
|
||||
}
|
||||
makeNode(0, elementsLength, 0);
|
||||
if(bytes==NULL) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
} else {
|
||||
result.set(bytes+(bytesCapacity-bytesLength), bytesLength);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Requires start<limit,
|
||||
// and all strings of the [start..limit[ elements must be sorted and
|
||||
// have a common prefix of length firstByteIndex.
|
||||
void
|
||||
ByteTrieBuilder::makeNode(int32_t start, int32_t limit, int32_t byteIndex) {
|
||||
if(byteIndex==elements[start].getStringLength(strings)) {
|
||||
// An intermediate or final value.
|
||||
int32_t value=elements[start++].getValue();
|
||||
UBool final= start==limit;
|
||||
if(!final) {
|
||||
makeNode(start, limit, byteIndex);
|
||||
}
|
||||
writeCompactInt(value, final);
|
||||
return;
|
||||
}
|
||||
// Now all [start..limit[ strings are longer than byteIndex.
|
||||
int32_t minByte=(uint8_t)elements[start].charAt(byteIndex, strings);
|
||||
int32_t maxByte=(uint8_t)elements[limit-1].charAt(byteIndex, strings);
|
||||
if(minByte==maxByte) {
|
||||
// Linear-match node: All strings have the same character at byteIndex.
|
||||
int32_t lastByteIndex=byteIndex;
|
||||
int32_t length=0;
|
||||
do {
|
||||
++lastByteIndex;
|
||||
++length;
|
||||
} while(length<ByteTrie::kMaxLinearMatchLength &&
|
||||
elements[start].getStringLength(strings)>lastByteIndex &&
|
||||
elements[start].charAt(lastByteIndex, strings)==
|
||||
elements[limit-1].charAt(lastByteIndex, strings));
|
||||
makeNode(start, limit, lastByteIndex);
|
||||
write(elements[start].getString(strings).data()+byteIndex, length);
|
||||
write(ByteTrie::kMinLinearMatch+length-1);
|
||||
return;
|
||||
}
|
||||
// Branch node.
|
||||
int32_t length=0; // Number of different bytes at byteIndex.
|
||||
int32_t i=start;
|
||||
do {
|
||||
char byte=elements[i++].charAt(byteIndex, strings);
|
||||
while(i<limit && byte==elements[i].charAt(byteIndex, strings)) {
|
||||
++i;
|
||||
}
|
||||
++length;
|
||||
} while(i<limit);
|
||||
// length>=2 because minByte!=maxByte.
|
||||
if(length<=ByteTrie::kMaxListBranchLength) {
|
||||
makeListBranchNode(start, limit, byteIndex, length);
|
||||
} else {
|
||||
makeThreeWayBranchNode(start, limit, byteIndex, length);
|
||||
}
|
||||
}
|
||||
|
||||
// start<limit && all strings longer than byteIndex &&
|
||||
// 2..kMaxListBranchLength different bytes at byteIndex
|
||||
void
|
||||
ByteTrieBuilder::makeListBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length) {
|
||||
// List of byte-value pairs where values are either final values
|
||||
// or jumps to other parts of the trie.
|
||||
int32_t starts[ByteTrie::kMaxListBranchLength-1];
|
||||
UBool final[ByteTrie::kMaxListBranchLength-1];
|
||||
// For each byte except the last one, find its elements array start and its value if final.
|
||||
int32_t byteNumber=0;
|
||||
do {
|
||||
int32_t i=starts[byteNumber]=start;
|
||||
char byte=elements[i++].charAt(byteIndex, strings);
|
||||
while(byte==elements[i].charAt(byteIndex, strings)) {
|
||||
++i;
|
||||
}
|
||||
final[byteNumber]= start==i-1 && byteIndex+1==elements[start].getStringLength(strings);
|
||||
start=i;
|
||||
} while(++byteNumber<length-1);
|
||||
// byteNumber==length-1, and the maxByte elements range is [start..limit[
|
||||
|
||||
// Write the sub-nodes in reverse order: The jump lengths are deltas from
|
||||
// after their own positions, so if we wrote the minByte sub-node first,
|
||||
// then its jump delta would be larger.
|
||||
// Instead we write the minByte sub-node last, for a shorter delta.
|
||||
int32_t jumpTargets[ByteTrie::kMaxListBranchLength-1];
|
||||
byteNumber-=2;
|
||||
do {
|
||||
if(!final[byteNumber]) {
|
||||
makeNode(starts[byteNumber], starts[byteNumber+1], byteIndex+1);
|
||||
jumpTargets[byteNumber]=bytesLength;
|
||||
}
|
||||
} while(--byteNumber>=0);
|
||||
// The maxByte sub-node is written as the very last one because we do
|
||||
// not jump for it at all.
|
||||
byteNumber=length-1;
|
||||
makeNode(start, limit, byteIndex+1);
|
||||
write(elements[start].charAt(byteIndex, strings));
|
||||
// Write the rest of this node's byte-value pairs.
|
||||
while(--byteNumber>=0) {
|
||||
start=starts[byteNumber];
|
||||
int32_t value;
|
||||
if(final[byteNumber]) {
|
||||
// Write the final value for the one string ending with this byte.
|
||||
value=elements[start].getValue();
|
||||
} else {
|
||||
// Write the delta to the start position of the sub-node.
|
||||
value=bytesLength-jumpTargets[byteNumber];
|
||||
}
|
||||
writeCompactInt(value, final[byteNumber]);
|
||||
write(elements[start].charAt(byteIndex, strings));
|
||||
}
|
||||
// Write the node lead byte.
|
||||
write(ByteTrie::kMinListBranch+length-2);
|
||||
}
|
||||
|
||||
// start<limit && all strings longer than byteIndex &&
|
||||
// at least three different bytes at byteIndex
|
||||
void
|
||||
ByteTrieBuilder::makeThreeWayBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length) {
|
||||
// Three-way branch on the middle byte.
|
||||
// Find the middle byte.
|
||||
length/=2; // >=1
|
||||
int32_t i=start;
|
||||
do {
|
||||
char byte=elements[i++].charAt(byteIndex, strings);
|
||||
while(byte==elements[i].charAt(byteIndex, strings)) {
|
||||
++i;
|
||||
}
|
||||
} while(--length>0);
|
||||
// Encode the less-than branch first.
|
||||
// Unlike in the list-branch node (see comments above) where
|
||||
// all jumps are encoded in compact integers, in this node type the
|
||||
// less-than jump is more efficient
|
||||
// (because it is only ever a jump, with a known number of bytes)
|
||||
// than the equals jump (where a jump needs to be distinguished from a final value).
|
||||
makeNode(start, i, byteIndex);
|
||||
int32_t leftNode=bytesLength;
|
||||
// Find the elements range for the middle byte.
|
||||
start=i;
|
||||
char byte=elements[i++].charAt(byteIndex, strings);
|
||||
while(byte==elements[i].charAt(byteIndex, strings)) {
|
||||
++i;
|
||||
}
|
||||
// Encode the equals branch.
|
||||
int32_t value;
|
||||
UBool final;
|
||||
if(start==i-1 && byteIndex+1==elements[start].getStringLength(strings)) {
|
||||
// Store the final value for the one string ending with this byte.
|
||||
value=elements[start].getValue();
|
||||
final=TRUE;
|
||||
} else {
|
||||
// Store the start position of the sub-node.
|
||||
makeNode(start, i, byteIndex+1);
|
||||
value=bytesLength;
|
||||
final=FALSE;
|
||||
}
|
||||
// Encode the greater-than branch last because we do not jump for it at all.
|
||||
makeNode(i, limit, byteIndex);
|
||||
// Write this node.
|
||||
if(!final) {
|
||||
value=bytesLength-value;
|
||||
}
|
||||
writeCompactInt(value, final); // equals
|
||||
int32_t bytesForJump=writeFixedInt(bytesLength-leftNode); // less-than
|
||||
write(byte);
|
||||
write(bytesForJump-1);
|
||||
}
|
||||
|
||||
UBool
|
||||
ByteTrieBuilder::ensureCapacity(int32_t length) {
|
||||
if(bytes==NULL) {
|
||||
return FALSE; // previous memory allocation had failed
|
||||
}
|
||||
if(length>bytesCapacity) {
|
||||
int32_t newCapacity=bytesCapacity;
|
||||
do {
|
||||
newCapacity*=2;
|
||||
} while(newCapacity<=length);
|
||||
char *newBytes=reinterpret_cast<char *>(uprv_malloc(newCapacity));
|
||||
if(newBytes==NULL) {
|
||||
// unable to allocate memory
|
||||
uprv_free(bytes);
|
||||
bytes=NULL;
|
||||
return FALSE;
|
||||
}
|
||||
uprv_memcpy(newBytes+(newCapacity-bytesLength),
|
||||
bytes+(bytesCapacity-bytesLength), bytesLength);
|
||||
uprv_free(bytes);
|
||||
bytes=newBytes;
|
||||
bytesCapacity=newCapacity;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
ByteTrieBuilder::write(int32_t byte) {
|
||||
int32_t newLength=bytesLength+1;
|
||||
if(ensureCapacity(newLength)) {
|
||||
bytesLength=newLength;
|
||||
bytes[bytesCapacity-bytesLength]=(char)byte;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ByteTrieBuilder::write(const char *b, int32_t length) {
|
||||
int32_t newLength=bytesLength+length;
|
||||
if(ensureCapacity(newLength)) {
|
||||
bytesLength=newLength;
|
||||
uprv_memcpy(bytes+(bytesCapacity-bytesLength), b, length);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ByteTrieBuilder::writeCompactInt(int32_t i, UBool final) {
|
||||
char intBytes[5];
|
||||
int32_t length=1;
|
||||
if(i<0 || i>0xffffff) {
|
||||
intBytes[0]=(char)(ByteTrie::kFiveByteLead);
|
||||
intBytes[1]=(char)(i>>24);
|
||||
intBytes[2]=(char)(i>>16);
|
||||
intBytes[3]=(char)(i>>8);
|
||||
intBytes[4]=(char)(i);
|
||||
length=5;
|
||||
} else if(i<=ByteTrie::kMaxOneByteValue) {
|
||||
intBytes[0]=(char)(ByteTrie::kMinOneByteLead+i);
|
||||
} else {
|
||||
if(i<=ByteTrie::kMaxTwoByteValue) {
|
||||
intBytes[0]=(char)(ByteTrie::kMinTwoByteLead+(i>>8));
|
||||
} else {
|
||||
if(i<=ByteTrie::kMaxThreeByteValue) {
|
||||
intBytes[0]=(char)(ByteTrie::kMinThreeByteLead+(i>>16));
|
||||
} else {
|
||||
intBytes[0]=(char)(ByteTrie::kFourByteLead);
|
||||
intBytes[1]=(char)(i>>16);
|
||||
length=2;
|
||||
}
|
||||
intBytes[length++]=(char)(i>>8);
|
||||
}
|
||||
intBytes[length++]=(char)(i);
|
||||
}
|
||||
intBytes[0]=(char)((intBytes[0]<<1)|final);
|
||||
write(intBytes, length);
|
||||
}
|
||||
|
||||
int32_t
|
||||
ByteTrieBuilder::writeFixedInt(int32_t i) {
|
||||
char intBytes[4];
|
||||
int32_t length;
|
||||
if(i<0 || i>0xffffff) {
|
||||
intBytes[0]=(char)(i>>24);
|
||||
intBytes[1]=(char)(i>>16);
|
||||
intBytes[2]=(char)(i>>8);
|
||||
length=3; // last byte below
|
||||
} else {
|
||||
if(i<=0xffff) {
|
||||
length=0;
|
||||
} else {
|
||||
intBytes[0]=(char)(i>>16);
|
||||
length=1;
|
||||
}
|
||||
if(i>0xff) {
|
||||
intBytes[length++]=(char)(i>>8);
|
||||
}
|
||||
}
|
||||
intBytes[length++]=(char)(i);
|
||||
write(intBytes, length);
|
||||
return length;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif // __BYTETRIEBUILDER_H__
|
||||
@@ -0,0 +1,137 @@
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
* file name: bytetriedemo.cpp
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 2010nov05
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/stringpiece.h"
|
||||
|
||||
#include "bytetrie.h"
|
||||
#include "bytetriebuilder.h"
|
||||
#include "bytetrieiterator.h"
|
||||
#include "denseranges.h"
|
||||
#include "toolutil.h"
|
||||
|
||||
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
|
||||
|
||||
static void
|
||||
printBytes(const char *name, const StringPiece &bytes) {
|
||||
printf("%18s [%3d]", name, (int)bytes.length());
|
||||
for(int32_t i=0; i<bytes.length(); ++i) {
|
||||
printf(" %02x", bytes.data()[i]&0xff); // TODO: Add StringPiece::operator[] const
|
||||
}
|
||||
puts("");
|
||||
}
|
||||
|
||||
static void
|
||||
printTrie(const StringPiece &bytes) {
|
||||
IcuToolErrorCode errorCode("printTrie");
|
||||
ByteTrieIterator iter(bytes.data(), errorCode);
|
||||
while(iter.next(errorCode)) {
|
||||
printf(" '%s': %d\n", iter.getString().data(), (int)iter.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
static void printRanges(const int32_t ranges[][2], int32_t length) {
|
||||
printf("ranges[%d]", (int)length);
|
||||
for(int32_t i=0; i<length; ++i) {
|
||||
printf(" [%ld..%ld]", (long)ranges[i][0], (long)ranges[i][1]);
|
||||
}
|
||||
puts("");
|
||||
}
|
||||
|
||||
extern int main(int argc, char* argv[]) {
|
||||
IcuToolErrorCode errorCode("bytetriedemo");
|
||||
ByteTrieBuilder builder;
|
||||
StringPiece sp=builder.add("", 0, errorCode).build(errorCode);
|
||||
printBytes("empty string", sp);
|
||||
ByteTrie empty(sp.data());
|
||||
UBool contains=empty.contains();
|
||||
printf("empty.next() %d %d\n", contains, (int)empty.getValue());
|
||||
printTrie(sp);
|
||||
|
||||
sp=builder.clear().add("a", 1, errorCode).build(errorCode);
|
||||
printBytes("a", sp);
|
||||
ByteTrie a(sp.data());
|
||||
contains=a.next('a') && a.contains();
|
||||
printf("a.next(a) %d %d\n", contains, (int)a.getValue());
|
||||
printTrie(sp);
|
||||
|
||||
sp=builder.clear().add("ab", -1, errorCode).build(errorCode);
|
||||
printBytes("ab", sp);
|
||||
ByteTrie ab(sp.data());
|
||||
contains=ab.next('a') && ab.next('b') && ab.contains();
|
||||
printf("ab.next(ab) %d %d\n", contains, (int)ab.getValue());
|
||||
printTrie(sp);
|
||||
|
||||
sp=builder.clear().add("a", 1, errorCode).add("ab", 100, errorCode).build(errorCode);
|
||||
printBytes("a+ab", sp);
|
||||
ByteTrie a_ab(sp.data());
|
||||
contains=a_ab.next('a') && a_ab.contains();
|
||||
printf("a_ab.next(a) %d %d\n", contains, (int)a_ab.getValue());
|
||||
contains=a_ab.next('b') && a_ab.contains();
|
||||
printf("a_ab.next(b) %d %d\n", contains, (int)a_ab.getValue());
|
||||
contains=a_ab.contains();
|
||||
printf("a_ab.next() %d %d\n", contains, (int)a_ab.getValue());
|
||||
printTrie(sp);
|
||||
|
||||
sp=builder.clear().add("a", 1, errorCode).add("b", 2, errorCode).add("c", 3, errorCode).build(errorCode);
|
||||
printBytes("a+b+c", sp);
|
||||
ByteTrie a_b_c(sp.data());
|
||||
contains=a_b_c.next('a') && a_b_c.contains();
|
||||
printf("a_b_c.next(a) %d %d\n", contains, (int)a_b_c.getValue());
|
||||
contains=a_b_c.next('b') && a_b_c.contains();
|
||||
printf("a_b_c.next(b) %d %d\n", contains, (int)a_b_c.getValue());
|
||||
contains=a_b_c.reset().next('b') && a_b_c.contains();
|
||||
printf("a_b_c.r.next(b) %d %d\n", contains, (int)a_b_c.getValue());
|
||||
contains=a_b_c.reset().next('c') && a_b_c.contains();
|
||||
printf("a_b_c.r.next(c) %d %d\n", contains, (int)a_b_c.getValue());
|
||||
contains=a_b_c.reset().next('d') && a_b_c.contains();
|
||||
printf("a_b_c.r.next(d) %d %d\n", contains, (int)a_b_c.getValue());
|
||||
printTrie(sp);
|
||||
|
||||
builder.clear().add("a", 1, errorCode).add("b", 2, errorCode).add("c", 3, errorCode);
|
||||
builder.add("d", 10, errorCode).add("e", 20, errorCode).add("f", 30, errorCode);
|
||||
builder.add("g", 100, errorCode).add("h", 200, errorCode).add("i", 300, errorCode);
|
||||
builder.add("j", 1000, errorCode).add("k", 2000, errorCode).add("l", 3000, errorCode);
|
||||
sp=builder.build(errorCode);
|
||||
printBytes("a-l", sp);
|
||||
ByteTrie a_l(sp.data());
|
||||
for(char c='`'; c<='m'; ++c) {
|
||||
contains=a_l.reset().next(c) && a_l.contains();
|
||||
printf("a_l.r.next(%c) %d %d\n", c, contains, (int)a_l.getValue());
|
||||
}
|
||||
printTrie(sp);
|
||||
|
||||
static const int32_t values[]={
|
||||
-1, 0, 1, 2,
|
||||
4, 5, 6, 7,
|
||||
12, 13, 14,
|
||||
24, 25, 26
|
||||
};
|
||||
int32_t ranges[3][2];
|
||||
int32_t length;
|
||||
length=uprv_makeDenseRanges(values, LENGTHOF(values), 1, ranges, LENGTHOF(ranges));
|
||||
printRanges(ranges, length);
|
||||
length=uprv_makeDenseRanges(values, LENGTHOF(values), 0xc0, ranges, LENGTHOF(ranges));
|
||||
printRanges(ranges, length);
|
||||
length=uprv_makeDenseRanges(values, LENGTHOF(values), 0xf0, ranges, LENGTHOF(ranges));
|
||||
printRanges(ranges, length);
|
||||
length=uprv_makeDenseRanges(values, LENGTHOF(values), 0x100, ranges, LENGTHOF(ranges));
|
||||
printRanges(ranges, length);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
* file name: bytetrieiterator.h
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 2010nov03
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
#ifndef __BYTETRIEITERATOR_H__
|
||||
#define __BYTETRIEITERATOR_H__
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief C++ API: ByteTrie iterator for all of its (byte sequence, value) pairs.
|
||||
*/
|
||||
|
||||
// Needed if and when we change the .dat package index to a ByteTrie,
|
||||
// so that icupkg can work with an input package.
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/stringpiece.h"
|
||||
#include "bytetrie.h"
|
||||
#include "charstr.h"
|
||||
#include "uvectr32.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* Iterator for all of the (byte sequence, value) pairs in a a ByteTrie.
|
||||
*/
|
||||
class /*U_TOOLUTIL_API*/ ByteTrieIterator : public UMemory {
|
||||
public:
|
||||
ByteTrieIterator(const void *trieBytes, UErrorCode &errorCode)
|
||||
: trie(trieBytes), value(0), stack(errorCode) {}
|
||||
|
||||
/**
|
||||
* Finds the next (byte sequence, value) pair if there is one.
|
||||
* @return TRUE if there is another element.
|
||||
*/
|
||||
UBool next(UErrorCode &errorCode);
|
||||
|
||||
/**
|
||||
* @return TRUE if there are more elements.
|
||||
*/
|
||||
UBool hasNext() const { return trie.pos!=NULL || !stack.isEmpty(); }
|
||||
|
||||
/**
|
||||
* @return the NUL-terminated byte sequence for the last successful next()
|
||||
*/
|
||||
const StringPiece &getString() const { return sp; }
|
||||
/**
|
||||
* @return the value for the last successful next()
|
||||
*/
|
||||
const int32_t getValue() const { return value; }
|
||||
|
||||
private:
|
||||
// The stack stores pairs of integers for backtracking to another
|
||||
// outbound edge of a branch node.
|
||||
// The first integer is an offset from ByteTrie.bytes.
|
||||
// The second integer has the str.length() from before the node in bits 27..0,
|
||||
// and the state in bits 31..28.
|
||||
// Except for the following values for a three-way-branch node,
|
||||
// the lower values indicate how many branches of a list-branch node
|
||||
// are left to be visited.
|
||||
static const int32_t kThreeWayBranchEquals=0xe;
|
||||
static const int32_t kThreeWayBranchGreaterThan=0xf;
|
||||
|
||||
ByteTrie trie;
|
||||
|
||||
CharString str;
|
||||
StringPiece sp;
|
||||
int32_t value;
|
||||
|
||||
UVector32 stack;
|
||||
};
|
||||
|
||||
UBool
|
||||
ByteTrieIterator::next(UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
}
|
||||
if(trie.pos==NULL) {
|
||||
if(stack.isEmpty()) {
|
||||
return FALSE;
|
||||
}
|
||||
// Read the top of the stack and continue with the next outbound edge of
|
||||
// the branch node.
|
||||
// The last outbound edge causes the branch node to be popped off the stack
|
||||
// and the iteration to continue from the trie.pos there.
|
||||
int32_t stackSize=stack.size();
|
||||
int32_t state=stack.elementAti(stackSize-1);
|
||||
trie.pos=trie.bytes+stack.elementAti(stackSize-2);
|
||||
str.truncate(state&0xfffffff);
|
||||
state=(state>>28)&0xf;
|
||||
if(state==kThreeWayBranchEquals) {
|
||||
int32_t node=*trie.pos; // Known to be a three-way-branch node.
|
||||
uint8_t trieByte=trie.pos[1];
|
||||
trie.pos+=node+3; // Skip node, trie byte and fixed-width integer.
|
||||
UBool isFinal=trie.readCompactInt();
|
||||
// Rewrite the top of the stack for the greater-than branch.
|
||||
stack.setElementAt((int32_t)(trie.pos-trie.bytes), stackSize-2);
|
||||
stack.setElementAt((kThreeWayBranchGreaterThan<<28)|str.length(), stackSize-1);
|
||||
str.append((char)trieByte, errorCode);
|
||||
if(isFinal) {
|
||||
value=trie.value;
|
||||
trie.stop();
|
||||
sp.set(str.data(), str.length());
|
||||
return TRUE;
|
||||
} else {
|
||||
trie.pos+=trie.value;
|
||||
}
|
||||
} else if(state==kThreeWayBranchGreaterThan) {
|
||||
// Pop the state.
|
||||
stack.setSize(stackSize-2);
|
||||
} else {
|
||||
// Remainder of a list-branch node.
|
||||
// Read the next key byte.
|
||||
str.append((char)*trie.pos++, errorCode);
|
||||
if(state>0) {
|
||||
UBool isFinal=trie.readCompactInt();
|
||||
// Rewrite the top of the stack for the next branch.
|
||||
stack.setElementAt((int32_t)(trie.pos-trie.bytes), stackSize-2);
|
||||
stack.setElementAt(((state-1)<<28)|(str.length()-1), stackSize-1);
|
||||
if(isFinal) {
|
||||
value=trie.value;
|
||||
trie.stop();
|
||||
sp.set(str.data(), str.length());
|
||||
return TRUE;
|
||||
} else {
|
||||
trie.pos+=trie.value;
|
||||
}
|
||||
} else {
|
||||
// Pop the state.
|
||||
stack.setSize(stackSize-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(;;) {
|
||||
int32_t node=*trie.pos++;
|
||||
if(node>=ByteTrie::kMinValueLead) {
|
||||
// Deliver value for the byte sequence so far.
|
||||
if(trie.readCompactInt(node)) {
|
||||
value=trie.value;
|
||||
trie.stop();
|
||||
}
|
||||
sp.set(str.data(), str.length());
|
||||
return TRUE;
|
||||
} else if(node<ByteTrie::kMinLinearMatch) {
|
||||
// Branch node, needs to take the first outbound edge and push state for the rest.
|
||||
if(node<ByteTrie::kMinListBranch) {
|
||||
// Branching on a byte value,
|
||||
// with a jump delta for less-than, a compact int for equals,
|
||||
// and continuing for greater-than.
|
||||
stack.addElement((int32_t)(trie.pos-1-trie.bytes), errorCode);
|
||||
stack.addElement((kThreeWayBranchEquals<<28)|str.length(), errorCode);
|
||||
// For the less-than branch, ignore the trie byte.
|
||||
++trie.pos;
|
||||
// Jump.
|
||||
int32_t delta=trie.readFixedInt(node);
|
||||
trie.pos+=delta;
|
||||
} else {
|
||||
// Branch node with a list of key-value pairs where
|
||||
// values are compact integers: either final values or jump deltas.
|
||||
int32_t length=node-ByteTrie::kMinListBranch; // Actual list length minus 2.
|
||||
// Read the first (key, value) pair.
|
||||
uint8_t trieByte=*trie.pos++;
|
||||
UBool isFinal=trie.readCompactInt();
|
||||
stack.addElement((int32_t)(trie.pos-trie.bytes), errorCode);
|
||||
stack.addElement((length<<28)|str.length(), errorCode);
|
||||
str.append((char)trieByte, errorCode);
|
||||
if(isFinal) {
|
||||
value=trie.value;
|
||||
trie.stop();
|
||||
sp.set(str.data(), str.length());
|
||||
return TRUE;
|
||||
} else {
|
||||
trie.pos+=trie.value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Linear-match node, append length bytes to str.
|
||||
int32_t length=node-ByteTrie::kMinLinearMatch+1;
|
||||
str.append(reinterpret_cast<const char *>(trie.pos), length, errorCode);
|
||||
trie.pos+=length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif // __BYTETRIEITERATOR_H__
|
||||
@@ -0,0 +1,164 @@
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
* file name: denseranges.h
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 2010sep25
|
||||
* created by: Markus W. Scherer
|
||||
*
|
||||
* Helper code for finding a small number of dense ranges.
|
||||
*/
|
||||
|
||||
#ifndef __DENSERANGES_H__
|
||||
#define __DENSERANGES_H__
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
// Definitions in the anonymous namespace are invisible outside this file.
|
||||
namespace {
|
||||
|
||||
/**
|
||||
* Collect up to 15 range gaps and sort them by ascending gap size.
|
||||
*/
|
||||
class LargestGaps {
|
||||
public:
|
||||
LargestGaps(int32_t max) : maxLength(max<=kCapacity ? max : kCapacity), length(0) {}
|
||||
|
||||
void add(int32_t gapStart, int64_t gapLength) {
|
||||
int32_t i=length;
|
||||
while(i>0 && gapLength>gapLengths[i-1]) {
|
||||
--i;
|
||||
}
|
||||
if(i<maxLength) {
|
||||
// The new gap is now one of the maxLength largest.
|
||||
// Insert the new gap, moving up smaller ones of the previous
|
||||
// length largest.
|
||||
int32_t j= length<maxLength ? j=length++ : j=(maxLength-1);
|
||||
while(j>i) {
|
||||
gapStarts[j]=gapStarts[j-1];
|
||||
gapLengths[j]=gapLengths[j-1];
|
||||
--j;
|
||||
}
|
||||
gapStarts[i]=gapStart;
|
||||
gapLengths[i]=gapLength;
|
||||
}
|
||||
}
|
||||
|
||||
void truncate(int32_t newLength) {
|
||||
if(newLength<length) {
|
||||
length=newLength;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t count() const { return length; }
|
||||
int32_t gapStart(int32_t i) const { return gapStarts[i]; }
|
||||
int64_t gapLength(int32_t i) const { return gapLengths[i]; }
|
||||
|
||||
int32_t firstAfter(int32_t value) const {
|
||||
if(length==0) {
|
||||
return -1;
|
||||
}
|
||||
int32_t minValue=0;
|
||||
int32_t minIndex=-1;
|
||||
for(int32_t i=0; i<length; ++i) {
|
||||
if(value<gapStarts[i] && (minIndex<0 || gapStarts[i]<minValue)) {
|
||||
minValue=gapStarts[i];
|
||||
minIndex=i;
|
||||
}
|
||||
}
|
||||
return minIndex;
|
||||
}
|
||||
|
||||
private:
|
||||
static const int32_t kCapacity=15;
|
||||
|
||||
int32_t maxLength;
|
||||
int32_t length;
|
||||
int32_t gapStarts[kCapacity];
|
||||
int64_t gapLengths[kCapacity];
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
/**
|
||||
* Does it make sense to write 1..capacity ranges?
|
||||
* Returns 0 if not, otherwise the number of ranges.
|
||||
* @param values Sorted array of signed-integer values.
|
||||
* @param length Number of values.
|
||||
* @param density Minimum average range density, in 256th. (0x100=100%=perfectly dense.)
|
||||
* Should be 0x80..0x100, must be 1..0x100.
|
||||
* @param ranges Output ranges array.
|
||||
* @param capacity Maximum number of ranges.
|
||||
* @return Minimum number of ranges (at most capacity) that have the desired density,
|
||||
* or 0 if that density cannot be achieved.
|
||||
*/
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_makeDenseRanges(const int32_t values[], int32_t length,
|
||||
int32_t density,
|
||||
int32_t ranges[][2], int32_t capacity) {
|
||||
if(length<=2) {
|
||||
return 0;
|
||||
}
|
||||
int32_t minValue=values[0];
|
||||
int32_t maxValue=values[length-1]; // Assume minValue<=maxValue.
|
||||
// Use int64_t variables for intermediate-value precision and to avoid
|
||||
// signed-int32_t overflow of maxValue-minValue.
|
||||
int64_t maxLength=(int64_t)maxValue-(int64_t)minValue+1;
|
||||
if(length>=(density*maxLength)/0x100) {
|
||||
// Use one range.
|
||||
ranges[0][0]=minValue;
|
||||
ranges[0][1]=maxValue;
|
||||
return 1;
|
||||
}
|
||||
if(length<=4) {
|
||||
return 0;
|
||||
}
|
||||
// See if we can split [minValue, maxValue] into 2..capacity ranges,
|
||||
// divided by the 1..(capacity-1) largest gaps.
|
||||
LargestGaps gaps(capacity-1);
|
||||
int32_t i;
|
||||
int32_t expectedValue=minValue;
|
||||
for(i=1; i<length; ++i) {
|
||||
++expectedValue;
|
||||
int32_t actualValue=values[i];
|
||||
if(expectedValue!=actualValue) {
|
||||
gaps.add(expectedValue, (int64_t)actualValue-(int64_t)expectedValue);
|
||||
expectedValue=actualValue;
|
||||
}
|
||||
}
|
||||
// We know gaps.count()>=1 because we have fewer values (length) than
|
||||
// the length of the [minValue..maxValue] range (maxLength).
|
||||
// (Otherwise we would have returned with the one range above.)
|
||||
int32_t num;
|
||||
for(i=0, num=2;; ++i, ++num) {
|
||||
if(i>=gaps.count()) {
|
||||
// The values are too sparse for capacity or fewer ranges
|
||||
// of the requested density.
|
||||
return 0;
|
||||
}
|
||||
maxLength-=gaps.gapLength(i);
|
||||
if(length>num*2 && length>=(density*maxLength)/0x100) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Use the num ranges with the num-1 largest gaps.
|
||||
gaps.truncate(num-1);
|
||||
ranges[0][0]=minValue;
|
||||
for(i=0; i<=num-2; ++i) {
|
||||
int32_t gapIndex=gaps.firstAfter(minValue);
|
||||
int32_t gapStart=gaps.gapStart(gapIndex);
|
||||
ranges[i][1]=gapStart-1;
|
||||
ranges[i+1][0]=minValue=(int32_t)(gapStart+gaps.gapLength(gapIndex));
|
||||
}
|
||||
ranges[num-1][1]=maxValue;
|
||||
return num;
|
||||
}
|
||||
|
||||
#endif // __DENSERANGES_H__
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,135 @@
|
||||
---
|
||||
layout: default
|
||||
title: BytesTrie
|
||||
parent: Data Structures
|
||||
grand_parent: Design Docs
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# BytesTrie
|
||||
|
||||
This is an idea for a trie that is intended to be fairly simple but also fairly
|
||||
efficient and versatile. It maps from arbitrary byte sequences to 32-bit
|
||||
integers. (Small non-negative integers are stored more efficiently. Negative
|
||||
integers are the least efficient.)
|
||||
|
||||
Input strings would be mapped to byte sequences. Invariant-character strings
|
||||
could be used directly, if the trie was built for the appropriate charset
|
||||
family, or we could map EBCDIC input to ASCII (while lowercasing for
|
||||
case-insensitive matching).
|
||||
|
||||
For Thai DBBI, each of U+0E00..U+0EFF could be mapped to its low byte.
|
||||
|
||||
For CJK DBBI, we could use UTF-16BE or a slight variant of it. For general
|
||||
Unicode strings (e.g., time zone names), we could devise a simple encoding that
|
||||
maps printable ASCII to single bytes, Unihan & Hangul and some other ranges to
|
||||
two bytes per character, and the rest to three bytes per character. (We could
|
||||
also use this for CJK DBBI, to reduce the number of such "converters".) Or, we
|
||||
use a [UCharsTrie](../ucharstrie.md) for those.
|
||||
|
||||
Sample code is linked below.
|
||||
|
||||
See the [UCharsTrie](../ucharstrie.md) sibling page for some more details. The
|
||||
BytesTrie and UCharsTrie structures are nearly the same, except that the
|
||||
UCharsTrie uses fewer, larger units.
|
||||
|
||||
See also the [diagram of a BytesTrie for a sample set of string-to-value
|
||||
mappings](https://docs.google.com/drawings/edit?id=1-doZNpcByYItcDAcvKmIpwJMWFgXpYCm43GnUrbat3g).
|
||||
|
||||
## Design points
|
||||
|
||||
* The BytesTrie and UCharsTrie are designed to be
|
||||
byte-serialized/UChar-serialized, for trivial platform swapping.
|
||||
* Compact: Small values and jump deltas should be encoded in few bytes. This
|
||||
requires variable-length encodings.
|
||||
* The length of each value/delta is encoded either in a preceding node or in
|
||||
its own lead unit. This makes skipping values efficient, and fewer units
|
||||
need to be range-checked while reading variable-length values.
|
||||
* Nodes with small values are encoded in single units.
|
||||
* Linear-match nodes match a sequence of units without choice/selection.
|
||||
* Branches
|
||||
* Branches store relative deltas to "jump" to following nodes. Small
|
||||
deltas are encoded in single units; encoding deltas is much more
|
||||
efficient than encoding absolute offsets.
|
||||
* Variable-width values make binary search on branch nodes infeasible.
|
||||
Therefore, branches with lists of (key, value) pairs are limited to
|
||||
short list lengths for linear search.
|
||||
* For large branches, branch nodes contain one unit, for branching to the
|
||||
left (less-than) or to the right (greater-or-equal). This encodes a
|
||||
binary search into the data structure.
|
||||
* Initially, I had an equals edge in split-branch sub-nodes as well,
|
||||
but that slowed down matching significantly (9% in one case) without
|
||||
noticeably helping with the serialized size (0.2% in that case).
|
||||
* At the end of each node (except for a final-value node), matching
|
||||
continues with the next node, rather than using another jump to a
|
||||
different location.
|
||||
* Each branch head node encodes the length of the branch (the number of
|
||||
units to select from). The split-branch and list-branch sub-nodes do not
|
||||
have node heads. Instead, the code tracks the remaining length of the
|
||||
branch, halving it for each split-branch edge and counting down in a
|
||||
list-branch sub-node.
|
||||
* The maximum length of a list-branch sub-node is fixed, that is, part of
|
||||
the serialized data format and cannot be changed compatibly. This
|
||||
constant is used in the branching code to decide whether to split
|
||||
less-than/greater-or-equal vs. walk a list of key-value pairs.
|
||||
* This constant must be at least 3 so that split-branch sub-nodes have a
|
||||
length of at least 4 so that the following list-branch nodes have a
|
||||
length of at least 2 and can use a do-while loop rather than a while
|
||||
loop. (Saving one length check.)
|
||||
* I explored an alternative, with only split-branch nodes down to length 1
|
||||
and then a final match unit with continuing matching after that. It was
|
||||
fast but also significantly larger. A branch like this is about twice
|
||||
the size of a key-value pair list. If the average list-branch length is
|
||||
n, a branch has (length/n)-1 split-branch sub-nodes. This experiment
|
||||
corresponds to n=1.
|
||||
* API
|
||||
* The API is simple and low-level. At the core, next(unit) "turns the
|
||||
crank" and returns basically a 2-bit result that encodes matches() (this
|
||||
unit continues a matching sequence), hasNext() (another unit can
|
||||
continue a matching sequence) and hasValue() (the units so far are a
|
||||
matching string).
|
||||
* Higher-level functions that handle different input (e.g., normalize
|
||||
units on the fly) and provide variations of functionality (e.g., longest
|
||||
match, startsWith, find all matches from some point in text, ...) can be
|
||||
built on top of the low-level functions without cluttering the API or
|
||||
pulling in further dependencies.
|
||||
* The next(unit) function stops on a value node rather than decoding the
|
||||
value, saving time until the value is requested (via getValue()). The
|
||||
following next(unit2) call will then skip over the value node.
|
||||
* There is enough API to serve a variety of uses, including
|
||||
matching/mapping whole strings, finding out if a prefix belongs only to
|
||||
strings with the same value, getting all units that can continue from
|
||||
some point, and getting all (string, value) pairs. This should be able
|
||||
to support lookups, parsing with abbreviations, word segmentation, etc.
|
||||
* The "fast" builder code is simple. The builder builds, it need not use a
|
||||
trie structure until writing the serialized form, and it need not provide
|
||||
any of the trie runtime API.
|
||||
* There is builder code that makes a "small" trie, attempting to avoid writing
|
||||
duplicate nodes. This is possible when whole trees of nodes are the same and
|
||||
at least one is reached via a "jump" delta which can "jump" to the
|
||||
previously written serialization of such a tree.
|
||||
|
||||
## Sample Code
|
||||
|
||||
The following demo code was last updaed Nov. 2010:
|
||||
|
||||
* [`bytetrie.h`](./bytetrie.h)
|
||||
* [`bytetriebuilder.h`](./bytetriebuilder.h)
|
||||
* [`bytetriedemo.cpp`](./bytetriedemo.cpp)
|
||||
* [`bytetrieiterator.h`](./bytetrieiterator.h)
|
||||
* [`denseranges.h`](./denseranges.h)
|
||||
* [`genpname.cpp`](./genpname.cpp)
|
||||
|
||||
### Latest versions of source code
|
||||
|
||||
The latest versions of the above sample code (except for `bytetriedemo.cpp`) exist in the ICU repository, sometimes under slightly different names and reorganized:
|
||||
|
||||
* [icu4c/source/common/unicode/**bytestrie.h**](https://github.com/unicode-org/icu/blob/main/icu4c/source/common/unicode/bytestrie.h)
|
||||
* [icu4c/source/common/unicode/**bytestriebuilder.h**](https://github.com/unicode-org/icu/blob/main/icu4c/source/common/unicode/bytestriebuilder.h)
|
||||
* [icu4c/source/tools/toolutil/**denseranges.h**](https://github.com/unicode-org/icu/blob/main/icu4c/source/tools/toolutil/denseranges.h)
|
||||
* [tools/unicode/c/genprops/**pnamesbuilder.cpp**](https://github.com/unicode-org/icu/blob/main/tools/unicode/c/genprops/pnamesbuilder.cpp)
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
layout: default
|
||||
title: ICU String Tries
|
||||
parent: Data Structures
|
||||
grand_parent: Design Docs
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# ICU String Tries
|
||||
|
||||
We have several implementations of string tries, mapping strings to boolean or
|
||||
integer values: Currently for time zone name parsing and DBBI. Other areas might
|
||||
also benefit from tries: Property names, character names, UnicodeSetStringSpan,
|
||||
.dat package file TOC.
|
||||
|
||||
We should have a small number of common map-from-string trie implementations;
|
||||
fairly compact, fairly efficient, easily serializable, and well-tested.
|
||||
|
||||
See the subpages for ideas.
|
||||
|
||||
For a UnicodeSetStringSpan, we would want to find each next match starting from
|
||||
some point in the text, rather than passing each unit of text and finding out if
|
||||
the units so far match.
|
||||
|
||||
Note: In terms of whole-string-lookup performance, the fastest data structure is
|
||||
a hash map. Where whole-string-lookup is the only relevant operation, we could
|
||||
consider implementing an easily serialized hash map.
|
||||
|
||||
See also [ICU Code Point Tries](../utrie.md).
|
||||
|
||||
Implementations:
|
||||
|
||||
* [BytesTrie](./bytestrie/)
|
||||
* [UCharsTrie](./ucharstrie)
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
layout: default
|
||||
title: UCharsTrie
|
||||
parent: Data Structures
|
||||
grand_parent: Design Docs
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# UCharsTrie
|
||||
|
||||
Same design as a [BytesTrie](bytestrie/index.md), but mapping any UnicodeString
|
||||
(any sequence of 16-bit units) to 32-bit integer values. This can use somewhat
|
||||
simpler code because there are more bits to work with in each unit, and it is
|
||||
probably more appropriate and faster than a BytesTrie for collation
|
||||
contractions/prefixes, CJK dictionaries, and maybe for use with Unicode strings
|
||||
in general when it is not known that we work with a small script or mostly with
|
||||
ASCII.
|
||||
|
||||
The code and data structure are quite similar to the BytesTrie. In general,
|
||||
larger units are used to store larger values and deltas in single units than
|
||||
possible in a BytesTrie, and fewer variable-length units are needed in all
|
||||
cases.
|
||||
|
||||
In addition, some of the bits of match-nodes (linear-match and branch nodes) are
|
||||
used for intermediate values (small values or most significant bits), rather
|
||||
than separate intermediate-value nodes in a BytesTrie. Larger intermediate
|
||||
values have one or two units following the match node head, then followed by the
|
||||
match node's contents.
|
||||
@@ -0,0 +1,312 @@
|
||||
---
|
||||
layout: default
|
||||
title: ICU Code Point Tries
|
||||
parent: Data Structures
|
||||
grand_parent: Design Docs
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# ICU Code Point Tries
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
## Fast lookup in arrays
|
||||
|
||||
For fast lookup by code point, we store data in arrays. It costs too much space
|
||||
to use a single array indexed directly by code points: There are about 1.1M of
|
||||
them (max 0x10ffff, about 20.1 bits), and about 90% are unassigned or private
|
||||
use code points. For some uses, there are non-default values only for a few
|
||||
hundred characters.
|
||||
|
||||
We use a form of "trie" adapted to single code points. The bits in the code
|
||||
point integer are divided into two or more parts. The first part is used as an
|
||||
array offset, the value there is used as a start offset into another array. The
|
||||
next code point bit field is used as an additional offset into that array, to
|
||||
fetch another value. The final part yields the data for the code point.
|
||||
Non-final arrays are called index arrays or tables.
|
||||
|
||||
> See also [ICU String Tries](tries/index.md).
|
||||
|
||||
For lookup of arbitrary code points, we need at least three successive arrays,
|
||||
so that the first index table is not too large.
|
||||
|
||||
For all but the first index table, different blocks of code points with the same
|
||||
values can overlap. A special block contains only default values and is shared
|
||||
among all blocks of code points that map there.
|
||||
|
||||
Block sharing works better, and thus leads to smaller data structures, the
|
||||
smaller the blocks are, that is, the fewer bits in the code point bit fields
|
||||
used as intra-block offsets.
|
||||
|
||||
On the other hand, shorter bit fields require more bit fields and more
|
||||
successive arrays and lookups, which adds code size and makes lookups slower.
|
||||
|
||||
(Until about 2001, all ICU data structures only handled BMP code points.
|
||||
"Compact arrays" split 16-bit code points into fields of 9 and 7 bits.)
|
||||
|
||||
We tend to make compromises including additional index tables for smaller parts
|
||||
of the Unicode code space, for simpler, faster lookup there.
|
||||
|
||||
For a general-purpose structure, we want to be able to be able to store a unique
|
||||
value for every character. This determines the number of bits needed in the last
|
||||
index table. With 136,690 characters assigned in Unicode 10, we need at least 18
|
||||
bits. We allocate data values in blocks aligned at multiples of 4, and we use
|
||||
16-bit index words shifted left by 2 bits. This leads to a small loss in how
|
||||
densely the data table can be used, and how well it can be compacted, but not
|
||||
nearly as much as if we were using 32-bit index words.
|
||||
|
||||
## Character conversion
|
||||
|
||||
The ICU conversion code uses several variants of code point tries with data
|
||||
values of 1, 2, 3, or 4 bytes corresponding to the number of bytes in the output
|
||||
encoding.
|
||||
|
||||
## UTrie
|
||||
|
||||
The original "UTrie" structure was developed for Unicode Normalization for all
|
||||
of Unicode. It was then generalized for collation, character properties, and
|
||||
eventually almost every Unicode data lookup. Values are 16 or 32 bits wide.
|
||||
|
||||
It was designed for fast UTF-16 lookup with a special, complicated structure for
|
||||
supplementary code points using custom values for lead surrogate units. This
|
||||
custom data and code made this structure relatively hard to use.
|
||||
|
||||
11:5 bits for the BMP and effectively 5:5:5:5 bits for supplementary code points
|
||||
provide for good compaction. The BMP index table is always 2<sup>11</sup> uint16_t = 4kB.
|
||||
Small index blocks for the supplementary range are added as needed.
|
||||
|
||||
The structure stores different values for lead surrogate code *units* (for fast
|
||||
moving through UTF-16_ vs. code *points* (for lookup by code point).
|
||||
|
||||
The first 256 data table entries are a fixed-size, linear table for Latin-1 (up
|
||||
to U+00FF).
|
||||
|
||||
## UTrie2
|
||||
|
||||
The "UTrie2" structure, developed in 2008, was designed to enable fast lookup
|
||||
from UTF-8 without always having to assemble whole code points and to split them
|
||||
again into the trie bit fields.
|
||||
|
||||
It retains separate lookups for lead surrogate code units vs. code points.
|
||||
|
||||
It retains the same 11:5 lookup for BMP code points, for good compaction and
|
||||
good performance.
|
||||
|
||||
There is a special small index for lead bytes of two-byte UTF-8 sequences (up to
|
||||
U+07FF), for 5:6 lookup. These index values are not shifted left by 2.
|
||||
|
||||
Lookup for three-byte UTF-8 uses the BMP index, which is clumsy.
|
||||
|
||||
Lookup for supplementary code points is much simpler than with UTrie, without
|
||||
custom data values or code. Two index tables are used for 9:6:5 code point bits.
|
||||
The first index table omits the BMP part. The structure stores the a code point
|
||||
after which every one maps to the default value, and the first index is
|
||||
truncated to below that.
|
||||
|
||||
With the fixed BMP index table and other required structures, an empty UTrie2 is
|
||||
about 5kB large.
|
||||
|
||||
The UTF-8 lookup was also designed for the original handling of ill-formed
|
||||
UTF-8: The first 192 data table entries are a linear table for ASCII plus the 64
|
||||
trail bytes, to look up "single" bytes 0..BF without further checking, with
|
||||
error values for the trail bytes. Lookup of two-byte non-shortest forms (C0
|
||||
80..C1 BF) also yields error values. These error values became unused in 2017
|
||||
when ICU 60 changed to handling ill-formed UTF-8 compatible with the W3C
|
||||
Encoding standard (substituting maximal subparts of valid sequences). C0 and C1
|
||||
are no longer recognized as lead bytes, requiring full byte sequence validation
|
||||
separate from the data lookup.
|
||||
|
||||
## Ideas
|
||||
|
||||
Possible goals: Simpler code, smaller data especially for sparse tries, maybe
|
||||
faster UTF-8, not much slower UTF-16.
|
||||
|
||||
We should try to store only one set of values for surrogates. Unicode property
|
||||
APIs use only by-code point lookup without special lead surrogate values.
|
||||
Collation uses special lead surrogate data but does not use code point lookup.
|
||||
Normalization does both, but the per-code point lookup could test for surrogate
|
||||
code points first and return trivial values for all of them. UTF-16 string
|
||||
lookup should map unpaired surrogates to the error value.
|
||||
|
||||
We should remove the special data for old handling of ill-formed UTF-8, the
|
||||
error values for trail bytes and two-byte non-shortest forms.
|
||||
|
||||
If we use 6 bits for the last code point bit field, then we can use the same
|
||||
index table for code point/UTF-16 lookup as well as UTF-8 lookup. Compaction
|
||||
will be less effective, so data will grow some. This would be somewhat
|
||||
compensated by the smaller BMP index table.
|
||||
|
||||
If we also continue to use 6 bits for the second-to-last table, that is, 8:6:6
|
||||
bits, then we can simplify the code for three- and four-byte UTF-8.
|
||||
|
||||
If we always include the BMP in the first index table, then we can also simplify
|
||||
enumeration code a bit, and use smaller code for code point lookups where code
|
||||
size is more important than maximum speed.
|
||||
|
||||
Alternatively, we could improve compaction and speed for the BMP by using no
|
||||
index shift-left for BMP indexes (and keep omitting the BMP part of the first
|
||||
index table). In order to ensure that BMP data can be indexed directly with
|
||||
16-bit index values, the builder would probably have to copy at least the BMP
|
||||
data into a new array for compaction, before adding data for supplementary code
|
||||
points. When some of the indexes are not shifted, and their data is compacted to
|
||||
arbitrary offsets, then that data cannot also be addressed with uniform
|
||||
double-index lookup. We may or may not store unused first-index entries. If not
|
||||
the whole BMP is indexed differently, then UTF-16 and three-byte UTF-8 lookups
|
||||
need another code branch. (Size vs. simplicity & speed.)
|
||||
|
||||
The more tries we use, the higher the total cost of the size overhead. (For
|
||||
example, many of the 100 or so collation tailorings carry a UTrie2.) The less
|
||||
overhead, the more we could use separate tries where we currently combine them
|
||||
or avoid them. Smaller overhead would make it more attractive to offer a public
|
||||
code point map structure.
|
||||
|
||||
Going to 10:6 bits for the BMP cuts the fixed-size index in half, to 2kB.
|
||||
|
||||
We could reduce the fixed-size index table much further by using two-index
|
||||
lookup for some or most of the BMP, trading off data size for speed and
|
||||
simplicity. The index must be at least 32 uint16_t's for two-byte UTF-8, for up
|
||||
to U+07FF including Cyrillic and Arabic. We could experiment with length 64 for
|
||||
U+0FFF including Indic scripts and Thai, 208 entries for U+33FF (most small
|
||||
scripts and Kana), or back to 1024 entries for the whole BMP. We could configure
|
||||
a different value at build time for different services (optimizing for speed vs.
|
||||
size). If we use the faster lookup for three-byte UTF-8, then the boundaries
|
||||
should be multiples of 0x1000 (up to U+3FFF instead of U+33FF).
|
||||
|
||||
## UCPTrie / CodePointTrie
|
||||
|
||||
Added as public API in ICU 63. Developed between the very end of 2017 and
|
||||
mid-2018.
|
||||
|
||||
Based on many of the ideas above and experimentation.
|
||||
|
||||
Continued linear data array lookup for ASCII.
|
||||
|
||||
No more separate values for lead surrogate code points vs. code units.
|
||||
|
||||
* Normalization switched to UCPTrie, working around this: Storing special lead
|
||||
surrogate values for UTF-16 forward iteration; for code point lookup, the
|
||||
normalization code checks for lead surrogates and returns an "inert" value
|
||||
for them; for code point range iteration uses special API that treats lead
|
||||
surrogates as "inert" as well.
|
||||
* Otherwise simpler API, easier to explain.
|
||||
* UTF-16 string lookup maps unpaired surrogates to the error value.
|
||||
|
||||
For low-code point lookup, uses 6 bits for the last code point field.
|
||||
|
||||
* No more need for special UTF-8 2/3-byte lookup structures.
|
||||
* Smaller BMP index reduces size overhead.
|
||||
|
||||
No more data structures for non-shortest UTF-8 sequences.
|
||||
|
||||
"Fast" type uses two-stage lookup for all of the BMP (10:6 bits). "Small" type
|
||||
uses two-stage lookup only up to U+0FFF to trade off size vs. speed. (fastLimit
|
||||
U+10000 vs. U+1000)
|
||||
|
||||
Continued use of highStart for the start of the last range (ending at U+10FFFF),
|
||||
and highValue for the value of all of its code points.
|
||||
|
||||
For code points between fastLimit and highStart, a four-stage lookup is used
|
||||
(compared with three stages in UTrie2), with small bit fields (6:5:5:4 bits).
|
||||
"Fast" type: Only for supplementary code points below highStart, if any. "Small"
|
||||
type: For all code points below highStart; this means that for U+0000..U+0FFF in
|
||||
a "small" trie data can be accessed with either the two-stage or the four-stage
|
||||
lookup (and for ASCII also with linear access).
|
||||
|
||||
Experimentation confirmed that larger bit fields, especially for the last one or
|
||||
two stages, lead to poor compaction of sparse data. 6 bits for the data offset
|
||||
work well for UTF-8 lookup and are a reasonable compromise for the BMP, but for
|
||||
the large supplementary area which tends to have more sparse data, using a 4 bit
|
||||
data offset was useful. The drawback is that then the index blocks get larger
|
||||
and compact less well. Four-byte UTF-8 lookup (for supplementary
|
||||
|
||||
* Started with 8:6:6 bits, but some tries were 30% larger than with UTrie2.
|
||||
* Went to 10:6:4 bits which saved 12% overall, with only one trie larger than
|
||||
UTrie2 (by 8%).
|
||||
* Experimented with a "gap", omitting parts of the index for another range
|
||||
like highStart for a typically large range of code points with a single
|
||||
common value. This helped
|
||||
* Experimented with 10:6:4 vs. 11:5:4 vs. 9:6:5 vs. 10:5:5 bits plus the gap.
|
||||
\*:4 were smaller than \*:5, but the bit distribution within the index
|
||||
stages had little effect. 11:5:4 yielded the smallest data, indicating that
|
||||
small bit fields are useful for index stages as well.
|
||||
* Replaced the gap with splitting the first index bit field into two, for a
|
||||
four-stage 6:5:5:4 lookup. Just slightly smaller data than 11:5:4+gap, but
|
||||
less complicated than checking for the gap and working around it; replaces
|
||||
gap start/limit reads and comparisons with unconditional index array
|
||||
accesses. 14% smaller overall than UTrie2.
|
||||
* Added the "small" type where the two-stage lookup only extends to U+0FFF
|
||||
(6:6 bits) and the four-stage lookup covers all code points below highStart.
|
||||
34% smaller overall than UTrie2.
|
||||
|
||||
The normalization code also lazy-builds a trie with CanonicalIterator data which
|
||||
is very sparse even in the BMP. With a "fast" UCPTrie it is significantly larger
|
||||
than with UTrie2, with a "small" UCPTrie it is significantly smaller. Switched
|
||||
the code to use a "small" trie because it is less performance-sensitive than the
|
||||
trie used for normalizing strings.
|
||||
|
||||
In order to cover up to 256k data values, UTrie2 always shifts 16-bit data block
|
||||
start offsets left by 2. UCPTrie abandons this, which simplifies two-stage
|
||||
lookups slightly and improves compaction (no more granularity of 4 for data
|
||||
block alignment).
|
||||
|
||||
* For a "fast" trie to always reach all BMP data values with 16-bit index
|
||||
entries, the data array is always accessed via a separate pointer, rather
|
||||
than UTrie2's sharing of the index array with 16-bit data via offsetting by
|
||||
the length of the index. This also simplifies code slightly and makes access
|
||||
uniform for all data value widths.
|
||||
* There are now at most 64k data values for BMP code points because there is
|
||||
no separate data for lead surrogates any more. The builder code writes data
|
||||
blocks in code point order to ensure that low code points have low data
|
||||
block offsets.
|
||||
* For supplementary code points, data block offsets may need 18 bits. This is
|
||||
very unusual but possible. (It currently happens only in the collation root
|
||||
data with Han radical-stroke order, and in a unit test.)
|
||||
* UCPTrie uses the high bit of the index-2 entry to indicate that the index-3
|
||||
block stores 18-bit data block offsets rather than 16-bit ones. (This limits
|
||||
somewhat the length of the index.) In this case, groups of 8 index-3 entries
|
||||
(= data block start offsets) share an additional entry that stores the two
|
||||
high bits of each of the eight entries. More complicated lookup, but almost
|
||||
never used, and keeps BMP lookups always simple.
|
||||
* A possible alternative could have used a bit per entry, or per small group
|
||||
of entries, to indicate that a common data value should be returned for
|
||||
"unused" parts of a sparse data block. There could have been a common value
|
||||
per index-3 block, per index-2 block, or for the whole trie, etc. Rejected
|
||||
as much too complicated.
|
||||
|
||||
UTrie2 stores a whole block of 64 error values for UTF-8 non-shortest-form
|
||||
lookup. UCPTrie does not have this block any more; it stores the error value at
|
||||
the end of the data array, at dataLength-1.
|
||||
|
||||
UTrie2 stores the highValue at dataLength-4. UCPTrie stores it at dataLength-2.
|
||||
|
||||
Comparison: [UTrie2 vs.
|
||||
UCPTrie/CodePointTrie](https://docs.google.com/document/d/e/2PACX-1vTbwdDe2tVJ6pACMpOq7uKW_FgvyyjvPVdgZYsIwSoFJj-27cXR20wAO9qHVoaKOIoo-d8iHnsFOCdc/pub)
|
||||
|
||||
Sizes for BreakIterator & Collator tries, UTrie2 vs. UTrie3 experiments: [In
|
||||
this
|
||||
spreadsheet](https://docs.google.com/spreadsheets/d/e/2PACX-1vTgL260NFgmbiUAtptKj4fNf9wNm-OJ6Q0TbWzFWvhV7wVZk2Qe-gk2pbJh0pHY9XVsObZ3YaoOnb3I/pubhtml)
|
||||
see the "nocid" sheet (no CanonicalIterator data).
|
||||
|
||||
The last columns on the "nocid" sheet, highlighted in green and blue, correspond
|
||||
to the final UCPTrie/CodePointTrie. For these tries, the "fast" type (green)
|
||||
yields 14% smaller data than UTrie2; the "small" type (blue) yields 34% smaller
|
||||
data.
|
||||
|
||||
The simplenormperf sheets show performance comparison data between UTrie2 and
|
||||
"fast" UCPTrie. There should be little difference for BMP characters; the
|
||||
numbers are too inconsistent to show a significant difference.
|
||||
|
||||
UCPTrie has an option of storing 8-bit values, in addition to 16-bit and 32-bit
|
||||
values that UTrie2 supports. It would be possible to add 12-bit or 64-bit values
|
||||
etc. later.
|
||||
@@ -0,0 +1,96 @@
|
||||
---
|
||||
layout: default
|
||||
title: Profiling ICU4C with callgrind
|
||||
grand_parent: Setup for Contributors
|
||||
parent: C++ Setup
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Profiling ICU4C with callgrind
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Valgrind, callgrind and kcachegrind together proved performance profiling of C++
|
||||
code, including annotated source code with time consumption at each line.
|
||||
|
||||
Prequisites:
|
||||
|
||||
* Linux with the clang compiler.
|
||||
* Valgrind. If not already installed, from the command line,
|
||||
* `sudo apt install valgrind`
|
||||
* kcachegrind. To install:
|
||||
* `sudo apt install kcachegrind`
|
||||
|
||||
Build ICU. An optimized build with debug symbols is generally best for
|
||||
profiling:
|
||||
|
||||
```
|
||||
cd icu4c/source
|
||||
./runConfigureICU --enable-debug Linux
|
||||
make -j6 check
|
||||
```
|
||||
|
||||
## Run test code
|
||||
|
||||
Prepare the test code you wish to measure. Valgrind is very slow, so be wary of
|
||||
long running tests. Because Valgrind tracks every last machine instruction (it's
|
||||
not a sampling profiler), getting good results does not require a long run.
|
||||
|
||||
Run the test code under valgrind with callgrind. The example below runs a test
|
||||
from intltest, but that is not a requirement; valgrind will profile any
|
||||
executable. The differences from a normal (non-profile) invocation are
|
||||
highlighted.
|
||||
|
||||
Without the `LD_BIND_NOW=y` the output is polluted by symbol lookups.
|
||||
|
||||
```
|
||||
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH
|
||||
LD_BIND_NOW=y valgrind --tool=callgrind
|
||||
--callgrind-out-file=callgrind.out ./intltest
|
||||
translit/TransliteratorTest/TestAllCodepoints
|
||||
```
|
||||
|
||||
The raw profiling data will be left in a callgrind.out file,
|
||||
|
||||
```
|
||||
ls -l callgrind*
|
||||
-rw------- 1 aheninger eng 325779 Oct 3 15:51 callgrind.out
|
||||
```
|
||||
|
||||
## View in kcachegrind
|
||||
|
||||
Run kcachegrind to view the results.
|
||||
|
||||
```
|
||||
kcachegrind callgrind.out
|
||||
```
|
||||
|
||||
Explore. Lots of interesting data is available.
|
||||
|
||||
[kcachegrind docs](https://kcachegrind.github.io/html/Documentation.html)
|
||||
|
||||
For the above run, here are the top functions, ordered by cumulative time
|
||||
(including calls out) spent in each.
|
||||
|
||||

|
||||
|
||||
Time spent in each function, self time only. `UnicodeSet::add()` is hot.
|
||||
|
||||

|
||||
|
||||
Annotated source for `UnicodeSet::add()`
|
||||
|
||||

|
||||
Binary file not shown.
|
After Width: | Height: | Size: 266 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 254 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
@@ -1,3 +1,5 @@
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
@@ -0,0 +1,125 @@
|
||||
---
|
||||
layout: default
|
||||
title: C++ Setup
|
||||
parent: Setup for Contributors
|
||||
has_children: true
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# C++ Setup
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
## C/C++ workspace structure
|
||||
|
||||
It is best to keep the source file tree and the build-output files separate
|
||||
("out-of-source build"). It keeps your source tree clean, and you can build
|
||||
multiple configurations from the same source tree (e.g., debug build, release
|
||||
build, build with special flags such as no-using-namespace). You could keep the
|
||||
source and build trees in parallel folders.
|
||||
|
||||
**Important:** If you use runConfigureICU together with CXXFLAGS or similar, the
|
||||
*custom flags must be before the runConfigureICU invocation*. (So that they
|
||||
are visible as environment variables in the runConfigureICU shell script, rather
|
||||
than just options text.) See the sample runConfigureICU invocations below.
|
||||
|
||||
See the ICU4C readme's [Recommended Build
|
||||
Options](https://htmlpreview.github.io/?https://github.com/unicode-org/icu/blob/master/icu4c/readme.html#RecBuild).
|
||||
|
||||
For example:
|
||||
|
||||
* `~/icu/mine/**src**`
|
||||
* source tree including icu (ICU4C) & icu4j folders
|
||||
* setup: mkdir + git clone your fork (see the [Linux Tips
|
||||
subpage](linux.md)) + cd to here.
|
||||
* Use `git checkout <branch>` to switch between branches.
|
||||
* Use `git checkout -b <newbranchname>` to create a new branch and switch
|
||||
to it.
|
||||
* After switching branches, remember to update your IDE's view of the
|
||||
source tree.
|
||||
* For C++ code, you may want to `make clean` *before* switching to a
|
||||
different branch.
|
||||
* `~/icu/mine/icu4c/**bld**`
|
||||
* release build output
|
||||
* not-using-namespace is always recommended
|
||||
* setup: mkdir+cd to here, then something like
|
||||
`CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
|
||||
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
|
||||
../../src/icu4c/source/**runConfigureICU** Linux
|
||||
--prefix=/home/*your_user_name*/icu/mine/inst > config.out 2>&1`
|
||||
* build: `make -j5 check > out.txt 2>&1`
|
||||
* `~/icu/mine/icu4c/**dbg**`
|
||||
* debug build output
|
||||
* not-using-namespace is always recommended
|
||||
* setup: mkdir+cd to here, then something like
|
||||
`CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
|
||||
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
|
||||
../../src/icu4c/source/**runConfigureICU** --enable-debug
|
||||
--disable-release Linux --prefix=/home/*your_user_name*/icu/mine/inst >
|
||||
config.out 2>&1`
|
||||
* build: make -j5 check > out.txt 2>&1
|
||||
* Be sure to test with both gcc/g++ and clang/clang++!
|
||||
`CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
|
||||
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
|
||||
../../src/icu4c/source/runConfigureICU --enable-debug --disable-release
|
||||
Linux/clang`
|
||||
* `~/icu/mine/icu4c/**nm_utf8**`
|
||||
* not-using-namespace and default-hardcoded-UTF-8
|
||||
* setup: mkdir+cd to here, then something like
|
||||
`../../src/icu4c/source/**configure**
|
||||
CXXFLAGS="-DU_USING_ICU_NAMESPACE=0" CPPFLAGS="-DU_CHARSET_IS_UTF8=1
|
||||
-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
|
||||
--prefix=/home/*your_user_name*/icu/mine/inst > config.out 2>&1`
|
||||
* ~/icu/mine/icu4c/static
|
||||
* gcc with static linking
|
||||
* setup: mkdir+cd to here, then something like
|
||||
`../../src/icu4c/source/**configure**
|
||||
CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
|
||||
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -O2 -ffunction-sections
|
||||
-fdata-sections" LDFLAGS="-Wl,--gc-sections" --enable-static
|
||||
--disable-shared --prefix=/home/*your_user_name*/icu/mine/inst >
|
||||
config.out 2>&1`
|
||||
* `~/icu/mine/`**`inst`**
|
||||
* “make install” destination (don’t clobber your platform ICU during
|
||||
development)
|
||||
* `~/icu/**msg48**/src`
|
||||
* Optional: You could have multiple parallel workspaces, each with their
|
||||
own git clones, to reduce switching a single workspace (and the IDE
|
||||
looking at it) from one branch to another.
|
||||
|
||||
### Run individual test suites
|
||||
|
||||
* `cd ~/icu/mine/icu4c/dbg/test/intltest`
|
||||
* `export LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw`
|
||||
* `make -j5 && ./intltest utility/ByteTrieTest utility/UCharTrieTest`
|
||||
* `cd ~/icu/mine/icu4c/dbg/test/cintltst`
|
||||
* same relative `LD_LIBRARY_PATH` as for intltest
|
||||
* `make -j5 && ./cintltst`
|
||||
|
||||
## gdb pretty-printing
|
||||
|
||||
Shane wrote this gdb script in 2017: It pretty-prints UnicodeString in GDB.
|
||||
Instead of seeing the raw internals of UnicodeString, you will see the length,
|
||||
storage type, and content of the UnicodeString in your debugger. There are
|
||||
installation instructions in the top comment on the file (it's a matter of
|
||||
downloading the file and adding a line to `~/.gdbinit`).
|
||||
|
||||
<https://gist.github.com/sffc/7b3826fd67cb78057a9e66f2b350a647>
|
||||
|
||||
This also works in anything that wraps GDB, like CLion and Visual Studio Code.
|
||||
|
||||
## Linux Tips
|
||||
|
||||
For more Linux-specific tips see the [Linux Tips subpage](linux.md).
|
||||
@@ -0,0 +1,178 @@
|
||||
---
|
||||
layout: default
|
||||
title: C++ Setup on Linux
|
||||
grand_parent: Setup for Contributors
|
||||
parent: C++ Setup
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# C++ Setup on Linux
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Compiler
|
||||
|
||||
For ICU4C 50 or newer the `configure` script picks `clang` if it is installed,
|
||||
or else `gcc`. Clang produces superior error messages and warnings.
|
||||
|
||||
Most Linuxes should have clang available to install. On Ubuntu or other
|
||||
Debian-based systems, install it with
|
||||
|
||||
```
|
||||
sudo apt-get install clang
|
||||
```
|
||||
|
||||
Debug builds must use compiler option `-g` and should not optimize (`-O0` is the
|
||||
default). A future version of `gcc` might support `-Og` as the recommended
|
||||
optimization level for debugging.
|
||||
|
||||
Release builds can use `-O3` for best performance. See
|
||||
<http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html>
|
||||
|
||||
`clang` might even benefit from `-O4` where "whole program optimization is done
|
||||
at link time". See
|
||||
<http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/clang.1.html>
|
||||
|
||||
## Other build flags
|
||||
|
||||
On a modern Linux you can configure with `CPPFLAGS="-DU_CHARSET_IS_UTF8=1"`.
|
||||
|
||||
## Debugging
|
||||
|
||||
`gdb` should work with both out-of-source and in-source builds. If not,
|
||||
double-check with "`make VERBOSE=1`" that both .c and .cpp files are compiled
|
||||
with `-g` and either `-O0` or no `-O*anything*` at all.
|
||||
|
||||
`kdbg` is a reasonable GUI frontend for gdb. It keeps the source code in sync
|
||||
and updates views of variables & memory etc.
|
||||
|
||||
* kdbg versions below 2.5.2 do not work with gdb 7.5; you get a message box
|
||||
with "GDB: Reading symbols from..."
|
||||
* As a workaround,
|
||||
* Create a `~/.gdbinit` file with `set print symbol-loading off`
|
||||
* Start kdbg, open `Settings/Global options` and remove the `--nx`
|
||||
argument to gdb.
|
||||
|
||||
## Portability Testing
|
||||
|
||||
GitHub pull requests are automatically tested on Windows, Linux with both clang
|
||||
& gcc, and Macintosh. The build results show up as check results on the status
|
||||
page.
|
||||
|
||||
Build errors will block the pull request. It's also useful to check the build
|
||||
logs for new warnings on platforms other than the one used for development.
|
||||
|
||||
## Clang sanitizers
|
||||
|
||||
Clang has built-in santizers to check for several classes of problems. Here are
|
||||
the configure options for building ICU with the address checker:
|
||||
|
||||
```
|
||||
CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address ./runConfigureICU
|
||||
--enable-debug --disable-release Linux/clang --disable-renaming
|
||||
```
|
||||
|
||||
The other available sanitizers are `thread`, `memory` and `undefined` behavior.
|
||||
At the time of this writing, thread and address run cleanly, the others show
|
||||
warnings that have not yet been resolved.
|
||||
|
||||
## Heap Usage (ICU4C)
|
||||
|
||||
HeapTrack is a useful tool for analyzing heap usage of a test program, to check
|
||||
the total heap activity of a particular function or object creation, for
|
||||
example. It will show totals by line in the source, and can move up and down the
|
||||
stack to see more detail.
|
||||
|
||||
<https://github.com/KDE/heaptrack>
|
||||
|
||||
To install on Linux,
|
||||
|
||||
```
|
||||
sudo apt install heaptrack
|
||||
sudo apt install heaptrack-gui
|
||||
```
|
||||
|
||||
## Quick Scripts for small test programs
|
||||
|
||||
I use the following simple scripts to simplify building and debugging small
|
||||
stand-alone programs against ICU, without needing to set up makefiles. They
|
||||
assume a program with a single .cpp file with the same name as the directory in
|
||||
which it resides.
|
||||
|
||||
```
|
||||
b: build
|
||||
|
||||
r: run
|
||||
|
||||
d: debug
|
||||
|
||||
v: run under valgrind
|
||||
```
|
||||
|
||||
You will probably need to modify them to reflect where you keep your most
|
||||
commonly used ICU build, and whether you routinely use an out-of-source ICU
|
||||
build.
|
||||
|
||||
```
|
||||
$ cat \`which b\`
|
||||
|
||||
#! /bin/sh
|
||||
|
||||
if \[\[ -z "${ICU_HOME}" \]\] ; then
|
||||
|
||||
ICU_HOME=$HOME/icu/icu4c
|
||||
|
||||
fi
|
||||
|
||||
DIR=\`pwd\`
|
||||
|
||||
PROG=\`basename $DIR\`
|
||||
|
||||
clang++ -g -I $ICU_HOME/source/common -I $ICU_HOME/source/i18n -I
|
||||
$ICU_HOME/source/io -L$ICU_HOME/source/lib -L$ICU_HOME/source/stubdata -licuuc
|
||||
-licui18n -licudata -o $PROG $PROG.cpp
|
||||
|
||||
$ cat \`which r\`
|
||||
|
||||
#! /bin/sh
|
||||
if \[\[ -z "${ICU_HOME}" \]\] ; then
|
||||
ICU_HOME=$HOME/icu/icu/icu4c
|
||||
fi
|
||||
DIR=\`pwd\`
|
||||
PROG=\`basename $DIR\`
|
||||
LD_LIBRARY_PATH=$ICU_HOME/source/lib:$ICU_HOME/source/stubdata
|
||||
ICU_DATA=$ICU_HOME/source/data/out ./$PROG
|
||||
|
||||
cat \`which d\`
|
||||
#! /bin/sh
|
||||
if \[\[ -z "${ICU_HOME}" \]\] ; then
|
||||
ICU_HOME=$HOME/icu/icu/icu4c
|
||||
fi
|
||||
DIR=\`pwd\`
|
||||
PROG=\`basename $DIR\`
|
||||
LD_LIBRARY_PATH=$ICU_HOME/source/lib:$ICU_HOME/source/stubdata
|
||||
ICU_DATA=$ICU_HOME/source/data/out gdb ./$PROG
|
||||
|
||||
$ cat \`which v\`
|
||||
|
||||
#! /bin/sh
|
||||
if \[\[ -z "${ICU_HOME}" \]\] ; then
|
||||
ICU_HOME=$HOME/icu/icu/icu4c
|
||||
fi
|
||||
DIR=\`pwd\`
|
||||
PROG=\`basename $DIR\`
|
||||
LD_LIBRARY_PATH=$ICU_HOME/source/lib:$ICU_HOME/source/stubdata
|
||||
ICU_DATA=$ICU_HOME/source/data/out valgrind --leak-check=full ./$PROG
|
||||
```
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
layout: default
|
||||
title: Configuring VS Code for ICU4C
|
||||
grand_parent: Setup for Contributors
|
||||
parent: C++ Setup
|
||||
---
|
||||
|
||||
<!--- © 2020 and later: Unicode, Inc. and others. --->
|
||||
<!--- License & terms of use: http://www.unicode.org/copyright.html --->
|
||||
|
||||
# Configuring VS Code for ICU4C
|
||||
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
- Create a `.vscode` folder in icu4c/source
|
||||
- Copy the [`tasks.json`](tasks.json), [`launch.json`](launch.json) and [`c_cpp_properties.json`](c_cpp_properties.json) files into
|
||||
the `.vscode` folder.
|
||||
- To test only specific test targets, specify them under `args` in
|
||||
`launch.json`.
|
||||
- To adjust the parallelism when building, adjust the `args` in `tasks.json`.
|
||||
- `-l20` tells VSCode to not launch jobs if the system load average is above
|
||||
20 (note that the [system load
|
||||
average](https://en.wikipedia.org/wiki/Load_(computing)) is *not* a CPU
|
||||
usage percentage).
|
||||
- `-j24` limits the number of jobs launched in parallel to 24. The system
|
||||
load average takes a while to respond, reducing this number helps the
|
||||
initial bad system performance when a new build is launched.
|
||||
|
||||
NOTE:
|
||||
Run the
|
||||
[`./runConfigureICU` command](https://unicode-org.github.io/icu/userguide/icufaq)
|
||||
before building `icu4c` from VSCode.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Setup for Contributors
|
||||
nav_order: 10000
|
||||
has_children: true
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Setup for Contributors
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
@@ -0,0 +1,246 @@
|
||||
---
|
||||
layout: default
|
||||
title: Ant Setup for Java
|
||||
grand_parent: Setup for Contributors
|
||||
parent: Java Setup
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Ant Setup for Java
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
ICU4J source layout was changed after 4.2. There are several ways to set up the
|
||||
ICU4J development environment.
|
||||
|
||||
Get the source code by following the [Quick Start
|
||||
instruction](http://site.icu-project.org/repository). Go into the icu4j/
|
||||
directory to see the build.xml file. You can run targets displayed by `ant -p`.
|
||||
|
||||
Main targets:
|
||||
|
||||
* `all` Build all primary targets
|
||||
* `apireport` Run API report generator tool
|
||||
* `apireportOld` Run API report generator tool (Pre Java 5 Style)
|
||||
* `build-tools` Build build-tool classes
|
||||
* `charset` Build charset classes
|
||||
* `charset-tests` Build charset tests
|
||||
* `charsetCheck` Run only the charset tests
|
||||
* `check` Run the standard ICU4J test suite
|
||||
* `checkDeprecated` Check consistency between javadoc @deprecated and @Deprecated annotation
|
||||
* `checkTest` Run only the specified tests of the specified test class or, if no arguments are given, the standard ICU4J test suite.
|
||||
* `checktags` Check API tags before release
|
||||
* `cldrUtil` Build Utilities for CLDR tooling
|
||||
* `clean` Clean up build outputs
|
||||
* `collate` Build collation classes
|
||||
* `collate-tests` Build core tests
|
||||
* `collateCheck` Run only the collation tests
|
||||
* `core` Build core classes
|
||||
* `core-tests` Build core tests
|
||||
* `coreCheck` Run only the core tests
|
||||
* `coverageJaCoCo` Run the ICU4J unit tests and generate code coverage report
|
||||
* `currdata` Build currency data classes
|
||||
* `demos` Build demo classes
|
||||
* `docs` Build API documents
|
||||
* `docsStrict` Build API documents with all doclint check enabled
|
||||
* `draftAPIs` Run API collector tool and generate draft API report
|
||||
* `exhaustiveCheck` Run the standard ICU4J test suite in exhaustive mode
|
||||
* `findbugs` Run FindBugs on all library sub projects.
|
||||
* `gatherapi` Run API database generator tool
|
||||
* `gatherapiOld` Run API database generator tool (Pre Java 5 style)
|
||||
* `icu4jJar` Build ICU4J all-in-one core jar
|
||||
* `icu4jSrcJar` Build icu4j-src.jar
|
||||
* `icu4jtestsJar` Build ICU4J all-in-one test jar
|
||||
* `indicIMEJar` Build indic IME 'icuindicime.jar' jar file
|
||||
* `info` Display the build environment information
|
||||
* `init` Initialize the environment for build and test. May require internet access.
|
||||
* `jar` Build ICU4J runtime library jar files
|
||||
* `jarDemos` Build ICU4J demo jar file
|
||||
* `jdktzCheck` Run the standard ICU4J test suite with JDK TimeZone
|
||||
* `langdata` Build language data classes
|
||||
* `localespi` Build Locale SPI classes
|
||||
* `localespi-tests` Build Locale SPI tests
|
||||
* `localespiCheck` Run the ICU4J Locale SPI test suite
|
||||
* `main` Build ICU4J runtime library classes
|
||||
* `packaging-tests` Build packaging tests
|
||||
* `packagingCheck` Run packaging tests
|
||||
* `perf-tests` Build performance test classes
|
||||
* `regiondata` Build region data classes
|
||||
* `release` Build all ICU4J release files for distribution
|
||||
* `releaseBinaries` Build ICU4J binary files for distribution
|
||||
* `releaseCLDR` Build release files for CLDR tooling
|
||||
* `releaseDocs` Build ICU4J API reference doc jar file for distribution
|
||||
* `releaseSourceArchiveTgz` Build ICU4J source release archive (.tgz)
|
||||
* `releaseSourceArchiveZip` Build ICU4J source release archive (.zip)
|
||||
* `releaseSrcJars` Build ICU4J src jar files for distribution
|
||||
* `releaseVer` Build all ICU4J release files for distribution with versioned file names
|
||||
* `runTest` Run the standard ICU4J test suite without calling any other build targets
|
||||
* `samples` Build sample classes
|
||||
* `secure` (Deprecated)Build ICU4J API and test classes for running the ICU4J test suite with Java security manager enabled
|
||||
* `secureCheck` Run the secure (applet-like) ICU4J test suite
|
||||
* `test-framework` Build test framework classes
|
||||
* `tests` Build ICU4J test classes
|
||||
* `timeZoneCheck` Run the complete test for TimeZoneRoundTripAll
|
||||
* `tools` Build tool classes
|
||||
* `translit` Build translit classes
|
||||
* `translit-tests` Build translit tests
|
||||
* `translitCheck` Run the ICU4J Translit test suite
|
||||
* `translitIMEJar` Build transliterator IME 'icutransime.jar' jar file
|
||||
* `xliff` Build xliff converter tool
|
||||
|
||||
Default target: main
|
||||
The typical usage is `ant check`, which will build main ICU4J libraries and
|
||||
run the standard unit test suite.
|
||||
|
||||
For running ant you may need to set up some environment variables first. For
|
||||
example, on Windows:
|
||||
|
||||
```
|
||||
set ANT_HOME=C:\\ant\\apache-ant-1.7.1
|
||||
|
||||
set JAVA_HOME=C:\\Program Files\\Java\\jdk1.5.0_07
|
||||
|
||||
set PATH=%JAVA_HOME%\\bin;%ANT_HOME%\\bin;%PATH%
|
||||
```
|
||||
|
||||
## Test arguments and running just one test or the tests of just one test class
|
||||
|
||||
You can pass arguments to the test system by using the 'testclass' and
|
||||
'testnames' variables and the 'checkTest' target. For example:
|
||||
|
||||
|Command Line|Meaning|
|
||||
|------------|--------|
|
||||
|`ant checkTest -Dtestclass='com.ibm.icu.dev.test.lang.TestUScript'` | Runs all the tests in test class 'TestUScript'.|
|
||||
|`ant checkTest -Dtestclass='com.ibm.icu.dev.test.lang.TestUScript' -Dtestnames='TestNewCode,TestHasScript'` | Runs the tests `TestNewCode` and `TestHasScript` in test class `TestUScript`. |
|
||||
|`ant checkTest -Dtestnames='TestNewCode,TestHasScript'` | Error: test class not specified.|
|
||||
|`ant checkTest` | Runs the standard ICU4J test suite (same as 'ant check').|
|
||||
|
||||
The JUnit-generated test result reports are in out/junit-results/checkTest. Go
|
||||
into the `html/` subdirectory and load `index.html` into a browser.
|
||||
|
||||
## Generating Test Code Coverage Report
|
||||
|
||||
[#10513](http://bugs.icu-project.org/trac/ticket/10513) added code coverage
|
||||
target "coverageJaCoCo" in the ICU4J ant build.xml. To run the target:
|
||||
|
||||
1. Download JaCoCo library from [EclEmma
|
||||
site](http://eclemma.org/jacoco/index.html).
|
||||
2. Extract library files to your local system - e.g. `C:\jacoco-0.7.6`
|
||||
3. Set environment variable JACOCO_DIR pointing to the directory where JaCoCo
|
||||
files are extracted - e.g. `set JACOCO_DIR=C:\jacoco-0.7.6`
|
||||
4. Set up ICU4J ant build environment.
|
||||
5. Run the ant target "coverageJaCoCo" in the top-level ICU4J build.xml
|
||||
|
||||
Following output report files will be generated in /out/jacoco directory.
|
||||
|
||||
* report.csv
|
||||
* report.xml
|
||||
* report_html.zip
|
||||
|
||||
## Building ICU4J API Reference Document with JCite
|
||||
|
||||
Since ICU4J 49M2, JCite (Java Source Code Citation System) is integrated into
|
||||
ICU4J documentation build. To build the API documentation for public release,
|
||||
you must use JCite for embedding some coding examples in the API documentation.
|
||||
To set up the environment:
|
||||
|
||||
1. <http://arrenbrecht.ch/jcite/>Download JCite binary (you need 1.13.0+ for JDK 7 support) from
|
||||
* Note that JCite no longer is available for download from the official
|
||||
web site, which links to Google Code, which was closed down in 2016.
|
||||
* The Internet Archive has a copy of the last version of JCite found on
|
||||
Google Code before it was closed down:
|
||||
[jcite-1.13.0-bin.zip](https://web.archive.org/web/20160710183051/http://jcite.googlecode.com/files/jcite-1.13.0-bin.zip)
|
||||
2. Extract JCite file to your local system - e.g. `C:\jcite-1.13.0`
|
||||
3. Set environment variable `JCITE_DIR` pointing to the directory where JCite
|
||||
files are extracted. - e.g. `set JCITE_DIR=C:\jcite-1.13.0`
|
||||
4. Set up ICU4J ant build environment.
|
||||
5. Run the ant target "docs" in the top-level ICU4J build.xml
|
||||
6. If the build (on Linux) fails because package com.sun.javadoc is not found
|
||||
then set the JAVA_HOME environment variable to point to `<path>/java/jdk`. The
|
||||
Javadoc package is in `<path>/java/jdk/lib/tools.jar`.
|
||||
|
||||
*Note: The ant target "docs" checks if `JCITE_DIR` is defined or not. If not
|
||||
defined, it will build ICU4J API docs without JCite. In this case, JCite taglet
|
||||
"{@.jcite ....}" won't be resolved and the embedded tag is left unchanged in the
|
||||
output files.*
|
||||
|
||||
## Build and test ICU4J Eclipse Plugin
|
||||
|
||||
Building Eclipse ICU4J plugin
|
||||
|
||||
1. Download and install the latest Eclipse release from
|
||||
<http://www.eclipse.org/> (The latest stable milestone is desired, but the
|
||||
latest official release should be OK).
|
||||
2. cd to `<icu4j root>` directory, and make sure `$ ant releaseVer` runs clean.
|
||||
3. cd to` <icu4j root>/eclipse-build` directory.
|
||||
4. Copy `build-local.properties.template` to `build-local.properties`, edit the
|
||||
properties files
|
||||
* eclipse.home pointing to the directory where the latest Eclipse version
|
||||
is installed (the directory contains configuration, dropins, features,
|
||||
p2 and others)
|
||||
* java.rt - see the explanation in the properties file
|
||||
5. Run the default ant target - $ ant The output ICU4J plugin jar file is
|
||||
included in `<icu4j
|
||||
root>/eclipse-build/out/projects/ICU4J.com.ibm.icu/com.ibm.icu-com.ibm.icu.zip`
|
||||
|
||||
Plugin integration test
|
||||
|
||||
1. Backup Eclipse installation (if you want to keep it - just copy the entire
|
||||
Eclipse installation folder)
|
||||
2. Delete ICU4J plugin included in Eclipse installation -
|
||||
`<eclipse>/plugins/com.ibm.icu_XX.Y.Z.vYYYYMMDD-HHMM.jar` XX.YY.Z is the ICU
|
||||
version, and YYYYMMDD-HHMM is build date. For example,
|
||||
com.ibm.icu_58.2.0.v20170418-1837.jar
|
||||
3. Copy the new ICU4J plugin jar file built by previous steps (e.g.
|
||||
com.ibm.icu_61.1.0.v20180502.jar) to the same folder.
|
||||
4. Search a text "`com.ibm.icu"` in files under `<eclipse>/features`. The RCP
|
||||
feature has a dependency on the ICU plugin and its `feature.xml` (e.g.
|
||||
`<eclipse>/features/org.eclipse.e4.rcp_1.6.2.v20171129-0543/feature.xml`)
|
||||
contains the dependent plugin information. Replace just version attribute to
|
||||
match the version built by above steps. You can leave size attributes
|
||||
unchanged. The current ICU build script does not append hour/minute in
|
||||
plugin jar file, so the version format is XX.Y.Z.vYYYYMMDD.
|
||||
` <plugin`
|
||||
` id="com.ibm.icu"`
|
||||
` download-size="11775"`
|
||||
` install-size="26242"`
|
||||
` version="58.2.0.v20170418-1837" -> "61.1.0.v20180502" `
|
||||
` unpack="false"/>`
|
||||
5. Open
|
||||
`<eclipse>/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info`
|
||||
in a text editor, and update the line including com.ibm.icu plugin
|
||||
information.
|
||||
```
|
||||
com.ibm.icu,58.2.0.v20170418-1837,plugins/com.ibm.icu_58.2.0.v20170418-1837.jar,4,false
|
||||
```
|
||||
then becomes ->
|
||||
```
|
||||
com.ibm.icu,**61.1.0.v20190502**,plugins/com.ibm.icu_**61.1.0.v20190502**.jar,4,false
|
||||
```
|
||||
6. Make sure Eclipse can successfully starts with no errors. If ICU4J plug-in
|
||||
is not successfully loaded, Eclipse IDE won't start.
|
||||
|
||||
ICU4J plugin test - Note: This is currently broken
|
||||
<http://bugs.icu-project.org/trac/ticket/13072>
|
||||
|
||||
1. Start the Eclipse (with new ICU4J plugin), and create a new workspace.
|
||||
2. Import existing Eclipse project from `<icu4jroot>/eclipse-build/out/projects/com.ibm.icu.tests`
|
||||
3. Run the project as JUnit Plug-in Test.
|
||||
|
||||
## Building ICU4J Release Files
|
||||
|
||||
See [Release Build](../../../processes/release/tasks/release-build.md)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,290 @@
|
||||
---
|
||||
layout: default
|
||||
title: Eclipse Setup for Java Developers
|
||||
grand_parent: Setup for Contributors
|
||||
parent: Java Setup
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Eclipse Setup for Java Developers Using Ant
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
ICU4J source layout was changed after 4.2. There are several ways to set up the ICU4J development environment.
|
||||
|
||||
*If you want to use Eclipse, you should create a new clean workspace first.*
|
||||
|
||||
## Java Language Level
|
||||
|
||||
Eclipse typically requires a newer Java version than what we can depend on for
|
||||
ICU4J. If you don't do the following, you run the risk of calling Java library
|
||||
APIs that are newer than ICU4J's Java version, and you cause runtime exceptions
|
||||
for people who use the older version.
|
||||
|
||||
Currently (as of 2023-sep / ICU 73), ICU4J is on Java 8 (and Eclipse 4.28/2023-06
|
||||
requires Java 17).
|
||||
|
||||
(Note: localespi/localespi-tests may use a different Java version from ICU4J
|
||||
proper.)
|
||||
|
||||
1. Check if you already have an older JRE or a JDK for the minimum version
|
||||
required for ICU4J.
|
||||
* A JRE (runtime environment, no compiler) is sufficient.
|
||||
* If you don't have one yet, then install one (OpenJDK or Oracle).
|
||||
2. Select \[Window\] - \[Preferences\] *(On Mac, this is \[Eclipse -
|
||||
Preferences\])*
|
||||
3. Navigate the preferences tree to Java/Installed JREs/Execution Environments
|
||||
4. On the left, Execution Enviornments: Select J2SE-1.8
|
||||
5. On the right, Compatible JREs, if there is no old-version Java 8 JRE:
|
||||
1. Go up one tree level to Java/Installed JREs.
|
||||
2. Click "Add..." and select "Standard VM" as JRE type.
|
||||
3. Click "Directory..." and find the location of your old-version JRE (or
|
||||
JDK) on your system
|
||||
* Linux tip: When you install an OpenJDK, look for it in /usr/lib/jvm/
|
||||
4. You can leave the detected settings as is - Click "Finish", then Click
|
||||
"OK" in Installed JREs (or "Apply" the modified settings as you navigate
|
||||
away from here).
|
||||
5. Go back down in the tree to Java/Installed JREs/Execution Environments.
|
||||
6. On the right, Compatible JREs, you should now see your old-version JRE
|
||||
6. The matching-old-version JRE should have a "\[perfect match\]" suffix.
|
||||
Select it for "JavaSE-1.8" on the left.
|
||||
|
||||
## Other Settings
|
||||
|
||||
1. ~~Turn on warnings about resource leaks. Preferences>Java>Compiler>Errors/Warnings>\[filter on leak\], set both "Resource leak" and "Potential resource leak" to "Warning".~~
|
||||
(ICU project files were updated to include these settings, so this has no
|
||||
effects 2015-03-11)
|
||||
|
||||
## Import ICU4J from the file system
|
||||
|
||||
(Recommended)
|
||||
|
||||
In <icu workspace root>/icu4j remember to run "ant init" first. You might run
|
||||
"ant check" as well for good measure.
|
||||
|
||||
If you check out ICU4J source from the repository using an external client
|
||||
(usually command-line git clone), the new instruction is not much different. You
|
||||
just follow the steps below -
|
||||
|
||||
1. File/Import...
|
||||
2. Select General/Existing Projects into Workspace
|
||||
3. Select root directory: Browse to <icu svn workspace root>/icu4j, which will
|
||||
show a number of projects.
|
||||
4. Deselect the following projects (i.e., do not import them). These are not
|
||||
needed for normal ICU development (and would require installing further
|
||||
prerequisite libraries to get them to build).
|
||||
* com.ibm.\* (Eclipse plug-in)
|
||||
* icu4j-localespi\* (more plug-in)
|
||||
* icu4j-build-tools
|
||||
* icu4j-packaging-tests
|
||||
5. Click Finish.
|
||||
6. Wait for Eclipse to build the projects.
|
||||
|
||||
## Obsolete: Import ICU4J using the [Subversive](http://www.eclipse.org/subversive/) SVN plugin
|
||||
|
||||
Subversive is the standard SVN plugin for Eclipse 3.4+. If you have
|
||||
[subversive](http://www.eclipse.org/subversive/) installed/configured on your
|
||||
Eclipse environment, you can directly check out these 8 projects from the SVN
|
||||
repository directory. (It looks this does not work well with
|
||||
"[subclipse](http://www.eclipse.org/subversive/)")
|
||||
|
||||
#### Installing Subversive (Eclipse 3.6 or later)
|
||||
|
||||
1. Select \[Help\] - \[Install New Software...\] from menu
|
||||
2. Select the appropriate Eclipse update site in "Work with:" field - for
|
||||
example, select "Indigo - http://download.eclipse.org/releases/indigo" for
|
||||
Eclipse 3.7.x and hit enter key.
|
||||
3. Expand "Collaboration" and check "Subversive SVN Team Provider
|
||||
(Incubation)", then click "Next >". Confirm the item selected in the next
|
||||
screen, then click "Next >" again, then accept license terms in the next
|
||||
screen and click "Finish". After the installation, click "Restart Now" to
|
||||
restart Eclipse.
|
||||
4. Select \[Window\] - \[Preferences\] to open Preferences. Expand Team on the
|
||||
left pane and click SVN. It will open "Subversive Connector Discovery".
|
||||
Select one from the list. **Note: Some people (including myself) are
|
||||
experiencing a problem with SVNKit 1.3.5. If you want to use SVNKit, use
|
||||
1.3.3 instead (2011-10-24 yoshito)** Restart Eclipse.
|
||||
|
||||
### Installing Subversive (Old)
|
||||
|
||||
1. Goto <http://www.eclipse.org/subversive/downloads.php>
|
||||
2. Goto "latest release" on that page
|
||||
3. Copy the update site, eg
|
||||
"<http://download.eclipse.org/technology/subversive/0.7/update-site/> "
|
||||
4. Go to Eclipse, then Help > Install New Software...
|
||||
5. Into "Work with...", paste the update site.
|
||||
6. Set the checkbox on Plug-ins. Hit Next and Finish until you are done.
|
||||
Restart Eclipse.
|
||||
7. Start Eclipse. It will ask for the connectors. Select all the SVN kits and
|
||||
install. Restart Eclipse.
|
||||
|
||||
### Importing ICU4J
|
||||
|
||||
1. File - Import
|
||||
2. Select "Project from SVN" under "SVN", Next
|
||||
3. In the General Tab, set URL to:
|
||||
svn+ssh://source.icu-project.org/repos/icu/icu4j, and set your User name:
|
||||
XXXXXX
|
||||
4. In the SSH Settings, fill-in proper authentication information. (port 922,
|
||||
your ssh key (eg icu-project-key) and passphrase..)
|
||||
5. If the connection is properly established, it opens next dialog "Select
|
||||
Resource". Set URL to be:
|
||||
svn+ssh://source.icu-project.org/repos/icu/icu4j/trunk/main - then click
|
||||
Finish
|
||||
6. The next dialog "Check Out As" should have 4 options indicating how to check
|
||||
out. Select the second option "Find projects in the children of the selected
|
||||
resource" - click Finish
|
||||
7. It takes a while to locate projects. The next dialog shows a batch of
|
||||
projects -
|
||||
1. You may want to deselect localespi and localespi-tests.
|
||||
2. Click Finish (that means, "Check out as a projects into workspace" is
|
||||
selected)
|
||||
8. After these projects are imported into the workspace, open Java perspective.
|
||||
You might notice there are modification marker (">") displayed for the
|
||||
projects. This is caused by build output directory created in each project's
|
||||
workspace. To resolve this issue, you can go to Window - Preferences, then
|
||||
select Team - Ignore Resources, then Add Pattern "out" (which is build
|
||||
output directory used by these projects). You may need to restart Eclipse
|
||||
after adding the new pattern.
|
||||
|
||||
**Note:** With the instruction above, you may see Eclipse errors when you open
|
||||
ant build.xml in each project, such as "Target @build-all does not exist in this
|
||||
project". This is because the import operation above flatten the original SVN
|
||||
directory structure and files referenced via ${share.dir} does not work well. To
|
||||
resolve the issue, you need to override the property by importing
|
||||
locations-eclipse.properties globally. See the following steps to configure the
|
||||
override.
|
||||
|
||||
1. From Eclipse menu, select \[Window\] - \[Preferences\]
|
||||
2. Select "Ant" - "Runtime" on the left in the Preferences dialog
|
||||
3. Open "Properties" tab
|
||||
4. Under "Global property files", click "Add Files..."
|
||||
5. Select icu4j-shared project in the list, then select
|
||||
build/locations-eclipse.properties
|
||||
6. Click OK - OK, to save the configuration.
|
||||
|
||||
## Another method using Eclipse SVN plugin (Subversive and Subclipse)
|
||||
|
||||
1. File - New - Other... then, select "Repository Location" under "SVN"
|
||||
1. General Tab
|
||||
1. URL - svn+ssh://source.icu-project.org/repos/icu/icu4j
|
||||
2. User name: <yourname>
|
||||
3. Password: <leave empty>
|
||||
2. SSH Settings
|
||||
1. Port: 922
|
||||
2. Private key: <browse to your ssh private key>
|
||||
3. Passphrase: <your passphrase>
|
||||
3. Finish
|
||||
2. Open SVN Repositories perspective (Window>Open Perspective>SVN Repository
|
||||
Exploring) and expand the repository location you added above.
|
||||
3. Navigate to trunk
|
||||
4. Right click and select "Check Out" - this may take a few minutes.
|
||||
5. File - Import and select "Existing Projects into Workspace" under "General"
|
||||
6. Select root directory - navigate to "main" directory under your workspace
|
||||
location where the source files were checked out (for example,
|
||||
C:\\eclipse_ws\\icu4j\\trunk\\main)
|
||||
7. You should see 10 projects including icu4j-charset, icu4j-charset-tests,
|
||||
icu4j-core.... (number of projects might be changed in future)
|
||||
1. All of them should be selected
|
||||
2. **Important**: unclick "copy projects into Workspace"
|
||||
3. Click Finish to import all
|
||||
8. Back in the Java perspective, you should see the new projects.
|
||||
9. For this time, projects are associated with SVN workspace. If you see the
|
||||
modification marker (">") displayed for the projects, configure your
|
||||
workspace to ignore pattern "out" (See step 7 in b-2 above).
|
||||
10. From the command line, run "ant init" in the top level "main" (for example,
|
||||
C:\\eclipse_ws\\icu4j\\trunk\\main)
|
||||
|
||||
## Testing & Debugging
|
||||
|
||||
### Run All Tests
|
||||
|
||||
To run all of the main tests, do the following:
|
||||
|
||||
**58 or later**
|
||||
|
||||
* "ant check" from the command line?
|
||||
|
||||
**53-57**
|
||||
|
||||
* Select icu4j-testall project in package explorer
|
||||
* Right Click > Run As > Java Application
|
||||
|
||||
**52 or before**
|
||||
|
||||
* In icu4j-test-testframework, open com.ibm.icu.dev.test.TestAll
|
||||
* RightClick>Run As>Java Application...
|
||||
* It will fail, but create a Run Configuration
|
||||
* RightClick>Run Configuration...
|
||||
* Change the name to "TestAll - ICU4J"
|
||||
* Click on Arguments, and set to "-n -t"
|
||||
* Click on Classpath>User Entries>Add Projects...
|
||||
* Select all of your ICU projects but **except icu4j-localespi and
|
||||
icu4j-localespi-test**, and Add, eg:
|
||||
* icu4j-charset
|
||||
* icu4j-charset-tests
|
||||
* ...
|
||||
* Now Run.
|
||||
|
||||
### Run specific tests
|
||||
|
||||
#### 58 or later
|
||||
|
||||
* Right click on a test package (for example `com.ibm.icu.dev.test.rbbi` in
|
||||
the **icu4j-core-tests** project), or an entire test source directory (such
|
||||
as src in the **icu4j-core-tests** project) and choose **Run As->JUnit
|
||||
Test**
|
||||
* For test coverage, install EclEmma (below) and use **Coverage As** instead
|
||||
of **Run As**.
|
||||
|
||||
### Test in Eclipse with ICU4J from jar files
|
||||
|
||||
You can manually create an Eclipse Run Configuration that doesn't include any of
|
||||
the directories but all of the JAR files:
|
||||
<http://stackoverflow.com/questions/1732259/eclipse-how-to-debug-a-java-program-as-a-jar-file>
|
||||
|
||||
### Test Coverage (53 or later)
|
||||
|
||||
* Install EclEmma plug-in. The installation instruction is found in [the
|
||||
EclEmma site page](http://www.eclemma.org/installation.html).
|
||||
* Run all tests once as described in the above section once.
|
||||
* For the menu, select "Run" > "Coverage..." to open "Coverage Configurations"
|
||||
window.
|
||||
* Go to "Coverage" tab and uncheck all test projects (icu4j-\*-tests,
|
||||
icu4j-test-framework, icu4j-testall) to exclude test codes from coverage
|
||||
analysis.
|
||||
* Click "Coverage" to run the all tests with coverage analysis enabled. After
|
||||
the text execution, coverage report displayed in "Coverage" view.
|
||||
* After running coverage, source lines are highlighted in different colors
|
||||
depending on coverage level. Too remove the highlights, click "Remove All
|
||||
Sessions" icon below (which also delete the coverage results).
|
||||
|
||||

|
||||
|
||||
* If you want to run coverage again, you can just right click on icu4j-testall
|
||||
project and select "Coverage As" > "Java Application"
|
||||
|
||||
## Branching
|
||||
|
||||
* // Needs review
|
||||
|
||||
To Create the Branch
|
||||
|
||||
* Modify
|
||||
* To merge, use Team>Merge. Pick Start from Copy.
|
||||
|
||||
To Merge a Branch
|
||||
|
||||
* ...
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
layout: default
|
||||
title: Java Setup
|
||||
parent: Setup for Contributors
|
||||
has_children: true
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Java Setup
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
layout: default
|
||||
title: Java Profiling and Monitoring tools
|
||||
grand_parent: Setup for Contributors
|
||||
parent: Java Setup
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Java Profiling and Monitoring tools
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
There are many Java development tools available for analyzing Java application
|
||||
run time performance. Eclipse has a set of plug-ins called TPTP which provides
|
||||
Java application profiling/monitoring framework. However, TPTP is very slow and
|
||||
I experienced frequent crash while profiling ICU4J codes. For ICU4J development,
|
||||
I recommend several tools described below.
|
||||
|
||||
## VisualVM
|
||||
|
||||
VisualVM is available as a separate download since JDK 9. You can download the latest
|
||||
version from here - <https://visualvm.github.io/download.html>
|
||||
There is an Eclipse plug-in, which allow you to launch VisualVM when you run a
|
||||
Java app on Eclipse. You can monitor CPU usage of the Java app, Memory usage
|
||||
(heap/permgen), classes loaded, etc in GUI. You can also get basic profiling
|
||||
information, such as CPU usage by class, memory allocations and generate heap
|
||||
dump, force GC etc.
|
||||
@@ -0,0 +1,267 @@
|
||||
---
|
||||
layout: default
|
||||
title: Maven Setup for Java
|
||||
grand_parent: Setup for Contributors
|
||||
parent: Java Setup
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Maven Setup for Java
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
Maven is a standard build tool in the Java ecosystem with a very well-defined
|
||||
preferred way to organize the directory structure and execute builds.
|
||||
Thus, many IDEs for Java will have some level of support for Maven.
|
||||
The command line invocation is still, of course, the standard of truth for the build.
|
||||
|
||||
## Installation
|
||||
|
||||
Install Maven from your OS package manager.
|
||||
The minimum version is 3.2.5 as of ICU 74,
|
||||
although this may change.
|
||||
See the `<ICU>/icu4j/pom.xml` root POM file's maven-enforcer-plugin
|
||||
for the current minimum version.
|
||||
The Maven page lists [system requirements](https://maven.apache.org/download.cgi),
|
||||
which includes a minimum of JDK 8 as of ICU 74.
|
||||
|
||||
## Maven multi-module projects
|
||||
|
||||
ICU4J's codebase is structured as a "multi-module" Maven project.
|
||||
In other words, the Maven project is divided into submodules that have dependencies on each other.
|
||||
Multi-module projects are not uncommon in Maven over the several years,
|
||||
yet the support for them by Maven is not complete.
|
||||
|
||||
Commonly-found instructions to use Maven at the command line
|
||||
are usually designed for simple "single-module" Maven projects.
|
||||
In such cases, the command names correspond intuitively to their function:
|
||||
`mvn test` for running unit tests, `mvn package` for creating jar files, etc.
|
||||
However, multi-module projects have the tradeoff between time and complexity:
|
||||
running `mvn test` at the root recompiles all the sources
|
||||
even if a module's sources are all unchanged,
|
||||
which takes longer than it otherwise could.
|
||||
The alternative is to always instruct Maven to compile and locally cache the artifact
|
||||
for each submodule,
|
||||
which speeds up tasks by avoiding duplicate compilation and testing effort,
|
||||
but also changes the distinct Maven commands
|
||||
`mvn {test, integration-test, ...}`
|
||||
all into
|
||||
`mvn install`
|
||||
that are instead differentiated by appropriate options.
|
||||
|
||||
The instructions in this page for command line usage will choose,
|
||||
from the 2 alternatives above,
|
||||
the option that consistently uses `mvn install` for all Maven tasks.
|
||||
Note that this choice should not affect IDEs with well working native Maven support like IntelliJ and Eclipse.
|
||||
See the "IDE Setup" section for more details on how IDEs handle Maven projects differently than
|
||||
the standard command line style usage of Maven.
|
||||
|
||||
## IDE Setup
|
||||
|
||||
Users of IDEs should familiarize themselves with the information about how to use Maven at
|
||||
the command line,
|
||||
which also includes information about Maven builds.
|
||||
|
||||
> :point_right: **Note**: In most IDEs, whenever the Maven configurations change (`pom.xml` files),
|
||||
you will need to refresh your IDE project using the IDE's Maven plugin/functionality.
|
||||
|
||||
Most IDEs represent user settings for different codebases via an IDE-specific notion
|
||||
usually called "project" or "workspace".
|
||||
The IDE's project/workspace is a separate construct from the Maven configurations for the codebase.
|
||||
Therefore, creating a new project for an existing codebase is done by "importing" the codebase,
|
||||
in which the IDE creates the project/workspace settings files.
|
||||
If you pull updates to the upstream ICU codebase codebase that result in changes to Maven settings,
|
||||
then the IDE behavior may be behind until you update your IDE project accordingly.
|
||||
|
||||
|
||||
### IntelliJ
|
||||
|
||||
IntelliJ does a good job of understanding multi-module Maven projects,
|
||||
including the non-standard configuration here.
|
||||
It also recognizes the customized locations of source code files and test code files in the configuration here.
|
||||
|
||||
To import into IntelliJ:
|
||||
|
||||
1. In IntelliJ, open a new project.
|
||||
a. Recent versions of IntelliJ provide a dialog box on startup to select a project. Click the "Open" button.)
|
||||
2. Select the root `pom.xml` in ICU4J (ex: `<ICU>/icu4j/pom.xml`)
|
||||
3. That's it. Note: IntelliJ will take a few minutes to do a one-time indexing of the new source code.
|
||||
|
||||
Navigating the source code files between main code and test code, and running tests individually or for an entire module,
|
||||
work as they do normally in IntelliJ.
|
||||
|
||||
> :point_right: **Note**: Currently, Maven cannot build the entire project due to settings for `tools/utilities-for-cldr`. To work around this so that `Build > Build Project` works: in the "Project" toolbar, navigate to the `tools/utilities-for-cldr` folder, right click for the contextual menu, then `Maven > Ignore Projects`.
|
||||
>
|
||||
> When this workaround is no longer needed, the project can be reenabled by: `View > Tool Windows > Maven`, then expand "International Components for Unicode (ICU)", right click on `utilities-for-cldr`, then select `Unignore Projects`.
|
||||
|
||||
### Eclipse
|
||||
|
||||
[Eclipse's Maven plugin](https://eclipse.dev/m2e/)
|
||||
works reasonably well and can support the import of a multi-module Maven project.
|
||||
These instructions have not yet verified Eclipse's handling of the import of the ICU4J using a Maven build.
|
||||
|
||||
### VS Code
|
||||
|
||||
VS Code's support of Maven projects is not as robust as IntelliJ's when it comes to the non-standard file layout for sources and tests.
|
||||
The Maven support comes from the standard Java extension (which depends on the standard Maven extension) from the extension marketplace.
|
||||
Source and test code files are not recognized properly, and it is not clear how to execute the tests.
|
||||
|
||||
However, a workaround exists for those who want to use VS Code as their preferred editor and still execute commands to recompile or run tests.
|
||||
The workaround relies on invoking the Maven commands in a shell, and using a VS Code extension to create shortcuts within the IDE to invoke those commands.
|
||||
|
||||
The extension is [Command Runner](https://marketplace.visualstudio.com/items?itemName=edonet.vscode-command-runner).
|
||||
Next, create a VS Code workspace (File > Open Folder...) at the ICU4J root at `<ICU>/icu4j`.
|
||||
Then edit your settings for your VS Code workspace for ICU4J (this is the file at `<ICU>/icu4j/.vscode/settings.json`)
|
||||
by adding this section to the settings:
|
||||
|
||||
```jsonnet
|
||||
{
|
||||
//...
|
||||
"command-runner.commands": {
|
||||
// The following commands assume your VS Code workspace is rooted at `<ICU_ROOT>/icu4j`. If not,
|
||||
// then adjust accordingly.
|
||||
"core > all > test": "cd ${workspaceFolder}; mvn -am -pl main/core install",
|
||||
"core > number > test": "cd ${workspaceFolder}; mvn -am -pl main/core test -Dtest=\"com/ibm/icu/dev/test/number/*,com/ibm/icu/dev/impl/number/*\" -Dsurefire.failIfNoSpecifiedTests=false",
|
||||
"core > text > test": "cd ${workspaceFolder}; mvn -am -pl main/core test -Dtest=\"com.ibm.icu.dev.test.text.*\" -Dsurefire.failIfNoSpecifiedTests=false",
|
||||
"charset > test": "cd ${workspaceFolder}; mvn -am -pl main/charset test",
|
||||
"common_tests > integration test": "cd ${workspaceFolder}; mvn -am -pl main/localespi test",
|
||||
}
|
||||
//...
|
||||
}
|
||||
```
|
||||
|
||||
As the extension's documentation describes, there are multiple ways to open up the palette of command shortcuts.
|
||||
One way is to hit Ctrl/Cmd+Shift+P, then type "Run Command", then hit enter.
|
||||
Another way is to right-click the background of any editor pane.
|
||||
|
||||
After the palette appears, you can choose which Maven build target to execute.
|
||||
|
||||
## Usage at the command line
|
||||
|
||||
Maven divides its concept of a build into a "lifecycle" of a linear sequence of steps, called "phases".
|
||||
These phases correspond to common good practice tasks of a project, and they have a predefined order.
|
||||
Each phase can only begin if all of the previous phases have finished successfully.
|
||||
The sequence of phases include ... `compile` ... `test` ... `package` ... `integration-test` ... `verify` ... `install` ... `deploy`.
|
||||
|
||||
In a simple Maven project, the phases also serve as default build targets.
|
||||
However, as mentioned above,
|
||||
ICU4J is structured as a multi-module Maven project.
|
||||
The instructions here for command line Maven usage will take the approach of using the `install` target
|
||||
for all tasks.
|
||||
Options can be used to control whether tests are executed, and which ones.
|
||||
|
||||
### Testing
|
||||
|
||||
To only execute a command within a submodule of the project, from the root, use the `-am -pl <projectlist>` syntax like this:
|
||||
|
||||
```
|
||||
mvn install -am -pl main/core
|
||||
```
|
||||
|
||||
where `<projectlist>` is a comma-separated list of names of the subfolders which contain the submodule configuration pom.xml files.
|
||||
|
||||
If you want to run only a specific test(s), use the `-Dtest="<test>"` option, where `<test>` can be a test name, a class name / package prefix, or a comma-separate list of them.
|
||||
|
||||
|
||||
#### Run unit tests
|
||||
|
||||
The `test` target will only run unit tests (excludes integration tests). Ex:
|
||||
|
||||
```
|
||||
mvn install -am -pl main/core -DskipITs
|
||||
```
|
||||
|
||||
#### Run all tests (integration and unit tests)
|
||||
|
||||
All tests (unit tests and integration tests) will run by default.
|
||||
|
||||
```
|
||||
mvn install -am -pl main/core
|
||||
```
|
||||
|
||||
#### Run a single test
|
||||
```
|
||||
mvn install -Dtest="ULocaleTest" -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
|
||||
```
|
||||
or
|
||||
```
|
||||
mvn install -Dtest="com.ibm.icu.dev.test.util.ULocaleTest" -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
|
||||
```
|
||||
|
||||
#### Run a single method in a single test
|
||||
|
||||
```
|
||||
mvn install -Dtest="ULocaleTest#TestGetAvailableByType" -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
|
||||
```
|
||||
|
||||
#### Run multiple tests
|
||||
You can use regular expression patterns and comma-separate lists,
|
||||
such as:
|
||||
|
||||
```
|
||||
mvn install -Dtest="RBBI*" -Dsurefire.failIfNoSpecifiedTests=false
|
||||
mvn install -Dtest="*Locale*" -Dsurefire.failIfNoSpecifiedTests=false
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
mvn install -Dtest="*Locale*,RBBI*" -Dsurefire.failIfNoSpecifiedTests=false
|
||||
```
|
||||
|
||||
If you want to run tests according to the package structure of the classes,
|
||||
then you should use the filesystem notation for the test files in the regular expression expansion.
|
||||
Therefore, this syntax will not work:
|
||||
`mvn install -Dtest="com.ibm.icu.dev.test.util.*" -Dsurefire.failIfNoSpecifiedTests=false`.
|
||||
Instead, you want to use this syntax:
|
||||
```
|
||||
mvn install -Dtest="com/ibm/icu/dev/test/util/*" -Dsurefire.failIfNoSpecifiedTests=false
|
||||
```
|
||||
|
||||
#### Run in exhaustive mode
|
||||
|
||||
Some tests in ICU are configured to run only when "exhaustive mode" is enabled.
|
||||
Exhaustive mode enables long running tests that would otherwise not run,
|
||||
or would run far fewer iterations.
|
||||
Exhaustive mode is configured through the system property `ICU.exhaustive`.
|
||||
`ICU.exhaustive` takes an integer value from 0 to 10 such that,
|
||||
when greater than 5,
|
||||
will trigger some tests to run in exhaustive mode.
|
||||
See `TestFmwk.java` for more details,
|
||||
and `ExhaustiveNumberTest.java` for an example of a test using it.
|
||||
|
||||
```
|
||||
mvn install -DICU.exhaustive=10
|
||||
```
|
||||
|
||||
#### Skip tests
|
||||
|
||||
If you want to skip tests, add the options:
|
||||
|
||||
```
|
||||
-DskipTests -DskipITs
|
||||
```
|
||||
|
||||
The first option specifies skipping unit tests,
|
||||
and the second option specifies skipping integration tests.
|
||||
|
||||
|
||||
## More info on Maven
|
||||
|
||||
To learn more about the details of Maven not covered above,
|
||||
start by reading the [*Maven by Example* book](https://books.sonatype.com/mvnex-book/reference/index.html),
|
||||
which gives an overview of Maven.
|
||||
For more details on a specific topic,
|
||||
refer to the [*Maven: Complete Reference* book](https://books.sonatype.com/mvnref-book/reference/index.html).
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
layout: default
|
||||
title: Local tooling configs for git and Github
|
||||
grand_parent: Setup for Contributors
|
||||
parent: Source Code Setup
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Local tooling configs for git and Github
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
## git difftool & mergetool
|
||||
|
||||
The `git diff` command prints changes to stdout, normally to the terminal
|
||||
screen.
|
||||
|
||||
Set up a visual diff and merge program for use with `git difftool` and `git
|
||||
mergetool`.
|
||||
|
||||
Changes in binary files do not show well in common diff tools and can take a
|
||||
long time for them to compute visual diffs.
|
||||
|
||||
This is easily avoided using the -d option: `git difftool -d`
|
||||
|
||||
This shows all changed files in the diff program, and you can view and skip
|
||||
files there as appropriate.
|
||||
|
||||
### Linux example
|
||||
|
||||
[stackoverflow/.../setting-up-and-using-meld-as-your-git-difftool-and-mergetool](https://stackoverflow.com/questions/34119866/setting-up-and-using-meld-as-your-git-difftool-and-mergetool)
|
||||
|
||||
#### Linux meld
|
||||
|
||||
`gedit ~/.gitconfig` →
|
||||
|
||||
```
|
||||
[diff]
|
||||
tool = meld
|
||||
[difftool]
|
||||
prompt = false
|
||||
[difftool "meld"]
|
||||
cmd = meld "$LOCAL" "$REMOTE"
|
||||
[merge]
|
||||
tool = meld
|
||||
[mergetool "meld"]
|
||||
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
|
||||
```
|
||||
|
||||
## Auto-link from GitHub to Jira tickets
|
||||
|
||||
GitHub itself does not linkify text like "ICU-23456" to point to the Jira
|
||||
ticket. You can get links via browser extensions.
|
||||
|
||||
### Chrome Jira HotLinker
|
||||
|
||||
Install the [Jira
|
||||
HotLinker](https://chrome.google.com/webstore/detail/jira-hotlinker/lbifpcpomdegljfpfhgfcjdabbeallhk)
|
||||
from the Chrome Web Store.
|
||||
|
||||
Configuration Options:
|
||||
|
||||
* Jira instance url: https://unicode-org.atlassian.net/
|
||||
* Locations: https://github.com/
|
||||
|
||||
### Safari extension from SRL
|
||||
|
||||
<https://github.com/unicode-org/icu-jira-safari>
|
||||
|
||||
### Firefox extension from JefGen
|
||||
|
||||
Install from the Mozilla Firefox Add-ons site:
|
||||
<https://addons.mozilla.org/en-US/firefox/addon/github-jira-issue-linkifier/>
|
||||
|
||||
Source:
|
||||
<https://github.com/jefgen/github-jira-linkifier-webextension>
|
||||
@@ -0,0 +1,161 @@
|
||||
---
|
||||
layout: default
|
||||
title: Source Code Setup
|
||||
parent: Setup for Contributors
|
||||
has_children: true
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Source Code Setup
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
> Announcement 07/16/2018: The ICU source code repository has been migrated from
|
||||
> Subversion to Git, and is now hosted on GitHub.
|
||||
|
||||
## Quick Start
|
||||
|
||||
You can view ICU source code online: <https://github.com/unicode-org/icu>
|
||||
|
||||
***Make sure you have git lfs installed.*** See the following section.
|
||||
|
||||
For read-only usage, create a local clone:
|
||||
|
||||
```
|
||||
git clone https://github.com/unicode-org/icu.git
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
git clone git@github.com:unicode-org/icu.git
|
||||
```
|
||||
|
||||
This will check out a new directory `icu` which contains **icu4c** and
|
||||
**icu4j** subdirectories as detailed below.
|
||||
|
||||
*For ICU development*, do *not* work directly with the Unicode ICU `main` branch!
|
||||
See the [git for ICU Developers](../../userguide/dev/gitdev) page instead.
|
||||
|
||||
For cloning from your own fork, replace `unicode-org` with your GitHub user
|
||||
name.
|
||||
|
||||
**For fetching just the files for an ICU release tag**, you can use a shallow
|
||||
clone:
|
||||
|
||||
```
|
||||
git clone https://github.com/unicode-org/icu.git --depth=1 --branch=release-63-1
|
||||
```
|
||||
|
||||
If you already have a clone of the ICU repository, you can add and extract
|
||||
release files like this:
|
||||
|
||||
```
|
||||
mkdir /tmp/extracted-icu # or wherever you want to extract to
|
||||
cd local-git-repo-top-level-dir
|
||||
git fetch upstream
|
||||
git tag --list "*63*" # List tags relevant to ICU 63, e.g., release-63-1
|
||||
git archive release-63-1 | tar -x -C /tmp/extracted-icu
|
||||
```
|
||||
|
||||
## Detailed Instructions
|
||||
|
||||
### Prerequisites: Git and Git LFS
|
||||
|
||||
(Note: you do not need a [GitHub](http://github.com) *account* to download the
|
||||
ICU source code. However, you might want such an account to be able to
|
||||
contribute to ICU.)
|
||||
|
||||
* Install a **git client**
|
||||
* <https://git-scm.com/downloads>
|
||||
* Linux: `sudo apt install git`
|
||||
* Install **git-lfs** if your git client does not already have LFS support
|
||||
(ICU uses git Large File Storage to store large binary content such as
|
||||
\*.jar files.)
|
||||
* <https://git-lfs.github.com/>
|
||||
* See also
|
||||
<https://help.github.com/articles/installing-git-large-file-storage/>
|
||||
* Linux: `sudo apt install git-lfs`
|
||||
* MacOS: Consider using Homebrew or MacPorts.
|
||||
* The command `git lfs version` will indicate if LFS is installed.
|
||||
* Setup git LFS for your local user account once on each machine:
|
||||
* `git lfs install --skip-repo`
|
||||
|
||||
### Working with git
|
||||
|
||||
There are many resources available to help you work with git, here are a few:
|
||||
|
||||
* <https://git-scm.com/> - the homepage of the git project
|
||||
* <https://help.github.com/> - GitHub’s help page
|
||||
* <https://try.github.io/> - Resources to learn Git
|
||||
|
||||
Want to contribute back to ICU? See
|
||||
[How to contribute](../../userguide/processes/contribute.md).
|
||||
|
||||
## Repository Layout
|
||||
|
||||
The top level
|
||||
[README.md](https://github.com/unicode-org/icu#international-components-for-unicode)
|
||||
contains the latest information about the repository’s layout. Currently:
|
||||
|
||||
* **icu4c**/ ICU for C/C++
|
||||
* **icu4j**/ ICU for Java
|
||||
* **tools**/ Tools
|
||||
* **vendor**/ Vendor dependencies (copied here for reference)
|
||||
|
||||
### Tags and Branches
|
||||
|
||||
The repository is **tagged** with different release versions of ICU.
|
||||
|
||||
For example,
|
||||
[release-55-1](https://github.com/unicode-org/icu/tree/release-55-1) is the tag
|
||||
which corresponds to version 55.1 of ICU (for both C and J).
|
||||
|
||||
Branches in the main fork are used for maintenance branches of ICU.
|
||||
|
||||
For example,
|
||||
[maint/maint-61](https://github.com/unicode-org/icu/tree/maint/maint-61) is a
|
||||
branch containing the latest maintenance work on the 61.x line of ICU.
|
||||
|
||||
There are other tags and branches which may be cleaned up/deleted at any time.
|
||||
|
||||
* branches/tags/releases from [before the icu4c and icu4j trees were
|
||||
merged](https://unicode-org.atlassian.net/browse/ICU-12800) - items prefixed
|
||||
with "icu-" are for icu4c, and "icu4j-" for icu4j, etc.
|
||||
* old personal work branches (with a person's username, such as **andy/6910**)
|
||||
* long running shared feature branches (In general, feature work is done on
|
||||
personal forks of the repository.)
|
||||
|
||||
See also the [Tips (for developers)](repository/tips/index.md) subpage.
|
||||
|
||||
## A Bit of History
|
||||
|
||||
ICU was first open sourced in 1999 using CVS and Jitterbug. The source files
|
||||
were imported from other source control systems internal to IBM at that time.
|
||||
|
||||
The ICU project moved to using a Subversion source code repository and a Trac
|
||||
bug database on Nov 30, 2006. These replace our original CVS source code
|
||||
repository and Jitterbug bug data base. All history from the older systems has
|
||||
been migrated into the new, so there should normally be no need to refer back to
|
||||
Jitterbug or CVS.
|
||||
|
||||
In July 2018, the ICU project [moved
|
||||
again](http://blog.unicode.org/2018/07/icu-moves-to-github-and-jira.html), this
|
||||
time from svn to git on GitHub, and from trac to Atlassian Cloud Jira. Many
|
||||
tools and much effort was involved in migration and testing. There is a
|
||||
[detailed blog post](https://srl295.github.io/2018/07/02/icu-infra/) on the
|
||||
topic (not an official ICU-TC document!) for those interested in the technical
|
||||
details of this move.
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<!--- © 2020 and later: Unicode, Inc. and others. --->
|
||||
<!--- License & terms of use: http://www.unicode.org/copyright.html --->
|
||||
|
||||
# Configuring VS Code for ICU4C
|
||||
|
||||
- Create a `.vscode` folder in icu4c/source
|
||||
- Copy the `tasks.json`, `launch.json` and `c_cpp_properties.json` files into
|
||||
the `.vscode` folder.
|
||||
- To test only specific test targets, specify them under `args` in
|
||||
`launch.json`.
|
||||
- To adjust the parallelism when building, adjust the `args` in `tasks.json`.
|
||||
- `-l20` tells VSCode to not launch jobs if the system load average is above
|
||||
20 (note that the [system load
|
||||
average](https://en.wikipedia.org/wiki/Load_(computing)) is *not* a CPU
|
||||
usage percentage).
|
||||
- `-j24` limits the number of jobs launched in parallel to 24. The system
|
||||
load average takes a while to respond, reducing this number helps the
|
||||
initial bad system performance when a new build is launched.
|
||||
|
||||
NOTE:
|
||||
Run the
|
||||
[`./runConfigureICU` command](https://unicode-org.github.io/icu/userguide/icufaq)
|
||||
before building `icu4c` from VSCode.
|
||||
@@ -21,6 +21,14 @@ includes details that go beyond the C, C++, and Java API docs (and avoids some d
|
||||
|
||||
This is the new home of the User Guide (since 2020 August).
|
||||
|
||||
## ICU Site
|
||||
|
||||
The official ICU Site is located at <https://icu.unicode.org>.
|
||||
It is the official landing page for the ICU project.
|
||||
|
||||
Some of the pages from the ICU Site have been migrated here.
|
||||
The migrated sections and pages from the ICU Site are visible in the navigation bar of this site below the "ICU Site" section heading.
|
||||
|
||||
## ICU team member pages
|
||||
|
||||
Other documentation pages here are written by and for team members.
|
||||
|
||||
@@ -0,0 +1,565 @@
|
||||
---
|
||||
layout: default
|
||||
title: CLDR-ICU integration (including ICU4C data to ICU4J)
|
||||
parent: Release & Milestone Tasks
|
||||
grand_parent: Contributors
|
||||
nav_order: 115
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
© 2010-2014: International Business Machines Corporation and others.
|
||||
All Rights Reserved.
|
||||
-->
|
||||
|
||||
# CLDR-ICU integration (including ICU4C data to ICU4J)
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
# Intro and setup
|
||||
|
||||
These instructions describe how to regenerate ICU4C locale and linguistic data from CLDR,
|
||||
and then how to convert that ICU4 data for ICU4J (data jars and maven resources).
|
||||
They apply to CLDR 44 / ICU 74 and later.
|
||||
|
||||
To use these instructions just for generating ICU4J data from ICU4C, you only need to use
|
||||
steps 1, 8, and 12 in the Process section.
|
||||
|
||||
The full process requires local copies of
|
||||
|
||||
* CLDR (the source of most of the data, and some Java tools)
|
||||
* The complete ICU source tree, including:
|
||||
* tools: includes the LdmlConverter build tool and associated config files
|
||||
* icu4c: the target for converted CLDR data, and source for ICU4J data; includes tests for the converted data
|
||||
* icu4j: the target for updated data jars; includes tests for the converted data
|
||||
|
||||
For an official CLDR data integration into ICU, these should be clean, freshly
|
||||
checked-out. For released CLDR sources, an alternative to checking out sources
|
||||
for a given version is downloading the zipped sources for the common (core.zip)
|
||||
and tools (tools.zip) directory subtrees from the Data column in
|
||||
[CLDR Releases/Downloads](https://cldr.unicode.org/index/downloads)
|
||||
|
||||
Besides a standard JDK, the process also requires [ant](https://ant.apache.org) and
|
||||
[maven](https://maven.apache.org) plus the xml-apis.jar from the
|
||||
[Apache xalan package](https://xalan.apache.org/xalan-j/downloads.html) _(Is this
|
||||
latter requirement still true?)_. You will also need to have performed the
|
||||
[CLDR Maven setup](http://cldr.unicode.org/development/maven) (non-Eclipse version).
|
||||
|
||||
Notes:
|
||||
|
||||
* Enough things can (and will) fail in this process that it is best to
|
||||
run the commands separately from an interactive shell. They should all
|
||||
copy and paste without problems.
|
||||
* It is often useful to save logs of the output of many of the steps in this
|
||||
process. The commands below save them to a NOTES directory.
|
||||
* If you are adding or removing locales, or specific kinds of locale data,
|
||||
there are some xml files in the ICU sources that need to be updated (these xml
|
||||
files are used in addition to the CLDR files as inputs to the CLDR data build
|
||||
process for ICU):
|
||||
* The primary file to edit for adding/removing locales and/or collation and
|
||||
rbnf data is<br>
|
||||
`$TOOLS_ROOT/cldr/cldr-to-icu/build-icu-data.xml`.
|
||||
* There are some files in `icu4c/source/data/xml/` that may need editing for
|
||||
certain additions. This is especially true for brkitr additions; however there
|
||||
are rbnf files there that add some rules. The collation files there mainly
|
||||
hook up the UCA collation rules in `icu4c/data/unidata/UCARules.txt` to the
|
||||
collation data. To process these files, certain CLDR dtds are copied over to
|
||||
ICU.
|
||||
|
||||
For an official CLDR data integration into ICU, there are some additional
|
||||
considerations:
|
||||
|
||||
* Don't commit anything in ICU sources (and possibly any changes in CLDR
|
||||
sources, depending on their nature) until you have finished testing and
|
||||
resolving build issues and test failures for both ICU4C and ICU4J.
|
||||
* After everything is committed, you will need to tag the cldr and cldr-staging
|
||||
sources that ended up being used for the integration (see process below).
|
||||
|
||||
# Environment variables
|
||||
|
||||
There are several environment variables that need to be defined.
|
||||
|
||||
1. Java-, ant-, and maven-related variables
|
||||
|
||||
* `JAVA_HOME`: Path to JDK (a directory, containing e.g. `bin/java`, `bin/javac`,
|
||||
etc.); on many systems this can be set using the output of `/usr/libexec/java_home`.
|
||||
|
||||
* `ANT_OPTS`: You may want to set `-Xmx8192m` to give Java more memory; otherwise
|
||||
it may run out of heap.
|
||||
|
||||
* `MAVEN_ARGS`: You may want to set `--no-transfer-progress` to reduce the noise
|
||||
from the download progress.
|
||||
|
||||
2. CLDR-related variables
|
||||
|
||||
* `CLDR_DIR`: This is the path to the to root of standard CLDR sources, below
|
||||
which are the common and tools directories.
|
||||
|
||||
* `CLDR_TMP_DIR`: Parent of temporary CLDR production data. Defaults to
|
||||
`$CLDR_DIR/../cldr-aux` (sibling to `CLDR_DIR`).
|
||||
|
||||
> **NOTE:** As of CLDR 36 and 37, the GenerateProductionData tool no longer
|
||||
generates data by default into `$CLDR_TMP_DIR/production`; instead it
|
||||
generates data into `$CLDR_DIR/../cldr-staging/production` (though there is
|
||||
a command-line option to override this). However the rest of the build still
|
||||
assumes that the generated data is in `$CLDR_TMP_DIR/production`.
|
||||
So `CLDR_TMP_DIR` must be defined to be `CLDR_DIR/../cldr-staging`.
|
||||
|
||||
3. ICU-related variables
|
||||
|
||||
* `ICU4C_DIR`: Path to root of ICU4C sources, below which is the source dir.
|
||||
|
||||
* `ICU4J_ROOT`: Path to root of ICU4J sources, below which is the main dir.
|
||||
|
||||
* `TOOLS_ROOT`: Path to root of ICU tools directory, below which are (e.g.) the
|
||||
cldr and unicodetools dirs.
|
||||
|
||||
# Process
|
||||
|
||||
## 1 Environment variables
|
||||
|
||||
1a. Java, ant, and maven variables, adjust for your system
|
||||
```
|
||||
export JAVA_HOME=/usr/libexec/java_home
|
||||
export ANT_OPTS="-Xmx8192m"
|
||||
export MAVEN_ARGS="--no-transfer-progress"
|
||||
```
|
||||
|
||||
1b. CLDR variables, adjust for your setup; with cygwin it might be e.g.
|
||||
```
|
||||
CLDR_DIR=`cygpath -wp /build/cldr`
|
||||
```
|
||||
|
||||
Note that for cldr-staging we do not use personal forks, we commit directly.
|
||||
```
|
||||
export CLDR_DIR=$HOME/cldr-myfork
|
||||
export CLDR_TMP_DIR=$HOME/cldr-staging
|
||||
export CLDR_DATA_DIR=$HOME/cldr-staging/production
|
||||
```
|
||||
|
||||
1c. ICU variables
|
||||
```
|
||||
export ICU4C_DIR=$HOME/icu-myfork/icu4c
|
||||
export ICU4J_ROOT=$HOME/icu-myfork/icu4j
|
||||
export TOOLS_ROOT=$HOME/icu-myfork/tools
|
||||
```
|
||||
|
||||
1d. Directory for logs/notes (create if does not exist)
|
||||
```
|
||||
export NOTES=...(some directory)...
|
||||
mkdir -p $NOTES
|
||||
```
|
||||
|
||||
1e. The name of the icu data directory for Java (for example `icudt74b`)
|
||||
```
|
||||
export ICU_DATA_VER=icudt(version)b
|
||||
```
|
||||
|
||||
## 2 Initial builds of ICU4C and ICU4J
|
||||
|
||||
2a. Configure ICU4C, build and test without new data first, to verify that
|
||||
there are no pre-existing errors, and to build some tools needed for later
|
||||
steps. Here `<platform>` is the runConfigureICU code for the platform you
|
||||
are building on, e.g. Linux, MacOSX, Cygwin.
|
||||
(optionally build with debug enabled)
|
||||
```
|
||||
cd $ICU4C_DIR/source
|
||||
./runConfigureICU [--enable-debug] <platform>
|
||||
make clean
|
||||
make check 2>&1 | tee $NOTES/icu4c-oldData-makeCheck.txt
|
||||
```
|
||||
|
||||
2b. Now with ICU4J, build and test without new data first, to verify that
|
||||
there are no pre-existing errors (or at least to have the pre-existing errors
|
||||
as a base for comparison):
|
||||
```
|
||||
cd $ICU4J_ROOT
|
||||
mvn clean
|
||||
mvn verify 2>&1 | tee $NOTES/icu4j-oldData-mvnCheck.txt
|
||||
```
|
||||
|
||||
## 3 Make pre-adjustments
|
||||
|
||||
3a. Copy latest relevant CLDR dtds to ICU
|
||||
```
|
||||
cp -p $CLDR_DIR/common/dtd/ldml.dtd $ICU4C_DIR/source/data/dtd/cldr/common/dtd/
|
||||
cp -p $CLDR_DIR/common/dtd/ldmlICU.dtd $ICU4C_DIR/source/data/dtd/cldr/common/dtd/
|
||||
```
|
||||
|
||||
3b. Update the cldr-icu tooling to use the latest tagged version of ICU
|
||||
```
|
||||
open $TOOLS_ROOT/cldr/cldr-to-icu/pom.xml
|
||||
```
|
||||
(search for `icu4j-for-cldr` and update to the latest tagged version per instructions)
|
||||
|
||||
3c. Update the build for any new icu version, added locales, etc.
|
||||
```
|
||||
open $TOOLS_ROOT/cldr/cldr-to-icu/build-icu-data.xml
|
||||
```
|
||||
(update icuVersion, icuDataVersion if necessary; update lists of locales to include if necessary)
|
||||
|
||||
3d. If there are new data types or variants in CLDR, you may need to update the
|
||||
files that specify mapping of CLDR data to ICU rseources:
|
||||
```
|
||||
open $TOOLS_ROOT/cldr/cldr-to-icu/src/main/resources/ldml2icu_locale.txt
|
||||
open $TOOLS_ROOT/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt
|
||||
```
|
||||
|
||||
## 4 Build and install CLDR jar
|
||||
|
||||
See `$TOOLS_ROOT/cldr/lib/README.txt` for more information on the CLDR
|
||||
jar and the `install-cldr-jars.sh` script.
|
||||
```
|
||||
cd $TOOLS_ROOT/cldr
|
||||
ant install-cldr-libs
|
||||
```
|
||||
|
||||
## 5 Generate CLDR production data and convert for ICU
|
||||
|
||||
5a. Generate the CLDR production data.
|
||||
|
||||
This process uses ant with ICU4C's `data/build.xml`
|
||||
|
||||
* Running `ant cleanprod` is necessary to clean out the production data directory
|
||||
(usually `$CLDR_TMP_DIR/production`), required if any CLDR data has changed.
|
||||
* Running `ant setup` is not required, but it will print useful errors to
|
||||
debug issues with your path when it fails.
|
||||
```
|
||||
cd $ICU4C_DIR/source/data
|
||||
ant cleanprod
|
||||
ant setup
|
||||
ant proddata 2>&1 | tee $NOTES/cldr-newData-proddataLog.txt
|
||||
```
|
||||
|
||||
> Note, for CLDR development, at this point tests are sometimes run on the
|
||||
production data, see
|
||||
[BRS: Run tests on production data](https://cldr.unicode.org/development/cldr-big-red-switch/brs-run-tests-on-production-data)
|
||||
|
||||
5b. Build the new ICU4C data files.
|
||||
|
||||
These include .txt files and .py files. These new files will replace whatever was
|
||||
already present in the ICU4C sources. This process uses the `LdmlConverter` in
|
||||
`$TOOLS_ROOT/cldr/cldr-to-icu/`; see `$TOOLS_ROOT/cldr/cldr-to-icu/README.txt`.
|
||||
|
||||
* This process will take several minutes, during most of which there will be no log
|
||||
output (so do not assume nothing is happening). Keep a log so you can investigate
|
||||
anything that looks suspicious.
|
||||
* Note that `ant clean` should _not_ be run before this. The `build-icu-data.xml` process
|
||||
will automatically run its own "clean" step to delete files it cannot determine to
|
||||
be ones that it would generate, except for pasts listed in `<retain>` elements such as
|
||||
`coll/de__PHONEBOOK.txt`, `coll/de_.txt`, etc.
|
||||
* Before running ant to regenerate the data, make any necessary changes to the
|
||||
build-icu-data.xml file, such as adding new locales etc.
|
||||
```
|
||||
cd $TOOLS_ROOT/cldr/cldr-to-icu
|
||||
ant -f build-icu-data.xml -DcldrDataDir="$CLDR_TMP_DIR/production" | tee $NOTES/cldr-newData-builddataLog.txt
|
||||
```
|
||||
|
||||
5c. Update the CLDR testData files needed by ICU4C/J tests, ensuring
|
||||
they are representative of the newest CLDR data.
|
||||
```
|
||||
cd $TOOLS_ROOT/cldr
|
||||
ant copy-cldr-testdata
|
||||
```
|
||||
|
||||
5d. NOP
|
||||
(This step has been subsumed into 5c above)
|
||||
|
||||
5e. For now, manually re-add the `lstm` entries in `data/brkitr/root.txt`
|
||||
```
|
||||
open $ICU4C_DIR/source/data/brkitr/root.txt
|
||||
```
|
||||
Paste the following block after the dictionaries block and before the final closing '}':
|
||||
```
|
||||
lstm{
|
||||
Thai{"Thai_graphclust_model4_heavy.res"}
|
||||
Mymr{"Burmese_graphclust_model5_heavy.res"}
|
||||
}
|
||||
```
|
||||
|
||||
## 6 Check the results
|
||||
|
||||
Check which data files have modifications, which have been added or removed
|
||||
(if there are no changes, you may not need to proceed further). Make sure the
|
||||
list seems reasonable. You may want to save logs, and possibly examine them...
|
||||
```
|
||||
cd $ICU4C_DIR/..
|
||||
git status
|
||||
git status > $NOTES/gitStatusDelta-data.txt
|
||||
git diff > $NOTES/gitDiffDelta-data.txt
|
||||
open $NOTES/gitDiffDelta-data.txt
|
||||
```
|
||||
|
||||
6a. You may also want to check which files were modified in CLDR production data:
|
||||
```
|
||||
cd $CLDR_TMP_DIR
|
||||
git status
|
||||
git status > $NOTES/gitStatusDelta-staging.txt
|
||||
git diff > $NOTES/gitDiffDelta-staging.txt
|
||||
```
|
||||
|
||||
## 7 Fix data generation errors
|
||||
|
||||
Look for evident errors in the list of file changes, or in the file diffs.
|
||||
Fixing them may entail modifying CLDR source data or `TOOLS_ROOT` config files or
|
||||
tooling.
|
||||
|
||||
## 8 Rebuild ICU4C with new data, run tests
|
||||
|
||||
8a. Re-run configure and make clean, necessary to handle any files added or deleted:
|
||||
```
|
||||
cd $ICU4C_DIR/source
|
||||
./runConfigureICU [--enable-debug] <platform>
|
||||
make clean
|
||||
```
|
||||
|
||||
8b. Do the rebuild, keeping a log as before:
|
||||
```
|
||||
make check 2>&1 | tee $NOTES/icu4c-newData-makeCheck.txt
|
||||
```
|
||||
|
||||
To re-run a specific test if necessary when fixing bugs; for example:
|
||||
```
|
||||
cd test/intltest
|
||||
DYLD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$DYLD_LIBRARY_PATH ./intltest -e -G format/NumberTest/NumberPermutationTest
|
||||
cd ../..
|
||||
|
||||
cd test/cintltst
|
||||
DYLD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$DYLD_LIBRARY_PATH ./cintltst /tsformat/ccaltst
|
||||
cd ../../..
|
||||
```
|
||||
|
||||
## 9 Investigate and fix make check test case failures
|
||||
|
||||
The first run processing new CLDR data from the Survey Tool can result in thousands
|
||||
of failures (in many cases, one CLDR data fix can resolve hundreds of test failures).
|
||||
|
||||
If the error is caused by bad CLDR data, then file a CLDR bug (or use the existing BRS
|
||||
ticket under which you are performing the integration, if you have one), fix the data,
|
||||
and regenerate from step 4.
|
||||
|
||||
If the data is OK , other sources of failure can include:
|
||||
* Problems with the CLDR-ICU conversion process (pehaps some locale data is not getting
|
||||
converted properly; go back to step 3, adjust and repeat from there.
|
||||
* Problems with ICU library code that may not be using new resources properly. Fix and
|
||||
repeat from step 8.
|
||||
* Problems in which ICU test cases need to be updated to match CLDR changes. Fix and
|
||||
repeat from step 8. Some special cases of this include:
|
||||
* If there are new resource types or new attribute values for existing resource types,
|
||||
you will need to update `icu4c/test/testdata/structLocale.txt` (otherwise
|
||||
`/tsutil/cldrtest/TestLocaleStructure` may fail).
|
||||
|
||||
## 10 Running ICU4C tests in exhaustive mode.
|
||||
|
||||
Exhautive tests should always be run for a CLDR-ICU integration PR before it is merged.
|
||||
Once you have a PR, you can do this for both C and J as part of the pre-merge CI tests
|
||||
by adding the following as a comment in the pull request:<br>
|
||||
`/azp run CI-Exhaustive` (the exhaustive tests are not run automatically on every PR).
|
||||
|
||||
The following instructions run the ICU4C exhaustive tests locally (which you may want to do
|
||||
before even committing changes, or which may be necessary to diagnose failures in the
|
||||
CI tests:
|
||||
```
|
||||
cd $ICU4C_DIR/source
|
||||
export INTLTEST_OPTS="-e"
|
||||
export CINTLTST_OPTS="-e"
|
||||
make check 2>&1 | tee $NOTES/icu4c-newData-makeCheckEx.txt
|
||||
```
|
||||
|
||||
## 11 Investigate and fix ICU4C exhaustive test case failures
|
||||
|
||||
Again, investigate each failure, fixing CLDR data or ICU test cases as
|
||||
appropriate, and repeating from step 4 or 8 as appropriate.
|
||||
|
||||
## 12 Transfer the ICU4C data to ICU4J
|
||||
|
||||
12a. You need to reconfigure ICU4C to include the unicore data.
|
||||
```
|
||||
cd $ICU4C_DIR/source
|
||||
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ./runConfigureICU <platform>
|
||||
```
|
||||
|
||||
12b. Rebuild the data with the new config setting, then create the ICU4J data jar.
|
||||
```
|
||||
cd $ICU4C_DIR/source/data
|
||||
make clean
|
||||
make -j -l2.5
|
||||
make icu4j-data-install
|
||||
```
|
||||
|
||||
12c. Create the test data jar
|
||||
```
|
||||
cd $ICU4C_DIR/source/test/testdata
|
||||
make icu4j-data-install
|
||||
```
|
||||
|
||||
12d. Update the extracted {main, test} data files in the Maven build
|
||||
```
|
||||
cd $ICU4J_ROOT
|
||||
./extract-data-files.sh
|
||||
```
|
||||
|
||||
## 13 Rebuild ICU4J with new data, run tests
|
||||
|
||||
13a. Run the tests using the maven build
|
||||
```
|
||||
cd $ICU4J_ROOT
|
||||
mvn clean
|
||||
mvn install 2>&1 | tee $NOTES/icu4j-newData-mvnCheck.txt
|
||||
```
|
||||
|
||||
It is possible to re-run a specific test class or method if necessary when fixing bugs.
|
||||
|
||||
For example (using artifactId, full class name, test all methods):
|
||||
```
|
||||
mvn install -pl :core -Dtest=com.ibm.icu.dev.test.util.LocaleBuilderTest
|
||||
```
|
||||
or (example of using module path, class name, one method):
|
||||
```
|
||||
mvn install -pl main/common_tests -Dtest=MeasureUnitTest#TestGreek
|
||||
```
|
||||
|
||||
13b. Optionally run the tests in exhautive mode
|
||||
|
||||
Optionally run before committing changes, or run to diagnose failures from
|
||||
running exhastive CI tests in the PR using `/azp run CI-Exhaustive`:
|
||||
```
|
||||
cd $ICU4J_ROOT
|
||||
mvn install -DICU.exhaustive=10 2>&1 | tee $NOTES/icu4j-newData-mvnCheckEx.txt
|
||||
```
|
||||
|
||||
Running a specific test is the same as above:
|
||||
```
|
||||
mvn install --pl :core -DICU.exhaustive=10 -Dtest=ExhaustiveNumberTest
|
||||
```
|
||||
|
||||
## 14 Investigate and fix maven check test failures
|
||||
|
||||
Fix test cases and repeat from step 13, or fix CLDR data and repeat from
|
||||
step 4, as appropriate, until there are no more failures in ICU4C or ICU4J.
|
||||
|
||||
Note that certain data changes and related test failures may require the
|
||||
rebuilding of other kinds of data and/or code. For example:
|
||||
|
||||
### Updating MeasureUnit code and tests
|
||||
|
||||
If you see a failure such as
|
||||
```
|
||||
MeasureUnitTest testCLDRUnitAvailability Failure (MeasureUnitTest.java:3410) : Unit present in CLDR but not available via constant in MeasureUnit: speed-beaufort
|
||||
```
|
||||
then you will need to update the C and J library and test code for new measurement
|
||||
units, see the procedure at
|
||||
[Updating MeasureUnit with new CLDR data](https://unicode-org.github.io/icu/processes/release/tasks/updating-measure-unit.html)
|
||||
|
||||
### Updating plurals test data
|
||||
|
||||
Changes to plurals data may cause failures in e.g. the following:
|
||||
```
|
||||
com.ibm.icu.dev.test.format.PluralRulesTest (TestLocales)
|
||||
```
|
||||
|
||||
To address these requires updating the LOCALE_SNAPSHOT data in
|
||||
```
|
||||
$ICU4J_ROOT/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/PluralRulesTest.java
|
||||
```
|
||||
by modifying the TestLocales() test there to run `generateLOCALE_SNAPSHOT()` and
|
||||
then copying in the updated data.
|
||||
|
||||
## 15 Check the ICU file changes and commit
|
||||
|
||||
```
|
||||
cd $ICU4C_DIR/source
|
||||
make clean
|
||||
cd $ICU4J_ROOT
|
||||
mvn clean
|
||||
cd ..
|
||||
git status
|
||||
```
|
||||
|
||||
Then `git add` or `git rm` files as necessary. Record the changes, commit and push.
|
||||
```
|
||||
git status > $NOTES/gitStatusDelta-newData-afterAdd.txt
|
||||
git commit -m 'ICU-nnnnn CLDR release-nn-stage to ICU main'
|
||||
git push origin ICU-nnnnn-branchname
|
||||
```
|
||||
|
||||
## 16 commit cldr-staging and tag
|
||||
(Only for an official integration from CLDR git repositories)
|
||||
|
||||
16a. Check cldr-staging changes, and commit
|
||||
```
|
||||
cd $CLDR_TMP_DIR
|
||||
git status
|
||||
```
|
||||
|
||||
Then `git add` or `git rm` files as necessary. Record the changes, commit and push.
|
||||
```
|
||||
git status > $NOTES/gitStatusDelta-production-afterAdd.txt
|
||||
git commit -m 'CLDR-nnnnn production data corresponding to CLDR release-nn-stage'
|
||||
git push origin main
|
||||
```
|
||||
(usually for cldr-staging we just work with the main branch)
|
||||
|
||||
16b. Update cldr-staging and tag
|
||||
|
||||
(There may be other cldr-staging changes unrelated to production data, such as charts
|
||||
or spec; we want to include them in the tag, so pull first, but log to see what the
|
||||
chnages are first)
|
||||
```
|
||||
cd $CLDR_TMP_DIR
|
||||
git pull
|
||||
git log
|
||||
git tag -a "release-nn-stage" -m "CLDR-nnnnn: tag production data corresponding to CLDR release-nn-stage"
|
||||
git push --tags
|
||||
```
|
||||
|
||||
## 17 tag cldr
|
||||
(Only for an official integration from CLDR git repositories)
|
||||
|
||||
We need to tag the main cldr repository. If $CLDR_DIR represents that repository,
|
||||
this is easy:
|
||||
```
|
||||
cd $CLDR_DIR
|
||||
git tag -a "release-nn-stage" -m "CLDR-nnnnn: tag CLDR release-nn-stage"
|
||||
git push --tags
|
||||
```
|
||||
|
||||
However if $CLDR_DIR represents your personal fork or a branch from it, you need to
|
||||
figure out what commit hash yo have integrated, and tag that hash in the main repo.
|
||||
```
|
||||
cd $CLDR_DIR
|
||||
git log
|
||||
```
|
||||
Note the latest commit hash hhhhhhhh...
|
||||
|
||||
Then switch to the main repo, update it, and tag the appropriate hash (making sure
|
||||
it is in that repo!):
|
||||
```
|
||||
cd $HOME/cldr
|
||||
git pull
|
||||
git log
|
||||
git tag -a "release-nn-stage" -m "CLDR-nnnnn: tag CLDR release-nn-stage" hhhhhhhh...
|
||||
git push --tags
|
||||
```
|
||||
|
||||
## 18 Pubish the cldr tags in github
|
||||
|
||||
You should publish the cldr and cldr-staging tags in github.
|
||||
|
||||
For cldr, go to [unicode-org/cldr/tags](https://github.com/unicode-org/cldr/tags)
|
||||
and click on the tag you just created. Click on the "Create release from tag" button
|
||||
at the upper right. Set release title to be the same as the tag. Click the checkbox
|
||||
for "Set as a pre-release" for all but the final release. For the description, see
|
||||
what was done for earlier tags; it should reference the download page for the release.
|
||||
When you are all ready, click the "Publish release" button.
|
||||
|
||||
For cldr-staging, go to [unicode-org/cldr-staging/tags](https://github.com/unicode-org/cldr-staging/tags)
|
||||
and do something similar.
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
layout: default
|
||||
title: Maintenance Release Procedure
|
||||
parent: Release & Milestone Tasks
|
||||
grand_parent: Contributors
|
||||
nav_order: 75
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Maintenance Release Procedure
|
||||
|
||||
When a critical problem is found in ICU libraries, we try to fix the problem in
|
||||
the latest development stream first. If there is a demand for the fix in a past
|
||||
release, an ICU project developer may escalate the fix to be integrated in the
|
||||
release to the ICU project management committee. Once the committee approved to
|
||||
merge the fix into back level stream, the developer can merge the bug fix back
|
||||
to the past release suggested by the committee. This merge activity must be
|
||||
tracked by maintenance release place holder tickets and the developer should
|
||||
provide original ticket number and description as the response in each
|
||||
maintenance ticket. These fixes are automatically included in a future ICU
|
||||
maintenance release.
|
||||
|
||||
## Place Holder Ticket
|
||||
|
||||
Once a major version of ICU library is released, we create maintenance release
|
||||
place holder tickets for the major release (one for C, one for J). The ticket
|
||||
should have subject: "ICU4\[C|J\] m.n.X". For example, after ICU 4.8 release, we
|
||||
create two tickets - "ICU4C 4.8.X" and "ICU4J 4.8.X". These tickets must use the
|
||||
target milestone - "maintenance-release".
|
||||
|
||||
## Maintenance Release
|
||||
|
||||
When the ICU project committee agree on releasing a new maintenance release, the
|
||||
corresponding place holder ticket will be promoted to a real maintenance release
|
||||
task ticket. This is done by following steps.
|
||||
|
||||
* Create the new actual maintenance release milestone (e.g. 4.8.1)
|
||||
* Change the place holder ticket's subject to the actual version (e.g. "ICU4C
|
||||
4.8.X" -> "ICU4C 4.8.1")
|
||||
* Retarget the place holder ticket to the actual release (e.g.
|
||||
"maintenance-release" -> "4.8.1")
|
||||
* Create a new place holder ticket for future release (e.g. new ticket "ICU4C
|
||||
4.8.X", milestone: "maintenance-release")
|
||||
@@ -49,7 +49,7 @@ License & terms of use: http://www.unicode.org/copyright.html
|
||||
5. make doc
|
||||
6. Follow instructions in
|
||||
[tools/release/java/readme.txt](https://htmlpreview.github.io/?https://github.com/unicode-org/icu/blob/main/tools/release/java/readme.txt)
|
||||
to generate API status change report.
|
||||
to generate the API status change report.
|
||||
7. Make sure that ICU headers work with U_HIDE_DRAFT_API and other such
|
||||
switches.
|
||||
8. Verify that U_DRAFT and U_STABLE match the @draft and @stable tags (same for
|
||||
@@ -71,11 +71,11 @@ compatibility](https://unicode-org.github.io/icu/userguide/icu/design#icu-api-co
|
||||
|
||||
On ICU4J, run
|
||||
[com.ibm.icu.dev.tool.docs.CheckTags](https://github.com/unicode-org/icu/blob/main/icu4j/tools/build/src/com/ibm/icu/dev/tool/docs/CheckTags.java)
|
||||
(see file for instructions). This requires a JDK with javadoc available. The
|
||||
(see file for instructions). This requires a JDK with javadoc available, i.e, JDK8. The
|
||||
tool will need to change to reflect the release number to search for.
|
||||
|
||||
To check the API status changes, run the ant target "apireport" to generate the
|
||||
report since the previous official release.
|
||||
To check the API status changes, run the script `releases_tools/api_reports.sh` to generate the
|
||||
report of updates since the previous official release. The resulting file is found in target/icu4j_compare_XX_YY.html.
|
||||
|
||||
Make sure **@internal APIs** are also marked as @deprecated:
|
||||
|
||||
@@ -116,28 +116,27 @@ Andy's method (from email 2019-sep-05):
|
||||
### **ICU4J**
|
||||
|
||||
1. Create a new GitHub branch.
|
||||
2. Run next ant target: `$ ant draftAPIsTSV`
|
||||
3. This **ant** target generates a tab-separated values file at
|
||||
icu4j/out/draftAPIs.tsv.
|
||||
4. Import the TSV file to Google spread sheet - for example, [ICU4J 61 Draft
|
||||
2. In directory icu/icu4j, run this script: `releases_tools/api_reports.sh`
|
||||
3. This script generates a tab-separated values file at target/draftAPIs.tsv.
|
||||
4. Import the TSV file to Google spread sheet - for example, [ICU4J 74 Draft
|
||||
API
|
||||
Promotion](https://docs.google.com/spreadsheets/d/135RDyY6cWKBBvNuVE9ne8HfsItZu_CvLh47hKjr3UqM/edit#gid=1384666589).
|
||||
* Create the spreadsheet in the shared ***ICU Projects*** folder.
|
||||
5. Review all APIs introduced in 2 releases ago or older. For example, 59 or
|
||||
older for ICU 61 release.
|
||||
5. Review all APIs introduced in 2 releases ago or older. For example, 72 or
|
||||
older for ICU 74 release.
|
||||
* Any API added 2 or more releases ago is a candidate for promotion.
|
||||
* Newer APIs should be left in @draft state.
|
||||
6. Check each API entry has a corresponding approved API proposal. For example,
|
||||
[ICU 59 API proposal
|
||||
[ICU 72 API proposal
|
||||
status](https://docs.google.com/document/d/12dHTG3e9WXb7C1Xdc2bcXE0BK8f6IoufoUAPcz4ZT2I/edit).
|
||||
Note: An API proposal might have been created before the API proposal doc
|
||||
version, so you may need to look at older version of API proposal status
|
||||
doc.
|
||||
7. Mark APIs proposed for promotion, and add note in the spread sheet.
|
||||
8. Update API comments in ICU4J source code. In this case, @draft is replaced
|
||||
with @stable (do not change ICU version, for example, "@draft ICU 59" will
|
||||
be changed to "@stable ICU 59").
|
||||
9. Run next ant target to generate an API change report html: `$ ant apireport`
|
||||
with @stable (do not change ICU version, for example, "@draft ICU 72" will
|
||||
be changed to "@stable ICU 72").
|
||||
9. Now, rerun target to generate an API change report html: `releases_tools/api_reports.sh`.
|
||||
10. Review the report, sent the report file and the link of the spread sheet to
|
||||
ICU technical committee members for review.
|
||||
11. Once ICU TC approves the proposed change, create a pull request (PR), wait
|
||||
@@ -166,10 +165,12 @@ This work is done in the root of icu4j:
|
||||
1. Make sure JAVA_HOME is set to JDK 8. This report creation fails with JDK 11.
|
||||
For example, in Linux:
|
||||
* `export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64`
|
||||
2. Then run ant task "clean" and "apireport" at <icu4j_root>:
|
||||
* `ant clean apireport`
|
||||
2. Now in `<icu4j_root>`, create a change report:
|
||||
* `mvn clean`
|
||||
* `releases_tools/api_reports.sh`
|
||||
* # Note that some errors may be shown. This is normal.
|
||||
3. Above will produce API change report file
|
||||
<code><icu4j_root>/<b>out</b>/icu4j_compare_xxx_yyy.html</code>
|
||||
`<icu4j_root>/<b>target</b>/icu4j_compare_xxx_yyy.html`
|
||||
4. Make sure there are any new doc tag errors are reported. (As of ICU 4.4,
|
||||
ArabicShaping constants do not have proper tags - otherwise, clean)
|
||||
5. Copy generated report file to `<icu4j_root>/APIChangeReport.html` and check
|
||||
@@ -179,11 +180,6 @@ Once official release version is shipped, we need to keep API signature
|
||||
information file for next iteration. This is not done for milestone releases,
|
||||
only after the final official release.
|
||||
|
||||
1. Run ant task "gatherapi" at <icu4j_root>
|
||||
2. Above will produce API signature information file
|
||||
<icu4j_root>/out/icu4jxx.api2.gz
|
||||
3. Copy icu4jxxapi2.gz to <icu4j_root>/tools/build and add it to the repository
|
||||
|
||||
---
|
||||
|
||||
## Check in API signature data file (ICU4J)
|
||||
@@ -192,11 +188,12 @@ Once APIs are frozen for a reference release, we should check in the API
|
||||
signature data file into the repository. The data file will be used for future
|
||||
API change report.
|
||||
|
||||
1. Run ant task "gatherapi" at <icu4j_root>
|
||||
2. The output file icu4j<ver>.api3.gz is created in <icu4j_root>/out directory.
|
||||
3. Copy the output .gz file to <icu4j_root>/tools directory and check in the
|
||||
1. Run `releases_tools/api_reports.sh` at `<icu4j_root>`
|
||||
2. Resolve any warnings before proceeding.
|
||||
3. The output file `icu4j<ver>.api3.gz` is created in `<icu4j_root>/out` directory.
|
||||
4. Copy the output .gz file to `<icu4j_root>/tools/build` directory and check in the
|
||||
file to the repository.
|
||||
4. You may delete very old versions of the API signature files. Keeping 10
|
||||
5. You may delete very old versions of the API signature files. Keeping 10
|
||||
versions to the latest should be good enough.
|
||||
|
||||
Note: This task is only necessary for reference releases, because we won't
|
||||
@@ -311,7 +308,7 @@ and make sure ICU4J adequately covers the JDK API for the classes we replicate.
|
||||
|
||||
---
|
||||
|
||||
## Build API documentations
|
||||
## Build API documentation
|
||||
|
||||
### **ICU4C**
|
||||
|
||||
@@ -329,8 +326,11 @@ javadoc files. Create icu4c-X_X_X-docs.zip
|
||||
3. The generated API docs are in <path>/icu4c/source/doc/html/<br>
|
||||
`cd <path>/icu4c/source/doc/html/`
|
||||
4. Create a zip file, e.g.,<br>
|
||||
`tar cvfz /tmp/icu4c641.tar.gz * # '641' needs to be replaced by the respective release label.`
|
||||
5. ~~Upload this zip file to the GitHub release page. For the live API docs, see below.~~
|
||||
`tar cvfz /tmp/icu4c72rc.tar.gz * # Note: label the file apropriately for the release.
|
||||
5. Edit [README.md in icu-docs](https://github.com/unicode-org/icu-docs/blob/main/README.md).
|
||||
6. Update the table under "API docs" at the top of README.md with the new version in column "C" in row "Dev" for the release candidate or "Released" for the final release.
|
||||
7. Add the updated README.md to the pull request with the new API documentation.
|
||||
|
||||
|
||||
#### Create a PR for ICU4C docs using the docs zip file
|
||||
|
||||
@@ -340,25 +340,29 @@ javadoc files. Create icu4c-X_X_X-docs.zip
|
||||
|
||||
b. Create and switch to a feature branch based of the latest `main`. Ex: `git checkout -b ICU-<TICKET-NUMBER>`.
|
||||
|
||||
c. Copy the zip file into your local copy of icu-docs into `apidoc/released/icu4c`
|
||||
(or `apidoc/dev/icu4c` if not a release)
|
||||
c. Go to the directory for the version of interest, either
|
||||
`apidoc/dev/icu4c` (release candicate) or `apidoc/released/icu4c`
|
||||
(general release.)
|
||||
|
||||
d. Unzip the file, replacing all documentation. Ex: `tar xvfz /tmp/icu4c641.tar.gz`
|
||||
d. Be sure that you are in the right directory. Then, remove all the files
|
||||
in this directory, e.g., `rm -rf *`. (Remember "git restore" is a good friend!)
|
||||
|
||||
e. Unzip the tar file from above, replacing all documentation. Ex: `tar xvfz /tmp/icu4c72rc.tar.gz`
|
||||
|
||||
e. Remove the zip file
|
||||
e. Remove the zip file if it's in the folder.
|
||||
|
||||
f. `git add .`
|
||||
f. `git add .`. Note that this may remove some old files. That's correct behavior.
|
||||
|
||||
g. `git commit -m "ICU-<TICKET-NUMBER> Update ICU4C API reference docs for
|
||||
h. `git commit -m "ICU-<TICKET-NUMBER> Update ICU4C API reference docs for
|
||||
XX.Y"`<br>
|
||||
Example: [ICU-21546 Update ICU4C API reference docs for 69.1](https://github.com/unicode-org/icu-docs/pull/25)
|
||||
|
||||
h. `git push origin ICU-<TICKET-NUMBER>`
|
||||
i. `git push origin ICU-<TICKET-NUMBER>`
|
||||
|
||||
i. Create Pull Request from your personal github fork of icu-docs from your newly-pushed branch `ICU-<TICKET-NUMBER>` with a destination of
|
||||
j. Create Pull Request from your personal github fork of icu-docs from your newly-pushed branch `ICU-<TICKET-NUMBER>` with a destination of
|
||||
the `unicode-org/icu-docs` repo's `main` branch
|
||||
|
||||
j. Request review
|
||||
k. Request a review and submit the PR when approved.
|
||||
|
||||
Note: This is also referenced below [Upload API documentations](docs.md#upload-api-documentations) for how to make the API docs public.
|
||||
|
||||
@@ -396,6 +400,11 @@ See [Upload API documentations](docs.md#upload-api-documentations) below for how
|
||||
See <https://unicode-org.github.io/icu-docs/HOWTO-Update.html> for instructions
|
||||
to upload to <https://unicode-org.github.io/icu-docs/>
|
||||
|
||||
#### Update table of API docs:
|
||||
1. Edit [README.md in icu-docs](https://github.com/unicode-org/icu-docs/blob/main/README.md).
|
||||
2. Update the table under "API docs" at the top of README.md with the new version in column "J" in row "Dev" for the release candidate or "Released" for the final release.
|
||||
3. Add the updated README.md to the pull request with the new API documentation.
|
||||
|
||||
### Update the Readme.html for GA
|
||||
|
||||
If there are any last second changes:
|
||||
|
||||
@@ -343,6 +343,7 @@ automated as part of Travis CI.**</span>
|
||||
---
|
||||
|
||||
## Test uconfig.h variations
|
||||
This test is performed automatically by a GitHub Action for each pull request.
|
||||
|
||||
Test ICU completely, and run the header test (above) with:
|
||||
|
||||
@@ -392,13 +393,16 @@ The automated build system should have a machine that sets both
|
||||
|
||||
## Test UCONFIG_NO_CONVERSION
|
||||
|
||||
Note: Since ICU 73, this test has been included in the Github Actions Continuous Integration jobs.
|
||||
These instructions explain how to run the test manually.
|
||||
|
||||
Make sure that the ICU4C common and i18n libraries build with
|
||||
UCONFIG_NO_CONVERSION set to 1. We cannot do this as part of "Test uconfig.h
|
||||
variations" because the test suites cannot be built like this, but the library
|
||||
code must support it.
|
||||
|
||||
The simplest is to take an ICU4C workspace, modify uconfig.h *==temporarily==*
|
||||
by changing the value of UCONFIG_NO_CONVERSION to 1, and do "make -j 6" (not
|
||||
by changing the value of UCONFIG_NO_CONVERSION to 1, and do "make -j -l2.5" (not
|
||||
"make check" or "make tests"). Verify that the stubdata, common & i18n libraries
|
||||
build fine; layout should build too but toolutil will fail, that's expected.
|
||||
|
||||
@@ -417,7 +421,7 @@ Linux,
|
||||
|
||||
```sh
|
||||
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1"
|
||||
make -j6 check
|
||||
make -j -l2.5 check
|
||||
```
|
||||
|
||||
Any problems will show up as compilation or test errors.
|
||||
@@ -443,7 +447,7 @@ show as build failures.
|
||||
```sh
|
||||
CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0" ./runConfigureICU Linux
|
||||
make clean
|
||||
make -j12 check
|
||||
make -j -l2.5 check
|
||||
```
|
||||
|
||||
## ~~Test ICU_USE_THREADS=0 \[Obsolete\]~~
|
||||
@@ -469,6 +473,10 @@ make check
|
||||
|
||||
## Test ICU4C Samples and Demos
|
||||
|
||||
### Windows build and test
|
||||
Note: Since ICU 73, this task has been included in the Azure DevOps Pipeline which is triggered automatically upon merging with main/maint* branches.
|
||||
These instructions explain how to run the tests manually.
|
||||
|
||||
To build the ICU4C samples on Windows with Visual Studio, use the following
|
||||
steps:
|
||||
|
||||
@@ -489,6 +497,29 @@ steps:
|
||||
To test the sample programs, run the "source\\samples\\all\\samplecheck.bat"
|
||||
script for each configuration, and ensure that they are successful.
|
||||
|
||||
### Linux /Unix build and test
|
||||
To build and test ICU4C samples:
|
||||
|
||||
This test is performed automatically by a GitHub Action for each pull request.
|
||||
* In icu4c/source, run the configuration "./runConfigure Linux" (or appropriate system)
|
||||
* Build and install ICU4C.
|
||||
* Set PATH to include the bin directory of the installed ICU4c.
|
||||
* Set LD_LIBRARY_PATH to include the libs directory on the installed ICU4c.
|
||||
|
||||
|
||||
```
|
||||
cd icu4c/source
|
||||
cd samples
|
||||
# To clean all the test binaries
|
||||
make clean-samples-recursive
|
||||
# To rebuild them all
|
||||
make all-samples-recursive
|
||||
# To run all tests serially
|
||||
make check-samples-recursive
|
||||
|
||||
```
|
||||
|
||||
|
||||
## **Test ICU4C Demos via Docker**
|
||||
|
||||
See <https://github.com/unicode-org/icu-demos/blob/main/icu-kube/README.md>
|
||||
@@ -510,8 +541,8 @@ demo.
|
||||
|
||||
```sh
|
||||
$ cd icu4j
|
||||
$ ant jarDemos
|
||||
$ java -jar icu4jdemos.jar
|
||||
$ mvn install -am -pl demos -DskipTests -DskipITs
|
||||
$ mvn exec:exec -pl demos
|
||||
```
|
||||
|
||||
Above command invokes GUI demo applications. As such it has to connect to a
|
||||
@@ -521,9 +552,32 @@ which it is executed instead of in a ssh shell.
|
||||
The demos include calendar, charset detection, holidays, RBNF and
|
||||
transliterator. Check if each application is working OK.
|
||||
|
||||
To check ICU4J samples, open Eclipse workspace and import icu4j-samples project
|
||||
from directory <icu4j_root>/samples. Make sure these sample code has no build
|
||||
issues. Also run sample code with main and see if each sample code runs.
|
||||
### ICU4J Samples
|
||||
|
||||
ICU4J samples are located in directory <icu4j_root>/samples. Check that:
|
||||
|
||||
* The build succeeds.
|
||||
* Each sample runs, giving results appropriate for the sample.
|
||||
|
||||
To check ICU4J samples, you may use the command line to build and then run each:
|
||||
```sh
|
||||
$ cd icu4j
|
||||
$ mvn install -am -pl samples -DskipTests -DskipITs
|
||||
|
||||
# Get the list of samples with `main` methods, and execute to test.
|
||||
$ classes=`grep -r "void main" samples/src/ -l | ruby -lane 'file=$_; m = file.match(/src\/main\/java\/(.*)\.java$/); puts m[1];' | tr '/' '.'`
|
||||
$ for class in $classes; do echo $class; mvn exec:java -pl samples -Dexec.mainClass="$class"; echo "Press enter to continue"; read; done
|
||||
```
|
||||
|
||||
To use Eclipse, do the following:
|
||||
|
||||
* Open Eclipse workspace
|
||||
* import icu4j-samples project
|
||||
* Build the project
|
||||
* In package explorer, right-click on "Run as"
|
||||
* Pick "Java application"
|
||||
* Choose a sample
|
||||
* Verify that the sample runs and that output appears in the console window.
|
||||
|
||||
---
|
||||
|
||||
@@ -532,14 +586,14 @@ issues. Also run sample code with main and see if each sample code runs.
|
||||
For ICU4J,
|
||||
|
||||
```sh
|
||||
$ ant exhaustiveCheck
|
||||
$ mvn install -DICU.exhaustive=10
|
||||
```
|
||||
|
||||
For ICU4C, testing with an optimized build will help reduce the elapsed time
|
||||
required for the tests to complete.
|
||||
|
||||
```sh
|
||||
$ make -j6 check-exhaustive
|
||||
$ make -j -l2.5 check-exhaustive
|
||||
```
|
||||
|
||||
---
|
||||
@@ -551,7 +605,7 @@ tests. These instructions run the sanitizer on the entire test suite. The clang
|
||||
compiler is required.
|
||||
|
||||
```sh
|
||||
$ CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux --disable-renaming
|
||||
$ CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming
|
||||
$ make clean
|
||||
$ make -j6 check
|
||||
$ make -j -l2.5 check
|
||||
```
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
layout: default
|
||||
title: Release & Milestone Tasks
|
||||
parent: Contributors
|
||||
nav_order: 10
|
||||
has_children: true
|
||||
---
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ Using an in-source build on Linux:
|
||||
```sh
|
||||
cd icu4c/source
|
||||
./runConfigureICU Linux
|
||||
make -j2 check
|
||||
make -j -l2.5 check
|
||||
rm lib/libicudata.so*
|
||||
cp -P stubdata/libicudata.so* lib/
|
||||
cd test/intltest
|
||||
@@ -176,6 +176,9 @@ now, this task is not required for ICU4J.
|
||||
|
||||
## Verify that ICU4C tests pass without collation rule strings
|
||||
|
||||
Note: Since ICU 73, this test has been included in the Github Actions Continuous Integration jobs.
|
||||
These instructions explain how to run the test manually.
|
||||
|
||||
***ICU4C 53 and later***
|
||||
|
||||
Background: [ICU-10636](https://unicode-org.atlassian.net/browse/ICU-10636)
|
||||
@@ -238,7 +241,7 @@ see ticket [ICU-10636](https://unicode-org.atlassian.net/browse/ICU-10636).
|
||||
|
||||
### Run the tests with data-errors-as-warnings
|
||||
|
||||
`INTLTEST_OPTS=-w CINTLTST_OPTS=-w make -j5 check`
|
||||
`INTLTEST_OPTS=-w CINTLTST_OPTS=-w make -j -l2.5 check`
|
||||
|
||||
See that they pass, or fix them to pass. See ticket #10636 test code changes for
|
||||
examples.
|
||||
@@ -249,13 +252,18 @@ examples.
|
||||
|
||||
*Only available since ICU 54.*
|
||||
|
||||
#### With ICU 64 and later:
|
||||
### With ICU 70 and later:
|
||||
|
||||
This test is performed automatically via a post-merge GHA check,
|
||||
based on the following instructions for ICU 64+.
|
||||
|
||||
### With ICU 64 and later:
|
||||
|
||||
* Reconfigure ICU4C with
|
||||
<code><b>ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data</b>
|
||||
./runConfigureICU Linux</code> or similar
|
||||
* Should be little-endian for coverage
|
||||
* Clean and build ICU4C: `make -j6 check`
|
||||
* Clean and build ICU4C: `make -j -l2.5 check`
|
||||
* Make a clean directory for testing
|
||||
* Find the .data file in the build output area, e.g.,
|
||||
`icu4c/source/data/out/tmp/icudt64l.dat`
|
||||
@@ -268,7 +276,7 @@ examples.
|
||||
* If you get very many test failures, double-check that you enabled
|
||||
unicore data in the ICU4C build (see first step).
|
||||
|
||||
#### With ICU 55 through ICU 63:
|
||||
### With ICU 55 through ICU 63:
|
||||
|
||||
* Rebuild ICU4C with <code>make <b>INCLUDE_UNI_CORE_DATA=1</b> check</code> or
|
||||
similar, and provide a path only for the .dat file.
|
||||
@@ -283,7 +291,7 @@ examples.
|
||||
* The configuration option sets the `ICUConfig.properties` data path
|
||||
* Verify that all tests pass.
|
||||
|
||||
#### ICU 54 method:
|
||||
### ICU 54 method:
|
||||
|
||||
In `icu4j-core/src/com/ibm/icu/ICUConfig.properties` set
|
||||
`com.ibm.icu.impl.ICUBinary.dataPath` to a list of paths with all of the ICU4C
|
||||
@@ -392,6 +400,8 @@ option. When it's not available, you would do the following:
|
||||
---
|
||||
|
||||
## Run the environment tests
|
||||
This test is performed automatically by a GitHub Action once per week. We can also run it manually by visiting
|
||||
[GHA EnvTest Action page](https://github.com/unicode-org/icu/actions/workflows/icu_envtest.yml) then click on the "Run workflow v" drop down on the right side of the screen
|
||||
|
||||
Run
|
||||
[environmentTest.sh](https://github.com/unicode-org/icu/blob/main/tools/release/c/environmentTest.sh)
|
||||
@@ -421,9 +431,9 @@ To run manually, on a Linux system with clang,
|
||||
|
||||
```sh
|
||||
cd icu4c/source
|
||||
CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux
|
||||
CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux/clang
|
||||
make clean
|
||||
make -j6 check
|
||||
make -j -l2.5 check
|
||||
```
|
||||
|
||||
Errors are displayed at the point they occur, and stop further testing.
|
||||
@@ -439,9 +449,9 @@ To run manually, on a Linux system with clang,
|
||||
|
||||
```sh
|
||||
cd icu4c/source
|
||||
CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address ./runConfigureICU --enable-debug --disable-release Linux
|
||||
CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address ./runConfigureICU --enable-debug --disable-release Linux/clang
|
||||
make clean
|
||||
make -j6 check
|
||||
make -j -l2.5 check
|
||||
```
|
||||
|
||||
Memory leaks are summarized at the end. Other errors are displayed at the point
|
||||
@@ -457,12 +467,12 @@ version of ICU. When we prepare a new release, the serialization compatibility
|
||||
test data should be created and checked in for future testing. This task is
|
||||
usually done just before publishing release candidate.
|
||||
|
||||
1. Run regular ICU4J unit tests - `ant check`
|
||||
2. Make sure the unit tests pass successfully.
|
||||
3. Run - `ant serialTestData`
|
||||
4. Copy a folder with ICU version (e.g. ICU_61.1) generated under <icu4j
|
||||
root>/out/serialTestData to <icu4j
|
||||
root>/main/tests/core/src/com/ibm/icu/dev/test/serializable/data.
|
||||
5. You may delete older serialization test data from the directory (but keep
|
||||
the oldest one - ICU_3.6).
|
||||
6. Run `ant check` again before committing the changes.
|
||||
1. Run regular ICU4J unit tests `mvn verify` and make sure all tests pass successfully.
|
||||
2. Run `releases_tools/serial_test_data.sh` from `icu4j` directory.
|
||||
3. The new ICU serialization test data folder with version number (e.g. `ICU_75.1`)
|
||||
is generated under `icu4j/target/serialTestData`. (**Note**: The version number in the output
|
||||
folder name comes from `ICU_VERSION` in `VersionInfo.java`. If the version number is still one
|
||||
for SNAPSHOT, such as `75.0.1`, you should update `ICU_VERSION` first.)
|
||||
4. Copy the serialization data folder to `icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/serializable/data`.
|
||||
5. Delete the oldest serialization test data after ICU 3.6 (do not delete ICU_3.6) from the directory.
|
||||
6. Run regular ICU4J unit tests `mvn verify` again.
|
||||
|
||||
@@ -39,7 +39,7 @@ and use it for future testing.
|
||||
2. The target generates test data and runs some serialization test cases.
|
||||
3. Once you confirm the test runs clean, copy
|
||||
`out/serialTestData/ICU_<version>` to
|
||||
`main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_<version>`.
|
||||
`main/core/src/test/resources/com/ibm/icu/dev/test/serializable/data/ICU_<version>`.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ License & terms of use: http://www.unicode.org/copyright.html
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
{:toc}OnlineDemosHowToUpdate
|
||||
|
||||
---
|
||||
|
||||
@@ -33,11 +33,11 @@ merged in from the trunk.
|
||||
|
||||
... to the ICU project site.
|
||||
|
||||
Build the icuapps module following the README's. Update code and/or docs as
|
||||
needed. "Reference" platforms for icuapps are: RedHat Linux and win32. On Linux,
|
||||
icuapps is built against the "make install "'ed ICU. So, run ICU4C's configure
|
||||
Build the icu-demos module following the README's. Update code and/or docs as
|
||||
needed. "Reference" platforms for icu-demos are: RedHat Linux and win32. On Linux,
|
||||
icu-demos is built against the "make install "'ed ICU. So, run ICU4C's configure
|
||||
with --prefix=/some/where pointing to where ICU4C should be installed, and also
|
||||
follow icuapps's README.
|
||||
follow icu-demos's README.
|
||||
|
||||
Install the new locale explorer and other demos/samples onto the public demo
|
||||
hosting site.
|
||||
@@ -102,23 +102,23 @@ Use the GitHub GUI to create both the "release" and the "tag" at the same time:
|
||||
|
||||
<https://github.com/unicode-org/icu/releases/new>
|
||||
|
||||
Fill in the tag name, such as "release-63-rc" or "release-63-1", and make the
|
||||
target the "maint/maint-xx" branch (such as maint/maint-63).
|
||||
|
||||
Set the title to "ICU 63 RC" or "ICU 63.1". Fill in the description using the
|
||||
1. Fill in the tag name, such as `release-63-rc` or `release-63-1`, and make the
|
||||
target the "maint/maint-xx" branch (such as `maint/maint-63`).
|
||||
1. Set the title to `ICU 63 RC` or `ICU 63.1`.
|
||||
1. Fill in the description using the
|
||||
text from the announcement email. (You can also look at previous releases and
|
||||
possibly re-use some of the generic text, such as links to the API docs, etc.)
|
||||
|
||||
Your screen should look like this:
|
||||
|
||||

|
||||
|
||||
For the release candidate tag, please check the box that says "Pre-Release".
|
||||
|
||||
We no longer need to add the note about Git LFS files, as GitHub now includes
|
||||
them in the auto-generated .zip downloads.
|
||||
|
||||
Click the "Publish Release" button to make the tag.
|
||||
1. Your screen should look like this:
|
||||

|
||||
1. Check the box that says "Set as a pre-release".
|
||||
1. Click the "Publish Release" button to make the tag.
|
||||
1. Additional step only for the GA release:
|
||||
After completing the step above to mark the release as "pre-release",
|
||||
the second step is to wait for the day of the official announcement of the release,
|
||||
and then to edit the Github release entry's settings.
|
||||
1. The first Github release settings change should uncheck the "Set as a pre-release" checkbox,
|
||||
which has the effect of converting the release into a regular release.
|
||||
1. The next settings change should check the box that says "Set as the latest release".
|
||||
|
||||
Note: The "latest" tag is no longer updated. It was agreed by the ICU-TC to be
|
||||
deleted around the 64.2 time-frame, as it doesn't work well with with Git. (You
|
||||
@@ -127,6 +127,9 @@ repository, they might have something different for the "latest" tag).
|
||||
A possible future alternative might be a sym-link folder, or HTTP redirect that
|
||||
points to the latest release.
|
||||
|
||||
We no longer need to add the note about Git LFS files, as GitHub now includes
|
||||
them in the auto-generated .zip downloads.
|
||||
|
||||
#### Maintenance release
|
||||
|
||||
Create the maintenance release tag from the maintenance branch, as above.
|
||||
@@ -146,13 +149,13 @@ copy that to tags/release-4-8. Specify the source revision explicitly via -r so
|
||||
that you don't inadvertently pick up an unexpected changeset. Make sure that the
|
||||
trunk at the source revision is good.~~
|
||||
|
||||
~~We do not tag the data & icuapps trees. Steven Loomis writes on 2011-may-23:~~
|
||||
~~We do not tag the data & icu-demos trees. Steven Loomis writes on 2011-may-23:~~
|
||||
|
||||
> ~~My thought had been (in the CVS days) to take a 'snapshot' of these items.
|
||||
> However, in SVN all you need is a date or a revision number (such as
|
||||
> r30140).~~
|
||||
|
||||
> ~~So, probably, we don't need to tag these two (icuapps or data).~~
|
||||
> ~~So, probably, we don't need to tag these two (idu-demos or data).~~
|
||||
|
||||
> ~~Tools are more important because those tools are actually used in the
|
||||
> release.~~
|
||||
@@ -258,6 +261,7 @@ $ git clone https://github.com/unicode-org/icu-docker.git
|
||||
$ cd icu-docker/src
|
||||
$ git clone --branch release-64-rc --depth 1 https://github.com/unicode-org/icu.git
|
||||
$ cd icu
|
||||
$ git lfs install --local
|
||||
$ git lfs fetch
|
||||
$ git lfs checkout
|
||||
$ cd ../..
|
||||
@@ -283,7 +287,7 @@ run \`make dist\`.
|
||||
|
||||
* Manual process:
|
||||
* Build with MSVC x64 Release. (See the ICU
|
||||
[readme.html](https://github.com/unicode-org/icu/blob/main/icu4c/readme.html)
|
||||
[readme.html](https://github.com/unicode-org/icu/main/blob/icu4c/readme.html)
|
||||
file for details).
|
||||
* Open a command prompt.
|
||||
```
|
||||
@@ -356,11 +360,21 @@ run \`make dist\`.
|
||||
This step publishes pre-processed Unicode property data, which may be ingested by downstream clients such as ICU4X.
|
||||
|
||||
* Using the output from the build bots:
|
||||
* Navigate to the Azure Pipelines artifacts as described in the previous section
|
||||
* Download the files named *icuexportdata_uprops_full.zip* and *icuexportdata_uprops_sample.zip*
|
||||
* Navigate to the Azure Pipeline `C: Create Artifacts from icuexportdata` and download its single artifact (`icuexportdata_output`)
|
||||
* Unzip the file
|
||||
* Rename the `icuexportdata_tag-goes-here.zip` file to the correct tag (replacing slashes with dashes)
|
||||
|
||||
### Signing archives and creating checksums:
|
||||
|
||||
#### Step 0. PGP keys:
|
||||
|
||||
Use your own personal PGP key. Make sure that at least one other member of the
|
||||
ICU-TC has signed your key (so that there's an established chain-of-trust
|
||||
through which your key can be verified). Make sure that your signed public key
|
||||
is included in the `KEYS` file in the root of the ICU repository, so that users
|
||||
of ICU can easily find it there (and won't have to search random keyservers for
|
||||
it), see instructions in that file on how to update it.
|
||||
|
||||
#### Step 1. PGP files:
|
||||
|
||||
Sign all archives created above with your own personal PGP key. This creates a
|
||||
@@ -440,11 +454,27 @@ the new ICU version.
|
||||
|
||||
## Update online demos
|
||||
|
||||
Update online demos/tools to the latest version:
|
||||
These are the online demos/tools that need to be updated to the latest version.
|
||||
|
||||
* Be sure to verify that the deployed version is publicly available.
|
||||
|
||||
Note that updating ICU4C demos online requires Gcloud access.
|
||||
|
||||
### ICU4C demos
|
||||
* [Run ICU4C demos](https://icu4c-demos.unicode.org/icu-bin/idnbrowser)
|
||||
|
||||
* [Demo described here](https://github.com/unicode-org/icu-demos/blob/main/README.md)
|
||||
|
||||
* [Building and deploying from GCloud](https://github.com/unicode-org/icu-demos//blob/main/README.md)
|
||||
|
||||
### ICU4J demos
|
||||
|
||||
* [Run ICU4J online demos](https://icu4j-demos.unicode.org/icu4jweb/)
|
||||
|
||||
* [Information on the Java demos and samples](https://icu.unicode.org/home/icu4j-demos)
|
||||
|
||||
* [Instructions for building and deploying updates](https://github.com/unicode-org/icu-demos/blob/main/icu4jweb/README.md)
|
||||
|
||||
* ICU demos (eg <https://icu4c-demos.unicode.org/icu-bin/idnbrowser>)
|
||||
* CLDR Survey tool (eg <http://unicode.org/cldr/apps/about.jsp>)
|
||||
* Unicode Utilities (eg <http://unicode.org/cldr/utility/character.jsp>)
|
||||
|
||||
### Online information update
|
||||
|
||||
@@ -506,9 +536,9 @@ Jira.
|
||||
## Update readme
|
||||
|
||||
Update [ICU4C
|
||||
readme.html](https://github.com/unicode-org/icu/blob/main/icu4c/readme.html)
|
||||
readme.html](https://github.com/unicode-org/icu/main/icu4c/readme.html)
|
||||
and [ICU4J
|
||||
readme.html](https://github.com/unicode-org/icu/blob/main/icu4j/readme.html)
|
||||
readme.html](https://github.com/unicode-org/icu/main/icu4j/readme.html)
|
||||
before every milestone (GA / RC / Milestone-N). Make sure the following items
|
||||
are up to date.
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ After syncing CLDR data with ICU do the following. This documentation assumes
|
||||
that you are updating the MeasureUnit clases for ICU 68.
|
||||
|
||||
* Check out
|
||||
$GIT_ROOT/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java
|
||||
$GIT_ROOT/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java
|
||||
* Open MeasureUnitTest.java.
|
||||
* Find the `testZZZ` test, its code should all be commented out. This test will
|
||||
execute last and will run the desired code.
|
||||
@@ -57,7 +57,7 @@ that you are updating the MeasureUnit clases for ICU 68.
|
||||
* Change `testZZZ` to run `generateConstants(“68”); // ICU 68.`
|
||||
* Run MeasureUnitTest.java, copy the generated code (see instructions above).
|
||||
* Open MeasureUnit.java:
|
||||
$GIT_ROOT/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java
|
||||
$GIT_ROOT/icu4j/main/core/src/main/java/com/ibm/icu/util/MeasureUnit.java
|
||||
* Look for line containing:
|
||||
|
||||
`// Start generated MeasureUnit constants`
|
||||
|
||||
@@ -73,15 +73,13 @@ Edit icuver.txt directly.
|
||||
|
||||
1. The instructions for updating the version number are in
|
||||
[icu4c/source/common/unicode/uvernum.h](https://github.com/unicode-org/icu/blob/main/icu4c/source/common/unicode/uvernum.h).
|
||||
2. [icu4c/source/stubdata/stubdata.vcxproj](https://github.com/unicode-org/icu/blob/main/icu4c/source/stubdata/stubdata.vcxproj)
|
||||
and
|
||||
[icu4c/source/data/makedata.mak](https://github.com/unicode-org/icu/blob/main/icu4c/source/data/makedata.mak)
|
||||
may also need to updated with the correct version for icudt.
|
||||
3. After uvernum.h is updated, the Windows project files should be updated by
|
||||
running the UNIX makefile target '**update-windows-makefiles**' in
|
||||
icu/source.
|
||||
* You will need to rerun "./configure" first though before you can run the
|
||||
command "make update-windows-makefiles".
|
||||
2. [icu4c/source/data/makedata.mak](https://github.com/unicode-org/icu/blob/main/icu4c/source/data/makedata.mak)
|
||||
also needs to be updated with the correct version for `U_ICUDATA_NAME` (icudt).
|
||||
3. After `uvernum.h` is updated, the file [Build.Windows.IcuVersion.props](https://github.com/unicode-org/icu/blob/main/icu4c/source/allinone/Build.Windows.IcuVersion.props) should be updated.
|
||||
This can be done by hand, or by running the UNIX makefile target '**update-windows-makefiles**'
|
||||
in `icu4c/source`.
|
||||
* You will need to rerun "`./configure`" first though before you can run the
|
||||
command "`make update-windows-makefiles`".
|
||||
* Note: You can use MSYS+MinGW to run the UNIX makefile on Windows
|
||||
platforms as well.
|
||||
4. As well, the ICU4C "configure" script should be updated so that it reflects
|
||||
@@ -94,6 +92,122 @@ Edit icuver.txt directly.
|
||||
|
||||
### ICU4J
|
||||
|
||||
#### Since ICU 74
|
||||
|
||||
Changing the version for Java starting with ICU 74 requires a few steps:
|
||||
|
||||
1. [icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java)
|
||||
|
||||
There is a static block starting at line 501 (as of 54.1) in the source file.
|
||||
|
||||
Update the `ICU_VERSION` value, where the first three arguments represent the
|
||||
major, minor, and patch versions of a semantic version.
|
||||
Use the `getInstance(<major>, 0, 1, 0)` as the version during pre-release development,
|
||||
and use `getInstance(<major>, 1, 0, 0)` to indicate a GA release version.
|
||||
See the section on "ICU Version Number" for the version numbers to use during the BRS tasks for
|
||||
each phase of the release process.
|
||||
|
||||
<pre>
|
||||
/**
|
||||
* Initialize versions only after MAP_ has been created
|
||||
*/
|
||||
static {
|
||||
UNICODE_1_0 = getInstance(1, 0, 0, 0);
|
||||
UNICODE_1_0_1 = getInstance(1, 0, 1, 0);
|
||||
UNICODE_1_1_0 = getInstance(1, 1, 0, 0);
|
||||
UNICODE_1_1_5 = getInstance(1, 1, 5, 0);
|
||||
UNICODE_2_0 = getInstance(2, 0, 0, 0);
|
||||
UNICODE_2_1_2 = getInstance(2, 1, 2, 0);
|
||||
UNICODE_2_1_5 = getInstance(2, 1, 5, 0);
|
||||
UNICODE_2_1_8 = getInstance(2, 1, 8, 0);
|
||||
UNICODE_2_1_9 = getInstance(2, 1, 9, 0);
|
||||
UNICODE_3_0 = getInstance(3, 0, 0, 0);
|
||||
UNICODE_3_0_1 = getInstance(3, 0, 1, 0);
|
||||
UNICODE_3_1_0 = getInstance(3, 1, 0, 0);
|
||||
UNICODE_3_1_1 = getInstance(3, 1, 1, 0);
|
||||
UNICODE_3_2 = getInstance(3, 2, 0, 0);
|
||||
UNICODE_4_0 = getInstance(4, 0, 0, 0);
|
||||
UNICODE_4_0_1 = getInstance(4, 0, 1, 0);
|
||||
UNICODE_4_1 = getInstance(4, 1, 0, 0);
|
||||
UNICODE_5_0 = getInstance(5, 0, 0, 0);
|
||||
UNICODE_5_1 = getInstance(5, 1, 0, 0);
|
||||
UNICODE_5_2 = getInstance(5, 2, 0, 0);
|
||||
UNICODE_6_0 = getInstance(6, 0, 0, 0);
|
||||
UNICODE_6_1 = getInstance(6, 1, 0, 0);
|
||||
UNICODE_6_2 = getInstance(6, 2, 0, 0);
|
||||
UNICODE_6_3 = getInstance(6, 3, 0, 0);
|
||||
UNICODE_7_0 = getInstance(7, 0, 0, 0);
|
||||
<b>
|
||||
ICU_VERSION = getInstance(74, 1, 0, 0);
|
||||
ICU_DATA_VERSION = ICU_VERSION;</b>
|
||||
UNICODE_VERSION = UNICODE_7_0;
|
||||
|
||||
UCOL_RUNTIME_VERSION = getInstance(8);
|
||||
UCOL_BUILDER_VERSION = getInstance(9);
|
||||
UCOL_TAILORINGS_VERSION = getInstance(1);
|
||||
}
|
||||
</pre>
|
||||
|
||||
In the same file, starting at line 164 (as of 54.1) -
|
||||
|
||||
<pre>
|
||||
/**
|
||||
* Data version string for ICU's internal data.
|
||||
* Used for appending to data path (e.g. icudt43b)
|
||||
* @internal
|
||||
* @deprecated This API is ICU internal only.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String <b>ICU_DATA_VERSION_PATH = "74b";</b>
|
||||
</pre>
|
||||
|
||||
2. When creating the final release of a major ICU version,
|
||||
or a point release (minor version update on a maintenance branch),
|
||||
update the Maven project version for ICU4J at the root (`icu4j/pom.xml`) and all of the submodules
|
||||
with the following Maven command.
|
||||
The command requires a version number string that follows the typical Java / Maven version number conventions.
|
||||
|
||||
The following examples illustrate the version numbers to use during and after the ICU 74 release:
|
||||
|
||||
* For an ICU major version change's final release, use: `74.1`
|
||||
* On the `main` branch in the commit after the commit from which the release branch was cut,
|
||||
use: `75.0.1-SNAPSHOT`
|
||||
* For a point release (ICU minor version change), use: `74.2`
|
||||
* On the maintenance branch (ex: `maint/maint-74`) in the commit after the commit creating the point release, use: `74.2.1-SNAPSHOT`
|
||||
|
||||
**Note:** for the public-facing Maven version number, we only use the major and minor versions of
|
||||
the semantic version. In other words, we use version `74.1`, not `74.1.0`.
|
||||
|
||||
With the proper new version number, run the following Maven command to update the version numbers
|
||||
throughout all of the ICU4J `pom.xml` build files.
|
||||
|
||||
```
|
||||
mvn versions:set -DnewVersion=74.1 -DgenerateBackupPoms=false
|
||||
```
|
||||
|
||||
3. Immediately after creating the final release of a major ICU version, update the value that represents just the major version number of the semantic version. To do this, update the value of the ICU `icu.major.version` property in the root Maven pom.xml file at `icu4j/pom.xml`.
|
||||
|
||||
This can be done by running the following command:
|
||||
|
||||
```
|
||||
mvn versions:set-property -DnewVersion=74 -Dproperty=icu.major.version
|
||||
```
|
||||
|
||||
This should happen at the same time and along with the work in the previous step for the version number
|
||||
when the version number is updated on `main` in the commit after the release/maintanence branch is cut.
|
||||
In other words, the above `versions:set-property` step should be executed at the same time
|
||||
`mvn versions:set -DnewVersion=74.0.1-SNAPSHOT` is executed.
|
||||
|
||||
4. Update the following variables in `icu4j/releases_tools/shared.sh`
|
||||
|
||||
* `artifact_version` - The version used in the Maven `pom.xml` files. You can alternatively produce this value by running `mvn help:evaluate -Dexpression=project.version -q -DforceStdout`.
|
||||
* `github_rel_version` - The version used in the name of the GitHub downloadable artifacts. For example "73_2" or "74rc".
|
||||
* `api_report_version` - The major version of the new version. Change during RC BRS.
|
||||
* `api_report_prev_version` - The major version of the previous version. Change during RC BRS.
|
||||
|
||||
|
||||
#### Until ICU 73 (inclusive)
|
||||
|
||||
Since ICU4J 4.6, you can quickly check the current version information by
|
||||
running jar main in icu4j.jar. For example,
|
||||
|
||||
@@ -148,9 +262,16 @@ For updating ICU version numbers, follow the steps below.
|
||||
number such as "60.1" for official releases, "61.1-SNAPSHOT" until 61.1
|
||||
release, after 60.1.
|
||||
|
||||
3. [icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java)
|
||||
3. [icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java)
|
||||
|
||||
There is a static block starting at line 501 (as of 54.1) in the source file -
|
||||
There is a static block starting at line 501 (as of 54.1) in the source file.
|
||||
|
||||
Update the `ICU_VERSION` value, where the first three arguments represent the
|
||||
major, minor, and patch versions of a semantic version.
|
||||
Use the `getInstance(major, 0, 1, 0)` as the version during pre-release development,
|
||||
and use `getInstance(major, 1, 0, 0)` to indicate a GA release version.
|
||||
See the section on "ICU Version Number" for the version numbers to use during the BRS tasks for
|
||||
each phase of the release process.
|
||||
|
||||
<pre>
|
||||
/**
|
||||
@@ -272,7 +393,7 @@ For updating ICU version numbers, follow the steps below.
|
||||
example, see
|
||||
[tags/release-4-4-2-eclipse37-20110208/eclipse-build/build.properties](http://source.icu-project.org/repos/icu/tags/icu4j/release-4-4-2-eclipse37-20110208/eclipse-build/build.properties).
|
||||
|
||||
7. [DebugUtilitiesData.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DebugUtilities.java)
|
||||
7. [DebugUtilitiesData.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/util/DebugUtilities.java)
|
||||
|
||||
This file is automatically generated when data is generated for ICU4J. The
|
||||
ICU4C version number string should be check to ensure that the correct
|
||||
|
||||
@@ -113,7 +113,7 @@ These rules will match "`abc`", "`hello_world`", `"hi-there"`,
|
||||
They will not match "`-abc`", "`multiple__joiners`", "`tail-`"
|
||||
|
||||
A full match is composed of pieces or submatches, possibly from different rules,
|
||||
with adjacent submatches linked by at least one overlapping character.
|
||||
with adjacent submatches linked by one overlapping character.
|
||||
|
||||
In the example below, matching "`hello_world`",
|
||||
|
||||
@@ -206,15 +206,6 @@ Chaining into a rule can be dis-allowed by beginning that rule with a '`^`'. Rul
|
||||
so marked can begin a match after a preceding boundary or at the start of text,
|
||||
but cannot extend a match via chaining from another rule.
|
||||
|
||||
~~The !!LBCMNoChain; statement modifies chaining behavior by preventing chaining
|
||||
from one rule to another from occurring on any character whose Line Break
|
||||
property is Combining Mark. This option is subject to change or removal, and
|
||||
should not be used in general. Within ICU, it is used only with the line break
|
||||
rules. We hope to replace it with something more general.~~
|
||||
|
||||
> :point_right: **Note**: `!!LBCMNoChain` is deprecated, and will be removed
|
||||
> completely from a future version of ICU.
|
||||
|
||||
## Rule Status Values
|
||||
|
||||
Break rules can be tagged with a number, which is called the *rule status*.
|
||||
@@ -293,7 +284,6 @@ See, for example, this snippet from the [line break rules](https://github.com/un
|
||||
| ~~`!!reverse`~~ | ~~*[deprecated]* The rules that follow are for reverse iteration. No longer needed; any rules in a Reverse rule section are ignored.~~ |
|
||||
| ~~`!!safe_forward`~~ | ~~*[deprecated]* The rules that follow are for safe forward iteration. No longer needed; any rules in such a section are ignored.~~ |
|
||||
| ~~`!!safe_reverse`~~ | ~~*[deprecated]* The rules that follow are for safe reverse iteration. No longer needed; any rules in such a section are ignored.~~ |
|
||||
| ~~`!!LBCMNoChain`~~ | ~~*[deprecated]* Disable chaining when the overlap character matches `\p{Line_Break=Combining_Mark}`~~ |
|
||||
|
||||
## Rule Syntax
|
||||
|
||||
@@ -377,22 +367,17 @@ Here is the syntax for the boundary rules. (The EBNF Syntax is given below.)
|
||||
exclamation `!`. This syntax is deprecated, and will be removed from a
|
||||
future version of ICU.
|
||||
|
||||
2. `!!LBCMNoChain` was a global option that specified that characters with the
|
||||
line break property of "Combining Character" would not participate in rule
|
||||
chaining. This option was always considered internal, is deprecated and will
|
||||
be removed from a future version of ICU.
|
||||
|
||||
3. Naked rule characters. Plain text, in the context of a rule, is treated as
|
||||
2. Naked rule characters. Plain text, in the context of a rule, is treated as
|
||||
literal text to be matched, much like normal regular expressions. This turns
|
||||
out to be very error prone, has been the source of bugs in released versions
|
||||
of ICU, and is not useful in implementing normal text boundary rules. A
|
||||
future version will reject literal text that is not escaped.
|
||||
|
||||
4. Exact reverse rules and safe forward rules: planned changes to the break
|
||||
3. Exact reverse rules and safe forward rules: planned changes to the break
|
||||
engine implementation will remove the need for exact reverse rules and safe
|
||||
forward rules.
|
||||
|
||||
5. `{bof}` and `{eof}`, appearing within `[`sets`]`, match the beginning or ending of
|
||||
4. `{bof}` and `{eof}`, appearing within `[`sets`]`, match the beginning or ending of
|
||||
the input text, respectively. This is an internal (not documented) feature
|
||||
that will probably be removed in a future version of ICU. They are currently
|
||||
used by the standard rules for word, line and sentence breaking. An
|
||||
|
||||
@@ -350,10 +350,10 @@ UBool isWholeWord(BreakIterator& wordBrk,
|
||||
int32_t start,
|
||||
int32_t end) {
|
||||
if (s.isEmpty())
|
||||
return FALSE;
|
||||
return false;
|
||||
wordBrk.setText(s);
|
||||
if (!wordBrk.isBoundary(start))
|
||||
return FALSE;
|
||||
return false;
|
||||
return wordBrk.isBoundary(end);
|
||||
}
|
||||
```
|
||||
@@ -367,10 +367,10 @@ UBool isWholeWord(UBreakIterator* wordBrk,
|
||||
int32_t start,
|
||||
int32_t end,
|
||||
UErrorCode* err) {
|
||||
UBool result = FALSE;
|
||||
UBool result = false;
|
||||
if (wordBrk == NULL || s == NULL) {
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
ubrk_setText(wordBrk, s, sLen, err);
|
||||
if (U_SUCCESS(*err)) {
|
||||
|
||||
@@ -232,7 +232,7 @@ It has been replaced by the maxVariable option.
|
||||
- `[normalization on]`
|
||||
|
||||
Turns on or off the UCOL_NORMALIZATION_MODE attribute.
|
||||
If set to on, a quick check and neccessary normalization will be performed.
|
||||
If set to on, a quick check and necessary normalization will be performed.
|
||||
|
||||
#### strength
|
||||
- `[strength 1]`
|
||||
|
||||
@@ -53,7 +53,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
||||
UCollator *myCollator = 0;
|
||||
if (U_FAILURE(*status))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
u_uastrcpy(source, "This is a test.");
|
||||
u_uastrcpy(target, "THIS IS A TEST.");
|
||||
@@ -63,7 +63,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
||||
/*Report the error with display name... */
|
||||
fprintf(stderr,
|
||||
"Failed to create the collator for : \"%s\"\n", dispName);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
result = ucol_strcoll(myCollator, source, u_strlen(source), target, u_strlen(target));
|
||||
/* result is 1, secondary differences only for ignorable space characters*/
|
||||
@@ -71,7 +71,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with only secondary differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* To compare them with just primary differences */
|
||||
ucol_setStrength(myCollator, UCOL_PRIMARY);
|
||||
@@ -81,7 +81,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with no differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Now, do the same comparison with keys */
|
||||
@@ -93,10 +93,10 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with sort keys in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
ucol_close(myCollator);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -122,7 +122,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
||||
Collator *myCollator = 0;
|
||||
if (U_FAILURE(status))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
myCollator = Collator::createInstance(locale, status);
|
||||
if (U_FAILURE(status)){
|
||||
@@ -130,7 +130,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
||||
/*Report the error with display name... */
|
||||
fprintf(stderr,
|
||||
"%s: Failed to create the collator for : \"%s\"\n", dispName);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
result = myCollator->compare(source, target);
|
||||
/* result is 1, secondary differences only for ignorable space characters*/
|
||||
@@ -138,7 +138,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with only secondary differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* To compare them with just primary differences */
|
||||
myCollator->setStrength(Collator::PRIMARY);
|
||||
@@ -148,7 +148,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with no differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* Now, do the same comparison with keys */
|
||||
myCollator->getCollationKey(source, sourceKey, status);
|
||||
@@ -160,10 +160,10 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: Comparing two strings with sort keys in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
delete myCollator;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -175,7 +175,7 @@ int main()
|
||||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
fprintf(stdout, "\n");
|
||||
if (collateWithLocaleInCPP(Locale("en", "US"), status) != TRUE)
|
||||
if (collateWithLocaleInCPP(Locale("en", "US"), status) != true)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Collate with locale in C++ failed.\n");
|
||||
@@ -185,7 +185,7 @@ int main()
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
fprintf(stdout, "\n");
|
||||
if (collateWithLocaleInC("en_US", &status) != TRUE)
|
||||
if (collateWithLocaleInC("en_US", &status) != true)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: Collate with locale in C failed.\n");
|
||||
|
||||
@@ -350,7 +350,7 @@ UConverter* newCnv = ucnv_safeClone(oldCnv, 0, &bufferSize, &err)
|
||||
|
||||
3. In conversions to Unicode from Multi-byte encodings or conversions from
|
||||
Unicode involving surrogates, if (a) only a partial byte sequence is
|
||||
retrieved from the source buffer, (b) the "flush" parameter is set to "TRUE"
|
||||
retrieved from the source buffer, (b) the "flush" parameter is set to "true"
|
||||
and (c) the end of source is reached, then the callback is called with
|
||||
`U_TRUNCATED_CHAR_FOUND`.
|
||||
|
||||
@@ -368,7 +368,7 @@ calling:
|
||||
direction.
|
||||
|
||||
The converters are reset implicitly when the conversion functions are called
|
||||
with the "flush" parameter set to "TRUE" and the source is consumed.
|
||||
with the "flush" parameter set to "true" and the source is consumed.
|
||||
|
||||
### Error
|
||||
|
||||
@@ -774,12 +774,12 @@ can be used.
|
||||
In such a scenario, the inner write does not occur unless a buffer overflow
|
||||
occurs OR 'flush' is true. So, the 'write' and resetting of the target and
|
||||
targetLimit pointers would only happen
|
||||
`if (err == U_BUFFER_OVERFLOW_ERROR || flush == TRUE)`
|
||||
`if (err == U_BUFFER_OVERFLOW_ERROR || flush == true)`
|
||||
|
||||
The flush parameter on each conversion call should be set to FALSE, until the
|
||||
The flush parameter on each conversion call should be set to false, until the
|
||||
conversion call is called for the last time for the buffer. This is because the
|
||||
conversion is stateful. On the last conversion call, the flush parameter should
|
||||
be set to TRUE. More details are mentioned in the API reference in
|
||||
be set to true. More details are mentioned in the API reference in
|
||||
[ucnv.h](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucnv_8h.html) .
|
||||
|
||||
### 4. Pre-flighting
|
||||
|
||||
@@ -256,7 +256,7 @@ static char buffer[BUFFER_SIZE] = {....};
|
||||
int32_t inputLength = ... // length of the input text
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ucsdet_setText(csd, buffer, inputLength, &status);
|
||||
ucsdet_enableInputFilter(csd, TRUE);
|
||||
ucsdet_enableInputFilter(csd, true);
|
||||
ucm = ucsdet_detect(csd, &status);
|
||||
```
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ Unicode.
|
||||
references](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucnv_8h.html) .
|
||||
|
||||
7. For data exchange (rather than pure display), turn off fallback
|
||||
mappings: `ucnv_setFallback(cnv, FALSE)`;
|
||||
mappings: `ucnv_setFallback(cnv, false)`;
|
||||
|
||||
8. For some text formats, especially XML and HTML, it is possible to set an
|
||||
"escape callback" function that turns unmappable Unicode code points
|
||||
|
||||
@@ -76,7 +76,7 @@ of classes. This protocol includes:
|
||||
|
||||
* A programmatic ID, for example, "America/Los_Angeles". This ID is used to
|
||||
call up a specific real-world time zone. It corresponds to the IDs defined
|
||||
in the [IANA Time Zone datbase](https://www.iana.org/time-zones) used by UNIX
|
||||
in the [IANA Time Zone database](https://www.iana.org/time-zones) used by UNIX
|
||||
and other systems, and has the format continent/city or ocean/city.
|
||||
* A raw offset. This is the difference, in milliseconds, between a time zone's
|
||||
standard time and GMT. Positive raw offsets are east of Greenwich.
|
||||
@@ -245,7 +245,7 @@ sources for general information on building ICU.
|
||||
|
||||
### Update the time zone data for ICU4J
|
||||
|
||||
The [ICU4J Time Zone Update Update
|
||||
The [ICU4J Time Zone Update
|
||||
Utility](https://icu.unicode.org/download/icutzu) automates the process of
|
||||
updating ICU4J jar files with the latest time zone data. Instructions for use
|
||||
are [here](https://htmlpreview.github.io/?https://github.com/unicode-org/icu-data/blob/main/tzdata/tzu/readme.html).
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
---
|
||||
layout: default
|
||||
title: Continuous Integration
|
||||
parent: Contributors
|
||||
---
|
||||
|
||||
# Continuous Integration
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2024 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
ICU is tested thoroughly through a variety of tests
|
||||
(unit tests, integration tests, exhaustive tests, fuzzer tests).
|
||||
Many tests are specific to ICU4C or ICU4J individually,
|
||||
using the language specific testing setups tools
|
||||
(ex: ICU4C's C++ `intltest` and C `cintltest` for unit tests,
|
||||
ICU4J's unit tests in JUnit).
|
||||
|
||||
ICU uses Continuous Integration systems to run these tests automatically for each new code contribution,
|
||||
and upon each update to a future contribution under development
|
||||
(that is: for each [successful Pull Request merge, and upon a new push of new git commits to a Pull Request](../gitdev.md)).
|
||||
ICU has 2 systems configured to run Continuous Integration testing:
|
||||
|
||||
* Github Actions
|
||||
* Azure Pipelines
|
||||
|
||||
Continuous Integration systems can also be used to regularly and automatically run other tasks besides testing.
|
||||
ICU uses a CI workflow to automatically publish changes to its User Guide that is hosted on Github Pages.
|
||||
|
||||
## General ICU Settings for CI
|
||||
|
||||
### Automated Testing Enforcement
|
||||
|
||||
The value of automated testing isn't fully realized unless its enforcement is also automatic.
|
||||
|
||||
Individual tests can be configured in the ICU Github repository:
|
||||
|
||||
1. "Settings" tab for [`unicode-org/icu`](https://github.com/unicode-org/icu/)
|
||||
2. "Branches"
|
||||
3. "Branch protection rules"
|
||||
4. Choose one of the rule sets and click "Edit". ***Note: all rule sets should be changed in the same way***
|
||||
5. Ensure that "Require status checks to pass before merging" is enabled
|
||||
6. Underneath that enabled checkbox, the table "Status checks that are required." lists the currently enabled tests ("checks") that must pass before a Pull Request can be merged to the branch
|
||||
7. If a new test (check) needs to be added, use the search box above the table and type the display name of the check, then click on it in the drop down list to add it to the table of required checks.
|
||||
|
||||
|
||||
## Github Actions
|
||||
|
||||
ICU uses [Github Actions](https://github.com/features/actions) to run unit tests, environment tests, deployments of the User Guide, etc.
|
||||
|
||||
### Workflow files
|
||||
|
||||
Workflow files are in YAML form stored at `.github/workflows/`.
|
||||
|
||||
### UI Dashboard
|
||||
|
||||
All workflow instances/runs show up in the ["Actions" tab](https://github.com/unicode-org/icu/actions) of the repository,
|
||||
using the display name that was set for the workflow.
|
||||
All of the runs can be filtered by the Workflow name and/or by the Pull Request (via the Branch filter).
|
||||
|
||||
Each PR will show the status of the current/latest run of each job in the "Checks" section of the Pull Request's main page (Conversation tab),
|
||||
with special details and logs being navigable in the Checks tab.
|
||||
|
||||
### Configuration
|
||||
|
||||
#### Jobs
|
||||
|
||||
Jobs can be added, removed, and edited merely by editing the YAML workflow files.
|
||||
|
||||
#### Conditional Triggers
|
||||
|
||||
Workflow files can be conditionally triggered based on many factors.
|
||||
A few of the useful factors:
|
||||
|
||||
* whether the trigger event is a push to a pull request, or the merge of a pull request, or a manual request
|
||||
* the name of the originating branch for the trigger event
|
||||
* whether the files modified in a pull request belong to certain file paths
|
||||
|
||||
ICU uses the file path matching condition to run ICU4J or ICU4C tests respectively only when their corresponding directories `icu4j` and `icu4c` contain file changes.
|
||||
Thus, there is a separate workflow for ICU4J and ICU4C,
|
||||
each with its own separate set of trigger conditions based on their corresponding file paths.
|
||||
User Guide deployments are similarly run conditionally only when the `docs` directory has changed.
|
||||
Some tests that are commonly needed or cross boundaries of concern are always run.
|
||||
|
||||
Some long-running tests are run once a week using a cronjob-like schedule trigger.
|
||||
|
||||
Some workflows exist to interact with the Github Actions platform,
|
||||
such as keeping the cache alive for Maven artifacts due to the [noticeable flakiness that PRs face](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows) without the cache.
|
||||
Because of a [cache eviction policy](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy), which affects any subsequent PRs until they are merged,
|
||||
it is easier to keep the cache alive in an automated way using a cronjob-like schedule trigger whose repetition period is shorter than the eviction period.
|
||||
|
||||
### Caveats
|
||||
|
||||
Github branch protection rules are not capable of appropriately handling jobs from a conditionally triggered workflow.
|
||||
In other words, we cannot currently configure the required checks to include a job from the ICU4J workflow,
|
||||
because if a PR does not include ICU4J code changes,
|
||||
the workflow will not run and Github is not capable of ignoring the check in that scenario. Furthermore, workflow conditional triggers can only be triggered at the workflow level, not the job level.
|
||||
|
||||
Open Source users can now access machines with [at least 4 cores available per job](https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/).
|
||||
|
||||
## Azure Pipelines
|
||||
|
||||
ICU also uses [Azure Pipelines](https://azure.microsoft.com/en-us/products/devops/pipelines) to run CI jobs.
|
||||
|
||||
### Workflow files
|
||||
|
||||
Workflow files are in YAML form stored at `.ci-builds/`.
|
||||
|
||||
### UI Dashboard
|
||||
|
||||
All Azure piplines show up in the
|
||||
[Azure Piplines ICU project dashboard](https://dev.azure.com/ms/icu/),
|
||||
specifically in the
|
||||
[Pipelines page](https://dev.azure.com/ms/icu/_build).
|
||||
|
||||
After clicking on a specific pipeline,
|
||||
all of the instances/runs for that pipeline appear.
|
||||
All of the runs can be filtered in the Branch filter by the destination branch name (ex: `main`) or the PR number (ex: `2874`).
|
||||
|
||||
### Configuration
|
||||
|
||||
#### Initial Setup with Github.
|
||||
|
||||
The upstream Github repo needs to be connected to Azure Pipelines in order for Azure Pipelines to listen for and trigger new pipelines based on events occuring in Github,
|
||||
and to return the status back to Github.
|
||||
This configuration is started by ensuring that the upstream ICU repo `unicode-org/icu` has the Azure Pipelines 3rd party app installed from the Github Marketplace.
|
||||
|
||||
Once installed, the app will appear in the repo's Github "Settings" page under "Integrations" > "Github Apps".
|
||||
|
||||
In order to configure a newly pipeline in Azure using the Github app for Azure Pipelines, you must do:
|
||||
|
||||
1. Create and check-in a new YAML file in the icu repo at `.ci-builds/`
|
||||
2. In the repo settings, go to "Github Apps"
|
||||
3. In the Installed GitHub Apps section, click option to configure "Azure Pipelines".
|
||||
4. A page to update Azure Pipeline's repository access apears next. Click on "Update access".
|
||||
5. Next a page to authenticate with your Microsoft credentials appear. Sign in with Microsoft credentials.
|
||||
6. Select ADO org as `ms` and project as `icu`, click on continue.
|
||||
7. After authentication from Azure and Github, you come to the new pipeline wizard.
|
||||
8. Select repo as `unicode-org/icu` and select "Existing Azure Pipelines YAML file" and choose the yaml file created in step #1
|
||||
9. Review YAML file and click save. You will find a new pipeline created with name `unicode-org.icu`. Rename it to a more appropriate name
|
||||
|
||||
***The pipline should now run as per the YAML rules and would be visible from Github settings for branch protection.***
|
||||
|
||||
|
||||
#### Jobs
|
||||
|
||||
Jobs can be added, removed, and edited merely by editing the YAML workflow files.
|
||||
|
||||
The syntax for Azure Pipelines workflows is very similar to Github Actions, including the YAML format.
|
||||
However, there are noteworthy differences in functionality and the expression of equivalent configurations aross the systems and syntaxes.
|
||||
|
||||
#### Conditional Triggers
|
||||
|
||||
Conditional triggers can be configured for Azure Pipelines similarly to Github Actions.
|
||||
|
||||
Note: The triggers for merges to a branch (ex: `main`) may need to be duplicated into a separate trigger section for Pull Requests because they seem to be handled differently.
|
||||
|
||||
### Caveats
|
||||
|
||||
In order to set up a pipeline, a person must simultaneously have access to the Azure Pipelines project for ICU and to the Github ICU repository.
|
||||
|
||||
If an Azure Pipeline only has one job,
|
||||
that job might not be shown on a PR's main page within the list of all of the running CI checks.
|
||||
There will only be an entry with the pipeline name in the list of checks.
|
||||
However, if an Azure Pipeline has multiple jobs,
|
||||
then each of the constituent jobs of the pipeline will be represent in the list of checks,
|
||||
in addition to an entry for the pipeline itself.
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
layout: default
|
||||
title: Coding Guidelines
|
||||
nav_order: 1
|
||||
parent: Contributors
|
||||
---
|
||||
<!--
|
||||
@@ -460,6 +459,7 @@ Starting with ICU 68 (2020q4), we no longer define these in public header files
|
||||
(unless `U_DEFINE_FALSE_AND_TRUE`=1),
|
||||
in order to avoid name collisions with code outside ICU defining enum constants and similar
|
||||
with these names.
|
||||
Starting with ICU 72 (2022q4), we no longer use these anywhere in ICU.
|
||||
|
||||
Instead, the versions of the C and C++ standards we require now do define type `bool`
|
||||
and values `false` & `true`, and we and our users can use these values.
|
||||
@@ -540,7 +540,7 @@ u_formatMessage(...);
|
||||
```
|
||||
|
||||
> :point_right: **Note**: The `U_CAPI`/`U_DEPRECATED` and `U_EXPORT2` qualifiers
|
||||
> are required for both the declaration and the definiton of *exported C and
|
||||
> are required for both the declaration and the definition of *exported C and
|
||||
> static C++ functions*. Use `U_CAPI` (or `U_DEPRECATED`) before and `U_EXPORT2`
|
||||
> after the return type of *exported C and static C++ functions*.
|
||||
>
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Contributions
|
||||
nav_order: 4
|
||||
parent: Contributors
|
||||
---
|
||||
<!--
|
||||
© 2020 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Contributions to the ICU library
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
## Why Contribute?
|
||||
|
||||
ICU is an open source library that is a de-facto industry standard for
|
||||
internationalization libraries. Our goal is to provide top of the line i18n
|
||||
support on all widely used platforms. By contributing your code to the ICU
|
||||
library, you will get the benefit of continuing improvement by the ICU team and
|
||||
the community, as well as testing and multi-platform portability. In addition,
|
||||
it saves you from having to re-merge your own additions into ICU each time you
|
||||
upgrade to a new ICU release.
|
||||
|
||||
## Current Process
|
||||
|
||||
See <https://icu.unicode.org/processes/contribute>.
|
||||
|
||||
## Historical
|
||||
|
||||
### Legal Issues ICU 1.8.1-57
|
||||
|
||||
The following process was in place up to ICU 57, when the old ICU license was
|
||||
used.
|
||||
|
||||
### Old Process
|
||||
|
||||
In order for your code to be contributed, you need to assign to IBM joint
|
||||
copyright ownership in the contribution. You retain joint ownership in the
|
||||
contribution without restriction. (For the complete set of terms, please see the
|
||||
forms mentioned below.)
|
||||
|
||||
The sections below describe two processes, for one-time and ongoing
|
||||
contributors. In either case, please complete the form(s) electronically and
|
||||
send it/them to IBM for review. After review by IBM, please print and sign the
|
||||
form(s), send it/them by mail, and send the code. The code will then be
|
||||
evaluated.
|
||||
|
||||
Please consult a legal representative if you do not understand the implications
|
||||
of the copyright assignment.
|
||||
|
||||
### One-Time Contributors
|
||||
|
||||
If you would like to make a contribution only once or infrequently, please use
|
||||
the *Joint Copyright Assignment - One-time Contribution* form.
|
||||
(<https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/Copyright_Assignment.rtf>).
|
||||
The contribution will be identified by a bug ID which is unique to the
|
||||
contribution and entered into the form. Therefore, please make sure that there
|
||||
is an appropriate bug (or Request For Enhancement) in the ICU bug database, or
|
||||
submit one.
|
||||
|
||||
The code contribution will be checked into a special part of the ICU source code
|
||||
repository and evaluated. The ICU team may request updates, for example for
|
||||
better conformance with the ICU [design](../design.md) principles,
|
||||
[coding](codingguidelines.md) and testing guidelines, or performance. (See also
|
||||
the Requirements (§) above.) Such updates can be contributed without exchanging
|
||||
another form: An ICU team member commits related materials into the ICU source
|
||||
code repository using the same bug ID that was entered into the copyright
|
||||
assignment form.
|
||||
|
||||
### Ongoing Contributors
|
||||
|
||||
If you are interested in making frequent contributions to ICU, then the ICU
|
||||
Project Management Committee may agree to invite you as an ongoing contributor.
|
||||
Ongoing contributors may be individuals but are more typically expected to be
|
||||
companies with one or more people ("authors") writing different parts of one or
|
||||
more contributions.
|
||||
|
||||
In this case, the relationship between the contributor and the ICU team is much
|
||||
closer: One or more authors belonging to the contributor will have commit access
|
||||
to the ICU source code repository. With this direct access come additional
|
||||
responsibilities including an understanding that the contributor will work to
|
||||
follow the technical Requirements (§) above for contributions, and agreement to
|
||||
adhere to the terms of the copyright assignment forms for all future
|
||||
contributions.
|
||||
|
||||
The process for ongoing contributors involves two types of forms: Initially, and
|
||||
only once, an ongoing contributor submits a *Joint Copyright Assignment by
|
||||
Ongoing Contributor* form, agreeing to essentially the same terms as in the
|
||||
one-time contributor form, for all future contributions. (See the form at
|
||||
<https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/Copyright_Assignment_ongoing.rtf>).
|
||||
|
||||
The contributor must also send another form, *Addendum to Joint Copyright
|
||||
Assignment by Ongoing Contributor: Authors*, for the initial set and each
|
||||
addition of authors to ICU contributions, **before** any contributions from
|
||||
these authors are committed into the ICU source code repository. (Only new,
|
||||
additional authors need to be listed on each such form.) The contributor agrees
|
||||
to ensure that all of these authors agree to adhere to the terms of the
|
||||
associated *Joint Copyright Assignment by Ongoing Contributor Agreement*. (See
|
||||
the Authors Addendum form at
|
||||
<https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/Copyright_Assignment_authors.rtf>).
|
||||
|
||||
Some of an ongoing contributor's authors will have commit access to the ICU
|
||||
source code repository. Their committer IDs need to be established before
|
||||
completing the Authors Addendum form, so that these committer IDs can be entered
|
||||
there. (The committer IDs should be activated only after the form is received.)
|
||||
|
||||
Committer authors commit materials directly into the appropriate parts of the
|
||||
ICU source code repository. Contributions from an ongoing contributor are
|
||||
identified by their association with the contributor's committer IDs.
|
||||
|
||||
### Previous Contributions
|
||||
|
||||
All previous "one-off" contributions from non-IBM sources to ICU are listed on
|
||||
the code contributions page in ICU's source code repository. The page contains
|
||||
links to the softcopies of the Joint Copyright Assignment forms. See
|
||||
<https://htmlpreview.github.io/?https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/code_contributions.html>
|
||||
|
||||
In addition, the following non-IBM companies are registered as Ongoing
|
||||
Contributors:
|
||||
|
||||
* Apple
|
||||
* Google
|
||||
|
||||
See the repository folder that contains the contributions page for the full set
|
||||
of softcopies of contributor agreements including one-off contributions,
|
||||
ongoing-contributor agreements and author-addendum documents to
|
||||
ongoing-contributor agreements:
|
||||
<https://github.com/unicode-org/icu-docs/tree/main/legal/contributions>
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
layout: default
|
||||
title: User Guide Editing
|
||||
nav_order: 5
|
||||
parent: Contributors
|
||||
---
|
||||
<!--
|
||||
|
||||
@@ -1,22 +1,37 @@
|
||||
---
|
||||
layout: default
|
||||
title: Developing Fuzzer Targets for ICU APIs
|
||||
parent: Contributors
|
||||
---
|
||||
|
||||
# Developing Fuzzer Targets for ICU APIs
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
<!--
|
||||
© 2019 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
Developing Fuzzer Targets for ICU APIs
|
||||
======================================
|
||||
|
||||
This documents describes how to develop a [fuzzer](https://opensource.google.com/projects/oss-fuzz)
|
||||
target for an ICU API and its integration into the ICU build process.
|
||||
|
||||
### Directory and naming conventions
|
||||
## Directory and naming conventions
|
||||
|
||||
Fuzzer targets are exclusively in directory
|
||||
[`source/test/fuzzer/`](https://github.com/unicode-org/icu/tree/main/icu4c/source/test/fuzzer)
|
||||
and end with `_fuzzer.cpp`. Only files with such ending are recognized and executed as fuzzer
|
||||
targets by the OSS-Fuzz system.
|
||||
|
||||
### General structure of a fuzzer target
|
||||
## General structure of a fuzzer target
|
||||
|
||||
As a minimum, a fuzzer target contains the function
|
||||
|
||||
@@ -69,7 +84,7 @@ constructor. The code interprets the fuzzer data as UnicodeString and passes it
|
||||
And that is all. Specific error handling or return value verification is not required because the
|
||||
fuzzer will detect all memory issues by means of memory/address sanitizer findings.
|
||||
|
||||
### Makefile.in changes
|
||||
## Makefile.in changes
|
||||
|
||||
ICU fuzzer targets are built and executed by the OSS-Fuzz project. On side of ICU they are compiled
|
||||
to assure that the code is syntactically correct and, as a sanity check, executed in the most basic
|
||||
@@ -81,14 +96,14 @@ The new fuzzer target will then be built and executed as part of a normal ICU4C
|
||||
that each fuzzer target becomes executable on its own. As such it is linked with the code in
|
||||
`fuzzer_driver.cpp`, which contains the `main()` function.
|
||||
|
||||
### Fuzzer seed corpus
|
||||
## Fuzzer seed corpus
|
||||
|
||||
Any fuzzer seed data for a fuzzer target goes into a file with name `<fuzzer_target>_seed_corpus.txt`.
|
||||
In many cases the input parameter of the ICU API under test is of type `UnicodeString`, in case
|
||||
of which the seed data should be in UTF-16 format. As an example,see
|
||||
[collator_rulebased_fuzzer_seed_corpus.txt](https://github.com/unicode-org/icu/blob/main/icu4c/source/test/fuzzer/collator_rulebased_fuzzer_seed_corpus.txt).
|
||||
|
||||
### Guidelines and tips
|
||||
## Guidelines and tips
|
||||
|
||||
* Leave all randomness to the fuzzer. If a random selection of any kind is needed (e.g., of a
|
||||
locale), then use bytes from the fuzzer data to make the selection
|
||||
@@ -97,7 +112,7 @@ of which the seed data should be in UTF-16 format. As an example,see
|
||||
under test requires a Unicode string then make sure that the seed data is in UTF-16 encoding.
|
||||
This can be achieved with e.g. the 'iconv' command or using an editor that saves text in UTF-16.
|
||||
|
||||
### How to locally reproduce fuzzer findings
|
||||
## How to locally reproduce fuzzer findings
|
||||
|
||||
At this time reproduction of fuzzer findings requires Docker installed on the local machine and the
|
||||
OSS-Fuzz project downloaded in a local git client.
|
||||
@@ -0,0 +1,606 @@
|
||||
---
|
||||
layout: default
|
||||
title: git and Github for ICU Developers
|
||||
parent: Contributors
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# git and Github for ICU Developers
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
For git & git lfs installation see the [Source Code Setup](../../devsetup/source/)
|
||||
page.
|
||||
|
||||
For setup with language compilers and IDEs, see the [Setup for Contributors](../../devsetup/source/) page
|
||||
and its subpages.
|
||||
|
||||
## Overview
|
||||
|
||||
ICU development is on GitHub, in the **main** branch of the git repository.
|
||||
<https://github.com/unicode-org/icu>
|
||||
|
||||
In preparation for a release, we create a maintenance branch, such as
|
||||
[maint/maint-62](https://github.com/unicode-org/icu/tree/maint/maint-62) for ICU
|
||||
62 and its maintenance releases.
|
||||
|
||||
For each release we create a release tag.
|
||||
[releases/tag/release-62-1](https://github.com/unicode-org/icu/releases/tag/release-62-1)
|
||||
(GitHub project page > Releases > Tags > select one; a Release is a Tag with
|
||||
metadata.)
|
||||
|
||||
There are additional branches that you can ignore. Some are old development
|
||||
branches.
|
||||
|
||||
Also, when you edit a file directly on the GitHub source browser (for docs: API
|
||||
comments, or .md/.html/.txt), it creates a branch for your pull request. Make
|
||||
sure to delete this branch when you are done.
|
||||
|
||||
## Development
|
||||
|
||||
We do *not* develop directly on the main repository. Do *not* clone from
|
||||
there to commit and push back into the main repository.
|
||||
|
||||
Instead, use the GitHub UI (top right) to create a fork of the repository in
|
||||
your own GitHub account. Then clone that to your local machine. You need only
|
||||
one fork for all of your ICU work.
|
||||
|
||||
```
|
||||
mkdir -p icu/mine/src
|
||||
git clone git@github.com:markusicu/icu.git icu/mine/src
|
||||
cd icu/mine/src
|
||||
```
|
||||
|
||||
You should be in the **main** branch of your fork's clone.
|
||||
|
||||
Do *not* do any development in your own **main** branch either! That would
|
||||
lead to messy merging with the upstream **main** branch.
|
||||
|
||||
Instead, create a new branch in your local clone for each piece of work. You
|
||||
need a separate branch for each pull request. More on that later.
|
||||
|
||||
```
|
||||
git checkout -b mybranchname
|
||||
```
|
||||
|
||||
Now you are in a new development branch in your local git repo. Confirm with
|
||||
`git status`. Change stuff. Do `git status` again, use `git add` for staging and
|
||||
`git commit -m 'ICU-23456 what I changed'` to commit, or use `git commit -a -m 'ICU-23456 what I changed'` if you want to commit everything that git status
|
||||
shows as changed.
|
||||
|
||||
For looking at changes, you should set up a visual diff program for use with
|
||||
`git difftool`. See the [Setup: git difftool & mergetool](../../devsetup/source/gittooling.md) page.
|
||||
|
||||
For new files: Remember to add the appropriate copyright lines. Copy from a file
|
||||
of the same type, and set the copyright year to the current year (that is, the
|
||||
year you are creating the file).
|
||||
|
||||
You should have a Jira ticket for each line of work. (See [Submitting ICU Bugs and Feature Requests](https://icu.unicode.org/bugs) and [ICU Ticket Life cycle](https://icu.unicode.org/processes/ticket-lifecycle).) You can have multiple pull
|
||||
requests per ticket. Each pull request needs a ticket in Accepted state.
|
||||
|
||||
Always prefix your commit statements with the Jira ticket number using this
|
||||
pattern (including the space after the number; note: no colon):
|
||||
`**ICU-23456** what I changed`
|
||||
|
||||
Local commits are only on your local machine. If your local disk crashes, your
|
||||
changes are gone. `git push` your commits to your GitHub fork.
|
||||
|
||||
**Tips for Branches**
|
||||
|
||||
Shane
|
||||
[recommends](https://blog.sffc.xyz/post/185195398930/why-you-should-use-git-pull-ff-only)
|
||||
setting the default behavior of `git pull` to `--ff-only`. Shane also
|
||||
[prevents](https://stackoverflow.com/a/40465455/1407170) local commits to the
|
||||
**main** branch via *.git/hooks/pre-commit*. These two measures make it easier
|
||||
to do the right thing in Git.
|
||||
|
||||
## Trivial changes
|
||||
|
||||
For trivial changes, such as small fixes in API docs or text files, it is ok to
|
||||
edit the file in the GitHub GUI, in the main unicode-org/icu repository.
|
||||
|
||||
You still need a Jira ticket.
|
||||
|
||||
Once you are done editing, the GUI lets you create a branch and a commit right
|
||||
in the main repository. Use the usual **ICU-23456** what I changed pattern
|
||||
for the commit message.
|
||||
|
||||
Pull request, review, merge as usual, see the next section.
|
||||
|
||||
*Remember to delete your branch after merging.*
|
||||
|
||||
## Review & commit to Unicode main
|
||||
|
||||
When you are ready for code review, go to your GitHub page and your ICU fork.
|
||||
|
||||
Select your dev branch (Branch drop-down on the left, search for your branch).
|
||||
|
||||
Click "New pull request" next to the Branch button, or "Pull request" on the
|
||||
right near "Compare". *Make sure it compares with unicode-org/icu main on the
|
||||
left and your own fork's dev branch on the right*.
|
||||
|
||||
Prefix the title of your pull request with the Jira ticket number, same format
|
||||
as for a commit.
|
||||
|
||||
Follow the rest of the checklist in the PR template.
|
||||
|
||||
Set the PR assignee to your main reviewer. You may add more people as reviewers,
|
||||
but there is normally just one assignee. Be somewhat judicious with additional
|
||||
reviewers: Don't just add them because they were recommended by GitHub.
|
||||
|
||||
Nice to have: Optionally set the Jira ticket reviewer field for documentation.
|
||||
Still possible to close the ticket if the field is empty.
|
||||
|
||||
Watch the PR status for build failures and other issues.
|
||||
|
||||
A PR reviewer (at least the assignee) should look to see if the PR does what the
|
||||
ticket says.
|
||||
|
||||
Respond to review feedback. Make changes on your local machine, commit, push to
|
||||
your fork. The GitHub PR will update automatically for your additional commits.
|
||||
|
||||
Try to not rebase, squash, or force-push until the reviewer gives you a green
|
||||
light.
|
||||
|
||||
*You should normally squash multiple commits into one in your fork before
|
||||
merging (after the reviewer is satisfied)*. For multiple commits, the reviewer
|
||||
should first respond with something like "lgtm please squash" but not yet
|
||||
GitHub-approve; after squashing, they should check that the changes are the
|
||||
same, and then GitHub-approve. A bot will respond to the PR confirming whether
|
||||
the squash succeeded without changing the file contents.
|
||||
|
||||
If you squash, since you are rewriting the commit message anyway, please append
|
||||
the pull request number to the first line of the updated message, using the
|
||||
format "` (#199)`".
|
||||
|
||||
When you squash, please keep the parent hash (sha) the same so that the squash
|
||||
is nothing more than a squash. If you change the parent hash, you may also be
|
||||
pulling in other people's changes, and it may be harder for the reviewer to
|
||||
verify that the squash was done correctly.
|
||||
|
||||
### Options on how to squash
|
||||
|
||||
#### Option 1: Use the online PR commit checker bot
|
||||
|
||||
Please note: this makes the
|
||||
change in your remote branch but not in your local branch. Click the "Details"
|
||||
link in the GitHub status, which brings you to a page with a summary of your PR.
|
||||
Find the "Squash..." button. Sign in using your GitHub account, and follow the
|
||||
flow to squash your branch.
|
||||
|
||||
Warning: do not `git pull` after you use the remote tool! If you subsequently need
|
||||
to update your local branch to the squash commit, you need to fetch and reset:
|
||||
|
||||
```
|
||||
git fetch origin BRANCHNAME
|
||||
git checkout BRANCHNAME
|
||||
git reset origin/BRANCHNAME
|
||||
```
|
||||
|
||||
#### Option 2: Use git rebase
|
||||
|
||||
This works as long as you have no merge commits with
|
||||
conflicts in your history. Plenty of examples:
|
||||
|
||||
* <https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_squashing>
|
||||
* <https://github.com/todotxt/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit>
|
||||
* <https://blog.carbonfive.com/2017/08/28/always-squash-and-rebase-your-git-commits/>
|
||||
* <http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html>
|
||||
* <https://medium.com/@slamflipstrom/a-beginners-guide-to-squashing-commits-with-git-rebase-8185cf6e62ec>
|
||||
* Several other options:
|
||||
<https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git>
|
||||
|
||||
#### Option 3: Use git merge
|
||||
|
||||
This is a little tricker but works even if you have
|
||||
merge commits with conflicts. Assuming your feature branch is called BRANCHNAME:
|
||||
|
||||
```
|
||||
# Make sure your branch is up-to-date with main and that the tests pass:
|
||||
|
||||
git checkout BRANCHNAME
|
||||
git merge main
|
||||
git push
|
||||
|
||||
# At this point, wait for an LGTM from a reviewer before proceeding.
|
||||
# Once confirmed, make your squash commit in a new temp branch.
|
||||
# NOTE: In the first line, make sure to checkout the same sha as
|
||||
# you most recently merged into your branch!
|
||||
|
||||
git checkout main
|
||||
git checkout -b temp
|
||||
git merge --squash BRANCHNAME
|
||||
git commit
|
||||
|
||||
# Point your branch to the squash commit, and there should be no dirty files:
|
||||
|
||||
git checkout BRANCHNAME
|
||||
git reset temp
|
||||
git status # should be empty! If it's not, you didn't check out the right sha.
|
||||
|
||||
# Push your squash commit and clean up:
|
||||
|
||||
git push -f
|
||||
git branch -d temp
|
||||
```
|
||||
|
||||
#### Option 4: Amend a small commit
|
||||
|
||||
When making code review changes on a small PR, you can amend your
|
||||
previous commit rather than making a new commit. Instead of running "git
|
||||
commit", just run "git commit --amend". You will need to force-push. The PR bot
|
||||
will post a link for the reviewer to see the changes from your old commit to
|
||||
your new commit.
|
||||
|
||||
Once the reviewer(s) has/have approved your (squashed) changes:
|
||||
|
||||
* If you are an ICU team member with main repo write access:
|
||||
* Merge your commits into the Unicode main.
|
||||
* We almost always want to "rebase and merge" the commits. We normally
|
||||
want them pre-squashed for a simple, clean change history. We rarely
|
||||
want to permanently keep intermediate commits.
|
||||
* (For ICU 63 we used "squash merge" but ended up with some ill-formed
|
||||
commit messages. "Rebase and merge" lets us review the commit
|
||||
messages before merging.)
|
||||
* After you click the Merge button, if you don't use "rebase and merge"
|
||||
(although normally you should...), make sure that the commit message
|
||||
includes the "ICU-23456 " prefix, and add a suffix like " (#65)" with
|
||||
the pull request number (if it's not there already).
|
||||
* Known limitation: We won't have the PR number in the commit
|
||||
message(s) when using the recommended "rebase and merge" -- unless
|
||||
you manually amend the commit message(s) and add it.
|
||||
* You should probably check the box for deleting your dev branch after
|
||||
merging.
|
||||
* Remember one branch per PR. You can create multiple branches & PRs per
|
||||
ticket.
|
||||
* If this was the last commit to finish work on the ticket, then go to
|
||||
Jira and close the ticket as Fixed.
|
||||
* You can optionally have someone (probably the same person as your PR
|
||||
assignee) review the ticket as well, but that's not normally necessary.
|
||||
* (We normally use ticket reviews for non-code changes, such as a
|
||||
non-coding task or a web site update for the User Guide etc.)
|
||||
* Otherwise:
|
||||
* The PR assignee should be an ICU team member, and they are responsible
|
||||
both for reviewing and for merging your PR, and then also for closing
|
||||
the ticket.
|
||||
|
||||
|
||||
## Merge conflicts
|
||||
|
||||
When someone else has made changes that conflict with yours, then you can't
|
||||
merge as is. (The GitHub pull request page will tell you if there is a
|
||||
conflict.)
|
||||
|
||||
You need to update your fork's **main** via your local clone, rebase your local
|
||||
dev branch with that, resolve conflicts as you go, and force-push to your fork.
|
||||
|
||||
As easy as it is in GitHub to *create* a fork, you would think that it would be
|
||||
a simple button-click to *update* your fork's **main** with commits on the
|
||||
Unicode **main**. If you find a way to do this, please update this section.
|
||||
|
||||
Switch to your local **main**.
|
||||
|
||||
```
|
||||
git checkout main
|
||||
```
|
||||
|
||||
### Pull from upstream
|
||||
|
||||
Pull updates from the Unicode main (rather than a vanilla `git pull` which
|
||||
pulls form your out-of-date fork), push to your fork's main.
|
||||
|
||||
*Norbert’s version:*
|
||||
|
||||
```
|
||||
git pull git@github.com:unicode-org/icu.git
|
||||
git push
|
||||
```
|
||||
|
||||
*Andy’s version:*
|
||||
|
||||
Once per local git repo, set up an additional "remote". Something like the
|
||||
following, but this may be incomplete!
|
||||
|
||||
```
|
||||
git remote add upstream https://github.com/unicode-org/icu.git
|
||||
git pull upstream main
|
||||
git push origin main
|
||||
```
|
||||
|
||||
*Andy's Version, take 2:*
|
||||
|
||||
Set the local main to track the upstream (unicode-org) main instead of your
|
||||
fork's main (orign). Your fork's main is effectively out of the loop.
|
||||
|
||||
```
|
||||
# one time setup
|
||||
git branch -u upstream/main
|
||||
# subsequent pulls from upstream (unicode.org) main
|
||||
git pull
|
||||
```
|
||||
|
||||
### Resolve conflicts
|
||||
|
||||
There are two ways to do this. You can rebase, or you can create a merge commit.
|
||||
The advantage of rebase is that it makes it somewhat easier to squash later on.
|
||||
The advantage of creating a merge commit is that you don't have to force-push,
|
||||
so it makes it easier to work across different workstations, you are less likely
|
||||
to get something wrong, and it makes it easier for the reviewer because GitHub
|
||||
keeps track of comment history better when shas don't change.
|
||||
|
||||
#### Option 1: Merge
|
||||
|
||||
Switch to your dev branch, then merge in main. I like to use
|
||||
the --no-commit option:
|
||||
|
||||
```
|
||||
git checkout mybranchname
|
||||
git merge main --no-commit
|
||||
```
|
||||
|
||||
If you have conflicts, resolve them. Then, review the merge commit. It should
|
||||
have all changes from main that were not yet on your branch. If it looks good,
|
||||
commit the merge. You can push the merge commit without having to use -f.
|
||||
|
||||
```
|
||||
git commit
|
||||
git push
|
||||
```
|
||||
|
||||
#### Option 2: Rebase
|
||||
|
||||
First switch back to your dev branch (without the -b option
|
||||
which is for creating a new branch).
|
||||
|
||||
```
|
||||
git checkout mybranchname
|
||||
```
|
||||
|
||||
Then rebase, which reapplies your branch changes on top of the new main commits.
|
||||
|
||||
```
|
||||
git rebase main
|
||||
```
|
||||
|
||||
Sometimes you need to manually resolve conflicts. Follow the instructions git
|
||||
prints or look for help...
|
||||
|
||||
If it had stopped and you are done resolving conflicts, continue rebasing.
|
||||
|
||||
```
|
||||
git rebase --continue
|
||||
```
|
||||
|
||||
You might get conflicts at several stages; resolve & continue until done.
|
||||
|
||||
When done, push to your GitHub fork. You need to force-push after rebasing.
|
||||
|
||||
```
|
||||
git push -f
|
||||
```
|
||||
|
||||
## Update your fork
|
||||
|
||||
Once in a while, you should update your fork's main with changes from the
|
||||
Unicode main, so that you don't fall too far behind and your new changes don't
|
||||
create unnecessary merge conflicts.
|
||||
|
||||
Go to your local main, pull commits from the Unicode main, and push to your
|
||||
GitHub fork. See the "Merge conflicts" section above for details. If you don't
|
||||
have a current dev branch, you can skip the rebasing.
|
||||
|
||||
## Committing to Maintenance Branch
|
||||
|
||||
Follow these steps for adding a commit to a maintenance branch.
|
||||
|
||||
The process is different between when we are between RC and GA and when we are
|
||||
after GA.
|
||||
|
||||
### Between RC and GA
|
||||
|
||||
When working on a commit that you know at the time of
|
||||
authorship to be a candidate for the maintenance branch, write the commit and
|
||||
send the PR directly against the maintenance branch. All commits on the maint
|
||||
branch will be merged *from maint to main* as a BRS task (see the next section).
|
||||
|
||||
Check out the current maint branch:
|
||||
|
||||
```
|
||||
git fetch upstream maint/maint-64
|
||||
git checkout maint/maint-64
|
||||
```
|
||||
|
||||
Next, make a local branch off of the maint branch. For example, to use the
|
||||
branch name "ICU-12345-maint-64", you can do:
|
||||
|
||||
```
|
||||
git checkout -b ICU-12345-maint-64
|
||||
```
|
||||
|
||||
Now, write your change and send it for review. Open your PR against the maint
|
||||
branch.
|
||||
|
||||
### After GA
|
||||
|
||||
Write the commit against the main branch, and send your own
|
||||
cherry-pick commits to put it on the desired maint branches.
|
||||
|
||||
Update your local main from the Unicode main (see above). Otherwise your git
|
||||
workspace won't recognize the commits you are trying to cherry-pick.
|
||||
|
||||
Make a note of the SHA hash/ID of your commit on the main branch. You will use
|
||||
this later when cherry-picking into the maint branch.
|
||||
|
||||
* The commit ID is listed on the pull request page.
|
||||
* You can use git log to see the SHA once your change is on main.
|
||||
* You can look at the commit history on GitHub too.
|
||||
|
||||
Next, checkout the maintenance branch locally. For example, for the ICU 63
|
||||
maintenance branch:
|
||||
|
||||
```
|
||||
git fetch upstream maint/maint-64
|
||||
git checkout maint/maint-64
|
||||
```
|
||||
|
||||
Next, make a local branch off of the maint branch. This new branch will be used
|
||||
for your cherry-pick.
|
||||
|
||||
For example, to use the branch name "ICU-12345-maint-64", you can do:
|
||||
|
||||
```
|
||||
git checkout -b ICU-12345-maint-64
|
||||
```
|
||||
|
||||
Next, cherry-pick the commit(s) you want to apply to the maintenance branch.
|
||||
(Note: If you only have one commit to merge to the maint branch then you would
|
||||
only have one command below).
|
||||
|
||||
```
|
||||
git cherry-pick 7d99ba4
|
||||
git cherry-pick e578f3f
|
||||
...
|
||||
```
|
||||
|
||||
This creates **new** commits directly onto your local branch.
|
||||
|
||||
Look at the output from each of these commands to double-check that you got the
|
||||
intended commits.
|
||||
|
||||
Finally, push your branch to your fork (should be "origin"), and open a PR into
|
||||
the Unicode ICU branch maint/maint-64.
|
||||
|
||||
```
|
||||
git push -u your-fork ICU-12345-maint-64
|
||||
```
|
||||
|
||||
The reviewer of the PR has the following special responsibilities:
|
||||
|
||||
1. Don't approve the PR unless ICU-TC has agreed that this should be a
|
||||
maintenance fix.
|
||||
2. Make sure that the PR is targeting the correct branch in the Unicode ICU
|
||||
repro. (ex: maint/maint-64 ).
|
||||
3. Make sure that the PR includes all commits associated with the fix, which
|
||||
was already approved for main.
|
||||
4. Use "Rebase and merge".
|
||||
|
||||
## Checking for Missing Commits (BRS Task)
|
||||
|
||||
It is not hard to accidentally make a commit against main that should have been
|
||||
against maint. As a BRS task before tagging, you should check the list of
|
||||
commits that are on main but not maint and make sure of them belong on
|
||||
maint.
|
||||
|
||||
To get the list, run:
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git cherry -v upstream/maint/maint-64 upstream/main
|
||||
```
|
||||
|
||||
Commits prefixed with "+" are on main but not on the specified maint branch.
|
||||
Commits prefixed with "-" are present on both branches.
|
||||
|
||||
Send the list to the team and discuss in the weekly meeting if there are any
|
||||
problems.
|
||||
|
||||
## Merging from Maint to Main (BRS Task)
|
||||
|
||||
Merging from the maint branch to main might be as easy as opening a pull
|
||||
request, without having to touch the command line. However, if there are merge
|
||||
conflicts, more work will need to be done.
|
||||
|
||||
**The Easy Way (No Merge Conflicts):** Open a pull request on GitHub from the
|
||||
maint branch to main. If it says there are no merge conflicts, congratulations!
|
||||
Use a new ticket number for the PR (it is suggested to NOT use the main BRS
|
||||
ticket). The new ticket should have the next release as its fix version, because
|
||||
the merge commit used to pull the commits from maint to main will be in the next
|
||||
release but not the current release.
|
||||
|
||||
You may need to add "DISABLE_JIRA_ISSUE_MATCH=true" and/or
|
||||
"ALLOW_MANY_COMMITS=true" to the PR description to silence errors coming from
|
||||
the Unicode bot.
|
||||
|
||||
You should use a MERGE COMMIT to merge from maint to main, NOT REBASE MERGE as
|
||||
is normally recommended. You will need to go into the admin panel on GitHub,
|
||||
enable merge commits, perform your merge commit, and then disable merge commits
|
||||
again from the admin panel. When making your merge commit, remember to use the
|
||||
correct commit message syntax: prefix the merge commit message with ICU-#####,
|
||||
the new ticket number you created above.
|
||||
|
||||
**The Hard Way (Merge Conflicts):** At the end of the day, the goal is that main
|
||||
should share the maint branch's history. This is done using merge commits. What
|
||||
follows is an example of how to create merge commits that retain full branch
|
||||
history.
|
||||
|
||||
Create a new branch based on the tag you want to merge:
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git checkout main
|
||||
git checkout -b 64-merge-branch # use any name you like
|
||||
```
|
||||
|
||||
*If you already have this branch from a previous release tag*, you could either
|
||||
use a new branch, or merge the latest main into your branch:
|
||||
|
||||
```
|
||||
git checkout 64-merge-branch
|
||||
# DANGER: Please make sure your workspace is clean before proceeding!
|
||||
# If it's not, you might sneak in unreviewed changes.
|
||||
git merge --no-commit main
|
||||
git commit -am "ICU-##### Merge tag 'main' into 64-merge-branch"
|
||||
```
|
||||
|
||||
Now, merge in maint:
|
||||
|
||||
```
|
||||
# DANGER: Please make sure your workspace is clean before proceeding!
|
||||
# If it's not, you might sneak in unreviewed changes.
|
||||
git merge --no-commit upstream/maint/maint-39
|
||||
```
|
||||
|
||||
After running the final line, you will have the opportunity to resolve merge
|
||||
conflicts. If the conflict is in a large binary file like the ICU4J data jar
|
||||
files, you may need to re-generate them.
|
||||
|
||||
Remember to prefix your commit message with the ticket number:
|
||||
|
||||
```
|
||||
git commit -am "ICU-##### Merge branch 'maint/maint-39' into 64-merge-branch"
|
||||
git push -u origin 64-merge-branch
|
||||
```
|
||||
|
||||
As in the Easy Way, you may need to add `DISABLE_JIRA_ISSUE_MATCH=true` and/or
|
||||
`ALLOW_MANY_COMMITS=true` to the PR description to silence errors coming from
|
||||
the Unicode bot.
|
||||
|
||||
Send the PR off for review. As in the Easy Way, **you should use the MERGE COMMIT option in GitHub to land the PR!!**
|
||||
|
||||
## Requesting an Exhaustive Test run on a Pull-Request (PR)
|
||||
|
||||
The ICU4C and ICU4J Exhaustive Tests run on the main branch after a pull-request
|
||||
has been submitted. They do not run on pull-requests by default as they take 1-2
|
||||
hours to run.
|
||||
|
||||
However, you can manually request the CI builds to run the exhaustive tests on a
|
||||
PR by commenting with the following text:
|
||||
|
||||
```
|
||||
/azp run CI-Exhaustive
|
||||
```
|
||||
|
||||
This will trigger the test run on the PR. This is covered more in a separate
|
||||
[document](https://docs.google.com/document/d/1kmcFFUozpWah_y7dk_Inlw_BIq3vG3-ZR2A28tIiXJc/edit?usp=sharing).
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
title: Contributors
|
||||
nav_order: 1800
|
||||
nav_order: 9000
|
||||
has_children: true
|
||||
---
|
||||
<!--
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
layout: default
|
||||
title: Skipping Known Test Failures
|
||||
parent: Contributors
|
||||
---
|
||||
|
||||
<!--
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
# Skipping Known Test Failures (logKnownIssue)
|
||||
|
||||
If you need a test to be disabled temporarily, call `logKnownIssue`. The method
|
||||
is defined as below:
|
||||
|
||||
```java
|
||||
/**
|
||||
* Log the known issue.
|
||||
* This method returns true unless -prop:logKnownIssue=no is specified
|
||||
* in the argument list.
|
||||
*
|
||||
* @param ticket A ticket number string. For an ICU ticket, use numeric
|
||||
characters only,
|
||||
* such as "10245". For a CLDR ticket, use prefix "cldrbug:" followed by ticket
|
||||
number,
|
||||
* such as "cldrbug:5013".
|
||||
* @param comment Additional comment, or null
|
||||
* @return true unless -prop:logKnownIssue=no is specified in the test command
|
||||
line argument.
|
||||
*/
|
||||
public boolean logKnownIssue(String ticket, String comment)
|
||||
```
|
||||
|
||||
Below is an example:
|
||||
|
||||
```java
|
||||
if (logKnownIssue("1234", "New data is not integrated yet.")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// test code below
|
||||
```
|
||||
|
||||
By default, logKnownIssue returns true and emit a log line including the link to
|
||||
the ticket and the comment.
|
||||
|
||||
When `-prop:logKnownIssue=no` is specified as a command line argument,
|
||||
`logKnownIssue()` returns false, so you can temporary enable a test code skipped
|
||||
by logKnownIssue.
|
||||
|
||||
Before ICU4J 52, we used to use isICUVersionBefore() method like below. The test
|
||||
method is still available in the trunk, but developers are suggested to use
|
||||
logKnownIssue() instead.
|
||||
|
||||
```java
|
||||
if (isICUVersionBefore(50,0,2)) {
|
||||
return;
|
||||
}
|
||||
```
|
||||
|
||||
Before ICU4J 49M2, we used to use the style below -
|
||||
|
||||
```java
|
||||
if(skipIfBeforeICU(4, 5, 2)) {
|
||||
return;
|
||||
}
|
||||
```
|
||||
@@ -1,18 +1,33 @@
|
||||
---
|
||||
layout: default
|
||||
title: Updating ICU's built-in Break Iterator rules
|
||||
parent: Contributors
|
||||
---
|
||||
|
||||
# Updating ICU's built-in Break Iterator rules
|
||||
{: .no_toc }
|
||||
|
||||
## Contents
|
||||
{: .no_toc .text-delta }
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
<!--
|
||||
Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
© 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
Updating ICU's built-in Break Iterator rules
|
||||
============================================
|
||||
|
||||
Here are instructions for updating ICU's built-in break iterator rules, for Grapheme, Word, Line and Sentence breaks.
|
||||
|
||||
The ICU rules implement the boundary behavior from Unicode [UAX-14](https://www.unicode.org/reports/tr14/) and [UAX-29](https://www.unicode.org/reports/tr29/), with tailorings from CLDR and some ICU-specific enhancements. ICU rules updates are needed in response to changes from Unicode or CLDR, or for bug fixes. Often ideas for CLDR or UAX updates are prototyped in ICU first, before becoming official.
|
||||
|
||||
This is not a cook book process. Familiarity with ICU break iterator behavior and rules is needed. Sets of break rules often interact in subtle and difficult to understand ways. Expect some bumps.
|
||||
|
||||
### Have clear specifications for the change.
|
||||
## Have clear specifications for the change.
|
||||
|
||||
The changes will typically come from a proposed update to Unicode UAX 29 or UAX 14,
|
||||
or from CLDR based tailorings to these specifications.
|
||||
@@ -21,7 +36,7 @@ As an example, see [CLDR proposal for Extended Indic Grapheme Clusters](https://
|
||||
|
||||
Often ICU will implement draft versions of proposed specification updates, to check that they are complete and consistent, and to identify any issues before they are released.
|
||||
|
||||
### Files that typically will need to be updated:
|
||||
## Files that typically will need to be updated:
|
||||
|
||||
|
||||
| File | Contents |
|
||||
@@ -35,12 +50,12 @@ Often ICU will implement draft versions of proposed specification updates, to ch
|
||||
|||
|
||||
| icu/icu4j/...
|
||||
| .../main/shared/data/icudata.jar | Data jar, includes break rules. Derived from ICU4C.
|
||||
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt | Test data, copied from ICU4C.
|
||||
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/* | Monkey test rules, copied from ICU4C.
|
||||
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java | Monkey test w rules as code. Port from ICU4C.
|
||||
| .../main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt | Test data, copied from ICU4C.
|
||||
| .../main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/* | Monkey test rules, copied from ICU4C.
|
||||
| .../main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java | Monkey test w rules as code. Port from ICU4C.
|
||||
|
||||
|
||||
### ICU4C
|
||||
## ICU4C
|
||||
|
||||
The rule updates are done first for ICU4C, and then ported (code changes) or moved (data changes) to ICU4J. This order is easiest because the the break rule source files are part of the ICU4C project, as is the rule builder.
|
||||
|
||||
@@ -75,16 +90,16 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
||||
probably means that some earlier change to ICU4C was not fully ported to ICU4J, and this
|
||||
needs to be resolved before proceeding.
|
||||
|
||||
diff icu4c/source/test/testdata/rbbitst.txt icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
diff icu4c/source/test/testdata/rbbitst.txt icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
|
||||
Should show no differrence.
|
||||
Should show no difference.
|
||||
|
||||
|
||||
2. **Run the ICU4C break iterator tests**, and verify that the newly added tests fail as expected.
|
||||
(We haven't updated the rules yet)
|
||||
|
||||
cd icu/icu4c/source
|
||||
make -j6 check
|
||||
make -j -l2.5 check
|
||||
|
||||
To run just the RBBI Tests (you will be doing this a lot)
|
||||
|
||||
@@ -110,7 +125,7 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
||||
For this example, the rule file is `icu4c/source/data/brkitr/rules/char.txt`.
|
||||
(If the change is for word or line break, which have multiple rule files for tailorings, only update the root file at this time.)
|
||||
|
||||
Start by looking at how existing similar rules are being handled, and also refer to the ICU user guide section on [Break Rules](../userguide/boundaryanalysis/break-rules.md) for an explanation of rule syntax and behavior.
|
||||
Start by looking at how existing similar rules are being handled, and also refer to the ICU user guide section on [Break Rules](../boundaryanalysis/break-rules) for an explanation of rule syntax and behavior.
|
||||
|
||||
The transformation from UAX or CLDR style rules to ICU rules can be non-trivial. Sources of difficulties include:
|
||||
|
||||
@@ -118,12 +133,15 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
||||
|
||||
- ICU rules match a run of text that does not have boundaries in its interior (unless the rule contains a "hard break", represented by a '/'. UAX and CLDR rules, on the other hand, tell whether a single text position is or is not a break, with the rule expressing pre and post context around that position. This transformation is generally not hard, and the ICU form of the rules is often simpler.
|
||||
|
||||
In the line break rules, for the most part, rules begin and end with required (non-conditional) characters of some class other than `$CM`. By convention, line break rules never chain on `$CM`. Rules beginning with a combining mark all have the form `^$CM+ $Something`, meaning that they only match at the start of text, that they can't be chained into. This helps keep the overall chaining behavior of the line break rules somewhat easier to understand.
|
||||
|
||||
4. **Rebuild the ICU data with the updated rules.**
|
||||
|
||||
cd icu4c/source/data
|
||||
make
|
||||
|
||||
This runs the `genbrk` tool. The tool looks for a Unicode signature byte sequence and otherwise assumes the rule files are encoded as UTF-8; in the ICU source tree, rule files are encoded as UTF-8.
|
||||
|
||||
5. **Rerun the data-driven test**, `rbbi/TestExtended`. With luck, it may pass. Failures fall into two classes:
|
||||
|
||||
- The newly added test failed. Either something is wrong with the test cases, or something is wrong with the rule updates.
|
||||
@@ -225,14 +243,14 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
||||
|
||||
As with the main rules, after everything appears to be working, run the rule based monkey test for an extended period of time (with loop=-1).
|
||||
|
||||
### ICU4J
|
||||
## ICU4J
|
||||
|
||||
1. **Copy the Data Driven Test File to ICU4J**
|
||||
|
||||
Copy the file `rbbitst.txt` from ICU4C to ICU4J, and run the Java test. It should fail until the rules are updated.
|
||||
|
||||
cd <top level icu directory>
|
||||
cp icu4c/source/test/testdata/rbbitst.txt icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
cp icu4c/source/test/testdata/rbbitst.txt icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
|
||||
Run the test from Eclipse.
|
||||
|
||||
@@ -254,7 +272,7 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
||||
|
||||
ICU4C file to port from: `source/test/intltest/rbbitst.cpp`
|
||||
|
||||
ICU4J file to port to: `main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java`
|
||||
ICU4J file to port to: `main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java`
|
||||
|
||||
To conveniently run the individual tests, look for the test functions `TestCharMonkey()`, `TestWordMonkey()`, etc. in `RBBITestMonkey.java`.
|
||||
|
||||
@@ -270,9 +288,9 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
||||
|
||||
ICU4C directory, to copy from: `source/test/testdata/break_rules/`
|
||||
|
||||
ICU4J directory, to copy to: `main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/`
|
||||
ICU4J directory, to copy to: `main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/`
|
||||
|
||||
Then rerun the rule based monkey test, in the file `main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBIMonkeyTest.java`. Find the test function `TestMonkey()`; it include comments describing how to run it with parameters from Eclipse.
|
||||
Then rerun the rule based monkey test, in the file `main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBIMonkeyTest.java`. Find the test function `TestMonkey()`; it include comments describing how to run it with parameters from Eclipse.
|
||||
|
||||
Run the test(s) for the changed rules for an extended amount of time (with Dloop=-1).
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
layout: default
|
||||
title: Custom ICU4C Synchronization
|
||||
nav_order: 3
|
||||
parent: Contributors
|
||||
---
|
||||
<!--
|
||||
@@ -203,8 +202,8 @@ static std::condition_variable initCondition;
|
||||
// function on this thread, or wait for some other thread to complete the initialization.
|
||||
//
|
||||
// The actual call to the init function is made inline by template code
|
||||
// that knows the C++ types involved. This function returns TRUE if
|
||||
// the inline code needs to invoke the Init function, or FALSE if the initialization
|
||||
// that knows the C++ types involved. This function returns true if
|
||||
// the inline code needs to invoke the Init function, or false if the initialization
|
||||
// has completed on another thread.
|
||||
//
|
||||
// UInitOnce::fState values:
|
||||
@@ -217,7 +216,7 @@ UBool umtx_initImplPreInit(UInitOnce &uio) {
|
||||
int32_t state = uio.fState;
|
||||
if (state == 0) {
|
||||
umtx_storeRelease(uio.fState, 1);
|
||||
return TRUE; // Caller will next call the init function.
|
||||
return true; // Caller will next call the init function.
|
||||
} else {
|
||||
while (uio.fState == 1) {
|
||||
// Another thread is currently running the initialization.
|
||||
@@ -225,7 +224,7 @@ UBool umtx_initImplPreInit(UInitOnce &uio) {
|
||||
initCondition.wait(initLock);
|
||||
}
|
||||
U_ASSERT(uio.fState == 2);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
layout: default
|
||||
title: Synchronization
|
||||
nav_order: 2
|
||||
parent: Contributors
|
||||
---
|
||||
<!--
|
||||
|
||||
@@ -220,9 +220,11 @@ Note that the examples may not reflect current CLDR data.
|
||||
| `F` | day of week in month | `F` | 2 (2nd Wed in July) |
|
||||
| `g` | modified julian day | `g` | 2451334 |
|
||||
| `E` | day of week | `E,` `EE`, or `EEE`<br/>`EEEE`<br/>`EEEEE`<br/>`EEEEEE` | Tue<br/>Tuesday<br/>T<br/>Tu |
|
||||
| `e` | local day of week<br/>example: if Monday is 1st day, Tuesday is 2nd ) | `e` or `ee`<br/>`eee`<br/>`eeee`<br/>`eeeee`<br/>`eeeeee` | 2<br/>Tue<br/>Tuesday<br/>T<br/>Tu |
|
||||
| `e` | local day of week<br/>example: if Monday is 1st day, Tuesday is 2nd ) | `e`<br>`ee`<br/>`eee`<br/>`eeee`<br/>`eeeee`<br/>`eeeeee` | 2<br>02<br/>Tue<br/>Tuesday<br/>T<br/>Tu |
|
||||
| `c` | stand-alone local day of week | `c` or `cc`<br/>`ccc`<br/>`cccc`<br/>`ccccc`<br/>`cccccc` | 2<br/>Tue<br/>Tuesday<br/>T<br/>Tu |
|
||||
| `a` | am/pm marker | `a` | pm |
|
||||
| `a` | AM or PM | `a`, `aa`, or `aaa`<br/>`aaaa`<br/>`aaaaa` | PM [abbrev]<br/>PM [wide]<br/>p |
|
||||
| `b` | am, pm, noon, midnight | `b`, `bb`, or `bbb`<br/>`bbbb`<br/>`bbbbb` | mid.<br/>midnight<br/>md |
|
||||
| `B` | flexible day periods | `B`, `BB`, or `BBB`<br/>`BBBB`<br/>`BBBBB` | at night [abbrev]<br/>at night [wide]<br/>at night [narrow] |
|
||||
| `h` | hour in am/pm (1~12) | `h`<br/>`hh` | 7<br/>07 |
|
||||
| `H` | hour in day (0~23) | `H`<br/>`HH` | 0<br/>00 |
|
||||
| `k` | hour in day (1~24) | `k`<br/>`kk` | 24<br/>24 |
|
||||
@@ -340,6 +342,14 @@ patterns for different locales:
|
||||
| es_ES | `"d 'de' MMMM, H:mm"` | "2 de abril, 17:00" |
|
||||
| ja_JP | `"M月d日 H:mm"` | "4月2日 17:00" |
|
||||
|
||||
A full list of date and time symbols that can be used in skeleton strings
|
||||
(input to `DateTimePatternGenerator`) can be found in the
|
||||
[UTS 35 (LDML) Date Field Symbol Table](https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
|
||||
|
||||
Note: some date time symbols are intended only for use in skeleton strings, and are not intended
|
||||
to be used in pattern strings (output from `DateTimePatternGenerator`). Such symbols are noted accordingly
|
||||
in the table.
|
||||
|
||||
The most important DateTimePatternGenerator methods are the varieties of
|
||||
getBestPattern.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user