• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/global/i18n/i18n.gni")
15import("//build/config/components/init/param/param_fixer.gni")
16import("//build/ohos.gni")
17
18group("build_module") {
19  deps = [
20    ":hmos_cust_libphonenumber_mount",
21    ":hmos_cust_taboo_mount",
22    ":hmos_cust_timezone_mount",
23    ":intl_util",
24    ":preferred_language",
25    "./parameter_upgrade:libphonenumber_version_txt",
26    "./parameter_upgrade:prefabrication_libphonenumber",
27    "./parameter_upgrade:prefabrication_timezone",
28    "./parameter_upgrade:taboo_version_txt",
29    "./parameter_upgrade:timezone_version_txt",
30  ]
31}
32
33group("geocoding_depends") {
34  external_deps = [ "libphonenumber:geocoding" ]
35}
36
37config("preferred_language_config") {
38  include_dirs = [
39    "//base/global/i18n/interfaces/native/inner_api/preferred_language/include",
40  ]
41}
42ohos_shared_library("preferred_language") {
43  public_configs = [ ":preferred_language_config" ]
44  include_dirs = [ "include" ]
45  sources = [ "src/preferred_language.cpp" ]
46  cflags_cc = [
47    "-Wall",
48    "-fPIC",
49  ]
50  deps = [ "//base/global/i18n/frameworks/intl:intl_util" ]
51  external_deps = [
52    "hilog:libhilog",
53    "init:libbegetutil",
54  ]
55  if (i18n_support_app_preferred_language) {
56    external_deps += [
57      "ability_runtime:app_context",
58      "bundle_framework:appexecfwk_base",
59      "bundle_framework:appexecfwk_core",
60      "c_utils:utils",
61      "ipc:ipc_core",
62      "resource_management:global_resmgr",
63      "samgr:samgr_proxy",
64    ]
65    if (!(host_os == "linux" && host_cpu == "arm64")) {
66      external_deps += [ "preferences:native_preferences" ]
67    }
68    defines = [ "SUPPORT_APP_PREFERRED_LANGUAGE" ]
69  }
70  subsystem_name = "global"
71  innerapi_tags = [ "platformsdk" ]
72  part_name = "i18n"
73}
74
75config("intl_util_config") {
76  include_dirs = [
77    "//base/global/i18n/frameworks/intl/entity_recognition/date_time_recognition/include",
78    "//base/global/i18n/frameworks/intl/entity_recognition/include",
79    "//base/global/i18n/frameworks/intl/entity_recognition/phone_number_recognition/include",
80    "//base/global/i18n/frameworks/intl/include",
81    "//base/global/i18n/frameworks/intl/parameter_upgrade/include",
82    "//base/global/i18n/interfaces/native/inner_api/i18n/include",
83  ]
84}
85ohos_shared_library("intl_util") {
86  branch_protector_ret = "pac_ret"
87  public_configs = [ ":intl_util_config" ]
88  include_dirs = []
89  sources = [ "src/lunar_calendar.cpp" ]
90  external_deps = [
91    "hilog:libhilog",
92    "icu:shared_icui18n",
93    "icu:shared_icuuc",
94  ]
95  cflags_cc = [
96    "-Wall",
97    "-fPIC",
98    "-frtti",
99  ]
100  remove_configs = [ "//build/config/compiler:no_rtti" ]
101  use_exceptions = true
102  if (!build_ohos_sdk) {
103    sources += [
104      "entity_recognition/date_time_recognition/src/date_rule_init.cpp",
105      "entity_recognition/date_time_recognition/src/date_time_filter.cpp",
106      "entity_recognition/date_time_recognition/src/date_time_matched.cpp",
107      "entity_recognition/date_time_recognition/src/date_time_rule.cpp",
108      "entity_recognition/date_time_recognition/src/date_time_sequence.cpp",
109      "entity_recognition/date_time_recognition/src/rules_engine.cpp",
110      "entity_recognition/phone_number_recognition/src/border_rule.cpp",
111      "entity_recognition/phone_number_recognition/src/code_rule.cpp",
112      "entity_recognition/phone_number_recognition/src/find_rule.cpp",
113      "entity_recognition/phone_number_recognition/src/negative_rule.cpp",
114      "entity_recognition/phone_number_recognition/src/phone_number_matched.cpp",
115      "entity_recognition/phone_number_recognition/src/phone_number_rule.cpp",
116      "entity_recognition/phone_number_recognition/src/positive_rule.cpp",
117      "entity_recognition/phone_number_recognition/src/regex_rule.cpp",
118      "entity_recognition/src/entity_recognizer.cpp",
119      "parameter_upgrade/src/signature_verifier.cpp",
120      "parameter_upgrade/src/upgrade_utils.cpp",
121      "src/character.cpp",
122      "src/collator.cpp",
123      "src/date_time_format.cpp",
124      "src/holiday_manager.cpp",
125      "src/i18n_break_iterator.cpp",
126      "src/i18n_calendar.cpp",
127      "src/i18n_normalizer.cpp",
128      "src/i18n_timezone.cpp",
129      "src/index_util.cpp",
130      "src/locale_compare.cpp",
131      "src/locale_config.cpp",
132      "src/locale_data.cpp",
133      "src/locale_info.cpp",
134      "src/locale_matcher.cpp",
135      "src/locale_util.cpp",
136      "src/measure_data.cpp",
137      "src/multi_users.cpp",
138      "src/number_format.cpp",
139      "src/phone_number_format.cpp",
140      "src/plural_rules.cpp",
141      "src/relative_time_format.cpp",
142      "src/simple_date_time_format.cpp",
143      "src/simple_number_format.cpp",
144      "src/styled_number_format.cpp",
145      "src/system_locale_manager.cpp",
146      "src/taboo.cpp",
147      "src/taboo_utils.cpp",
148      "src/utils.cpp",
149    ]
150    version_script = "libintl_util.map"
151    deps = [
152      ":CN_phonenumber_xml",
153      ":GB_phonenumber_xml",
154      ":bo_lang_xml",
155      ":common_datetime_xml",
156      ":common_phonenumber_xml",
157      ":config_locales_old_xml",
158      ":config_locales_xml",
159      ":dialect_languages_xml",
160      ":en_Latn_lang_xml",
161      ":en_datetime_xml",
162      ":i18n.para",
163      ":i18n.para.dac",
164      ":i18n_param_config_xml",
165      ":lang_supported_locales",
166      ":region_supported_locales_xml",
167      ":root_timezone_xml",
168      ":timezones_xml",
169      ":ug_lang_xml",
170      ":zh_Hans_lang_xml",
171      ":zh_Hans_timezone_xml",
172      ":zh_Hant_HK_lang_xml",
173      ":zh_Hant_lang_xml",
174      ":zh_datetime_xml",
175    ]
176    external_deps += [
177      "access_token:libaccesstoken_sdk",
178      "access_token:libtokenid_sdk",
179      "c_utils:utils",
180      "config_policy:configpolicy_util",
181      "icu:icundk",
182      "init:libbegetutil",
183      "ipc:ipc_core",
184      "libphonenumber:phonenumber_standard",
185      "libpng:libpng",
186      "libxml2:libxml2",
187      "openssl:libcrypto_shared",
188      "openssl:libssl_shared",
189      "os_account:os_account_innerkits",
190      "preferences:native_preferences",
191    ]
192    public_external_deps = []
193    defines = []
194    if (i18n_support_ui) {
195      public_external_deps += [
196        "ability_base:base",
197        "ability_base:configuration",
198        "ability_base:want",
199      ]
200      external_deps += [
201        "ability_runtime:ability_manager",
202        "ability_runtime:app_manager",
203        "common_event_service:cesfwk_innerkits",
204      ]
205      defines += [ "SUPPORT_GRAPHICS" ]
206    }
207    if (is_asan) {
208      defines += [ "SUPPORT_ASAN" ]
209    }
210    if (target_platform == "pc") {
211      defines += [ "SUPPORT_MULTI_USER" ]
212    }
213  }
214  install_images = [ system_base_dir ]
215  relative_install_dir = "platformsdk"
216  subsystem_name = "global"
217  innerapi_tags = [ "platformsdk" ]
218  part_name = "i18n"
219}
220
221ohos_prebuilt_para("i18n.para") {
222  source = "//base/global/i18n/frameworks/intl/etc/i18n.para"
223  part_name = "i18n"
224  subsystem_name = "global"
225  module_install_dir = "etc/param"
226}
227
228ohos_prebuilt_para("i18n.para.dac") {
229  source = "//base/global/i18n/frameworks/intl/etc/i18n.para.dac"
230  part_name = "i18n"
231  subsystem_name = "global"
232  module_install_dir = "etc/param"
233}
234
235ohos_prebuilt_etc("config_locales_xml") {
236  source = "//base/global/i18n/frameworks/intl/etc/supported_locales.xml"
237  module_install_dir = "usr/ohos_locale_config/"
238  part_name = "i18n"
239  subsystem_name = "global"
240}
241
242ohos_prebuilt_etc("config_locales_old_xml") {
243  source = "//base/global/i18n/frameworks/intl/etc/supported_locales_old.xml"
244  module_install_dir = "usr/ohos_locale_config/"
245  part_name = "i18n"
246  subsystem_name = "global"
247}
248
249ohos_prebuilt_etc("i18n_param_config_xml") {
250  source = "//base/global/i18n/frameworks/intl/etc/i18n_param_config.xml"
251  module_install_dir = "etc/xml/"
252  part_name = "i18n"
253  subsystem_name = "global"
254}
255
256ohos_prebuilt_etc("CN_phonenumber_xml") {
257  source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/phonenumber/CN.xml"
258  module_install_dir = "usr/ohos_locale_config/phonenumber/"
259  part_name = "i18n"
260  subsystem_name = "global"
261}
262
263ohos_prebuilt_etc("GB_phonenumber_xml") {
264  source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/phonenumber/GB.xml"
265  module_install_dir = "usr/ohos_locale_config/phonenumber/"
266  part_name = "i18n"
267  subsystem_name = "global"
268}
269
270ohos_prebuilt_etc("common_phonenumber_xml") {
271  source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/phonenumber/common.xml"
272  module_install_dir = "usr/ohos_locale_config/phonenumber/"
273  part_name = "i18n"
274  subsystem_name = "global"
275}
276
277ohos_prebuilt_etc("zh_datetime_xml") {
278  source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/datetime/zh.xml"
279  module_install_dir = "usr/ohos_locale_config/datetime/"
280  part_name = "i18n"
281  subsystem_name = "global"
282}
283
284ohos_prebuilt_etc("en_datetime_xml") {
285  source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/datetime/en.xml"
286  module_install_dir = "usr/ohos_locale_config/datetime/"
287  part_name = "i18n"
288  subsystem_name = "global"
289}
290
291ohos_prebuilt_etc("common_datetime_xml") {
292  source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/datetime/common.xml"
293  module_install_dir = "usr/ohos_locale_config/datetime/"
294  part_name = "i18n"
295  subsystem_name = "global"
296}
297
298ohos_prebuilt_etc("lang_supported_locales") {
299  source = "//base/global/i18n/frameworks/intl/etc/lang/supported_locales.xml"
300  module_install_dir = "etc/ohos_lang_config/"
301  part_name = "i18n"
302  subsystem_name = "global"
303}
304
305ohos_prebuilt_etc("zh_Hans_lang_xml") {
306  source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hans.xml"
307  module_install_dir = "etc/ohos_lang_config/"
308  part_name = "i18n"
309  subsystem_name = "global"
310}
311
312ohos_prebuilt_etc("zh_Hant_lang_xml") {
313  source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hant.xml"
314  module_install_dir = "etc/ohos_lang_config/"
315  part_name = "i18n"
316  subsystem_name = "global"
317}
318
319ohos_prebuilt_etc("zh_Hant_HK_lang_xml") {
320  source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hant-HK.xml"
321  module_install_dir = "etc/ohos_lang_config/"
322  part_name = "i18n"
323  subsystem_name = "global"
324}
325
326ohos_prebuilt_etc("bo_lang_xml") {
327  source = "//base/global/i18n/frameworks/intl/etc/lang/bo.xml"
328  module_install_dir = "etc/ohos_lang_config/"
329  part_name = "i18n"
330  subsystem_name = "global"
331}
332
333ohos_prebuilt_etc("ug_lang_xml") {
334  source = "//base/global/i18n/frameworks/intl/etc/lang/ug.xml"
335  module_install_dir = "etc/ohos_lang_config/"
336  part_name = "i18n"
337  subsystem_name = "global"
338}
339
340ohos_prebuilt_etc("zh_Hans_timezone_xml") {
341  source = "//base/global/i18n/frameworks/intl/etc/timezone/zh_Hans.xml"
342  module_install_dir = "usr/ohos_timezone/ohos_city_dispname/"
343  part_name = "i18n"
344  subsystem_name = "global"
345}
346
347ohos_prebuilt_etc("en_Latn_lang_xml") {
348  source = "//base/global/i18n/frameworks/intl/etc/lang/en-Latn.xml"
349  module_install_dir = "etc/ohos_lang_config/"
350  part_name = "i18n"
351  subsystem_name = "global"
352}
353
354ohos_prebuilt_etc("root_timezone_xml") {
355  source = "//base/global/i18n/frameworks/intl/etc/timezone/root.xml"
356  module_install_dir = "usr/ohos_timezone/ohos_city_dispname/"
357  part_name = "i18n"
358  subsystem_name = "global"
359}
360
361ohos_prebuilt_etc("timezones_xml") {
362  source = "//base/global/i18n/frameworks/intl/etc/timezone/ohos_timezones.xml"
363  module_install_dir = "usr/ohos_timezone/"
364  part_name = "i18n"
365  subsystem_name = "global"
366}
367
368ohos_prebuilt_etc("region_supported_locales_xml") {
369  source = "//base/global/i18n/frameworks/intl/etc/region/supported_regions.xml"
370  module_install_dir = "usr/ohos_locale_config/region/"
371  part_name = "i18n"
372  subsystem_name = "global"
373}
374
375ohos_prebuilt_etc("dialect_languages_xml") {
376  source = "//base/global/i18n/frameworks/intl/etc/dialect_languages.xml"
377  module_install_dir = "usr/ohos_locale_config/"
378  part_name = "i18n"
379  subsystem_name = "global"
380}
381
382ohos_executable("hmos_cust_libphonenumber_mount") {
383  sources = [ "./parameter_upgrade/mount/hmos_libphonenumber_mount.cpp" ]
384  include_dirs = [ "./include" ]
385  deps = [ ":intl_util" ]
386  external_deps = [
387    "hilog:libhilog",
388    "openssl:libcrypto_shared",
389    "openssl:libssl_shared",
390  ]
391  install_images = [ "system" ]
392  part_name = "i18n"
393  subsystem_name = "global"
394}
395
396ohos_executable("hmos_cust_taboo_mount") {
397  sources = [ "./parameter_upgrade/mount/hmos_taboo_mount.cpp" ]
398  include_dirs = [ "./include" ]
399  deps = [ ":intl_util" ]
400  external_deps = [
401    "hilog:libhilog",
402    "openssl:libcrypto_shared",
403    "openssl:libssl_shared",
404  ]
405  install_images = [ "system" ]
406  part_name = "i18n"
407  subsystem_name = "global"
408}
409
410ohos_executable("hmos_cust_timezone_mount") {
411  sources = [ "./parameter_upgrade/mount/hmos_timezone_mount.cpp" ]
412  include_dirs = [ "./include" ]
413  deps = [ ":intl_util" ]
414  external_deps = [
415    "hilog:libhilog",
416    "init:libbegetutil",
417    "openssl:libcrypto_shared",
418    "openssl:libssl_shared",
419  ]
420  install_images = [ "system" ]
421  part_name = "i18n"
422  subsystem_name = "global"
423}
424