-
-
Notifications
You must be signed in to change notification settings - Fork 742
/
extract-data-files.sh
executable file
·79 lines (66 loc) · 3.46 KB
/
extract-data-files.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
# Copyright (C) 2023 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Check that all the .jar files are present
JAR_FILE=main/shared/data/icudata.jar
if [ ! -f "$JAR_FILE" ]; then
echo "Missing $JAR_FILE"
exit
fi
JAR_FILE=main/shared/data/icutzdata.jar
if [ ! -f "$JAR_FILE" ]; then
echo "Missing $JAR_FILE"
exit
fi
JAR_FILE=main/shared/data/testdata.jar
if [ ! -f "$JAR_FILE" ]; then
echo "Missing $JAR_FILE"
exit
fi
# Unpack the pre-built .jar files with data only
echo "Unpacking icudata.jar"
rm -fr main/core/src/main/resources/com/ibm/icu/impl/data/icudata
unzip -q -d main/core/src/main/resources/ main/shared/data/icudata.jar
rm -fr main/core/src/main/resources/META-INF
echo " Moving charset data"
rm -fr main/charset/src/main/resources/com/ibm/icu/impl/data/icudata
mkdir -p main/charset/src/main/resources/com/ibm/icu/impl/data/icudata/
mv main/core/src/main/resources/com/ibm/icu/impl/data/icudata/*.cnv main/charset/src/main/resources/com/ibm/icu/impl/data/icudata/
mv main/core/src/main/resources/com/ibm/icu/impl/data/icudata/cnvalias.icu main/charset/src/main/resources/com/ibm/icu/impl/data/icudata/
echo " Moving currency data"
rm -fr main/currdata/src/main/resources/com/ibm/icu/impl/data/icudata
mkdir -p main/currdata/src/main/resources/com/ibm/icu/impl/data/icudata/
mv main/core/src/main/resources/com/ibm/icu/impl/data/icudata/curr main/currdata/src/main/resources/com/ibm/icu/impl/data/icudata/curr
echo " Moving collate data"
rm -fr main/collate/src/main/resources/com/ibm/icu/impl/data/icudata
mkdir -p main/collate/src/main/resources/com/ibm/icu/impl/data/icudata/
mv main/core/src/main/resources/com/ibm/icu/impl/data/icudata/coll main/collate/src/main/resources/com/ibm/icu/impl/data/icudata/coll
echo " Moving langdata data"
rm -fr main/langdata/src/main/resources/com/ibm/icu/impl/data/icudata
mkdir -p main/langdata/src/main/resources/com/ibm/icu/impl/data/icudata/
mv main/core/src/main/resources/com/ibm/icu/impl/data/icudata/lang main/langdata/src/main/resources/com/ibm/icu/impl/data/icudata/lang
echo " Moving regiondata data"
rm -fr main/regiondata/src/main/resources/com/ibm/icu/impl/data/icudata
mkdir -p main/regiondata/src/main/resources/com/ibm/icu/impl/data/icudata/
mv main/core/src/main/resources/com/ibm/icu/impl/data/icudata/region main/regiondata/src/main/resources/com/ibm/icu/impl/data/icudata/region
echo " Moving translit data"
rm -fr main/translit/src/main/resources/com/ibm/icu/impl/data/icudata
mkdir -p main/translit/src/main/resources/com/ibm/icu/impl/data/icudata/
mv main/core/src/main/resources/com/ibm/icu/impl/data/icudata/translit main/translit/src/main/resources/com/ibm/icu/impl/data/icudata/translit
echo "Unpacking icutzdata.jar"
# This unzips together with other existing core files
# So we don't remove the folder
unzip -q -d main/core/src/main/resources/ main/shared/data/icutzdata.jar
rm -fr main/core/src/main/resources/META-INF
echo "Unpacking testdata.jar"
rm -fr main/core/src/test/resources/com/ibm/icu/dev/data/testdata/
unzip -q -d main/core/src/test/resources/ main/shared/data/testdata.jar
rm -fr main/core/src/test/resources/META-INF
echo "Removing jar files"
echo " icudata.jar"
rm main/shared/data/icudata.jar
echo " icutzdata.jar"
rm main/shared/data/icutzdata.jar
echo " testdata.jar"
rm main/shared/data/testdata.jar
echo DONE