xref: /aosp_15_r20/external/cronet/third_party/icu/scripts/make_data_all.sh (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1#!/bin/bash
2
3set -x -e # stop if fail
4
5ICUROOT="$(dirname "$0")/.."
6
7function config_data {
8  if [ $# -lt 1 ];
9  then
10    echo "config target missing." >&2
11    echo "Should be (android|cast|chromeos|common|flutter|flutter_desktop|ios)" >&2
12    exit 1
13  fi
14
15  ICU_DATA_FILTER_FILE="${ICUROOT}/filters/$1.json" \
16  "${ICUROOT}/source/runConfigureICU" --enable-debug --disable-release \
17    Linux/gcc --disable-tests  --disable-layoutex --enable-rpath \
18    --prefix="$(pwd)" || \
19    { echo "failed to configure data for $1" >&2; exit 1; }
20}
21
22echo "Build the necessary tools"
23"${ICUROOT}/source/runConfigureICU" --enable-debug --disable-release \
24    Linux/gcc  --disable-tests --disable-layoutex --enable-rpath \
25    --prefix="$(pwd)"
26make -j 120
27
28echo "Build the filtered data for common"
29(cd data && make clean)
30config_data common
31make -j 120
32$ICUROOT/scripts/copy_data.sh common
33
34echo "Build the filtered data for chromeos"
35(cd data && make clean)
36config_data chromeos
37make -j 120
38$ICUROOT/scripts/copy_data.sh chromeos
39
40echo "Build the filtered data for Cast"
41(cd data && make clean)
42config_data cast
43$ICUROOT/cast/patch_locale.sh || exit 1
44make -j 120
45$ICUROOT/scripts/copy_data.sh cast
46
47echo "Build the filtered data for Android"
48(cd data && make clean)
49config_data android
50make -j 120
51$ICUROOT/scripts/copy_data.sh android
52
53echo "Build the filtered data for iOS"
54(cd data && make clean)
55config_data ios
56make -j 120
57$ICUROOT/scripts/copy_data.sh ios
58
59echo "Build the filtered data for Flutter"
60(cd data && make clean)
61config_data flutter
62$ICUROOT/flutter/patch_brkitr.sh || exit 1
63make -j 120
64$ICUROOT/scripts/copy_data.sh flutter
65
66echo "Build the filtered data for Flutter Desktop"
67${ICUROOT}/scripts/clean_up_data_source.sh
68(cd data && make clean)
69config_data flutter_desktop
70make -j 120
71$ICUROOT/scripts/copy_data.sh flutter_desktop
72
73echo "Clean up the git"
74$ICUROOT/scripts/clean_up_data_source.sh
75