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 ":intl_util", 21 ":preferred_language", 22 "./parameter_upgrade:libphonenumber_version_txt", 23 "./parameter_upgrade:prefabrication_libphonenumber", 24 "./parameter_upgrade:prefabrication_timezone", 25 "./parameter_upgrade:taboo_version_txt", 26 "./parameter_upgrade:timezone_version_txt", 27 ] 28} 29 30group("geocoding_depends") { 31 external_deps = [ "libphonenumber:geocoding" ] 32} 33 34config("preferred_language_config") { 35 include_dirs = [ 36 "//base/global/i18n/interfaces/native/inner_api/preferred_language/include", 37 ] 38} 39ohos_shared_library("preferred_language") { 40 public_configs = [ ":preferred_language_config" ] 41 include_dirs = [ "include" ] 42 sources = [ "src/preferred_language.cpp" ] 43 cflags_cc = [ 44 "-Wall", 45 "-fPIC", 46 ] 47 deps = [ "//base/global/i18n/frameworks/intl:intl_util" ] 48 external_deps = [ 49 "hilog:libhilog", 50 "init:libbegetutil", 51 ] 52 if (i18n_support_app_preferred_language) { 53 external_deps += [ 54 "ability_runtime:app_context", 55 "bundle_framework:appexecfwk_base", 56 "bundle_framework:appexecfwk_core", 57 "c_utils:utils", 58 "ipc:ipc_core", 59 "resource_management:global_resmgr", 60 "samgr:samgr_proxy", 61 ] 62 if (!(host_os == "linux" && host_cpu == "arm64")) { 63 external_deps += [ "preferences:native_preferences" ] 64 } 65 defines = [ "SUPPORT_APP_PREFERRED_LANGUAGE" ] 66 } 67 subsystem_name = "global" 68 innerapi_tags = [ "platformsdk" ] 69 part_name = "i18n" 70} 71 72config("intl_util_config") { 73 include_dirs = [ 74 "//base/global/i18n/frameworks/intl/entity_recognition/date_time_recognition/include", 75 "//base/global/i18n/frameworks/intl/entity_recognition/include", 76 "//base/global/i18n/frameworks/intl/entity_recognition/phone_number_recognition/include", 77 "//base/global/i18n/frameworks/intl/include", 78 "//base/global/i18n/frameworks/intl/parameter_upgrade/include", 79 "//base/global/i18n/frameworks/intl/timezone/include", 80 "//base/global/i18n/interfaces/native/inner_api/i18n/include", 81 ] 82} 83ohos_shared_library("intl_util") { 84 branch_protector_ret = "pac_ret" 85 public_configs = [ ":intl_util_config" ] 86 include_dirs = [] 87 sources = [ "src/lunar_calendar.cpp" ] 88 external_deps = [ 89 "hilog:libhilog", 90 "icu:shared_icui18n", 91 "icu:shared_icuuc", 92 ] 93 cflags_cc = [ 94 "-Wall", 95 "-fPIC", 96 "-frtti", 97 ] 98 remove_configs = [ "//build/config/compiler:no_rtti" ] 99 use_exceptions = true 100 if (!build_ohos_sdk) { 101 sources += [ 102 "entity_recognition/date_time_recognition/src/date_rule_init.cpp", 103 "entity_recognition/date_time_recognition/src/date_time_filter.cpp", 104 "entity_recognition/date_time_recognition/src/date_time_matched.cpp", 105 "entity_recognition/date_time_recognition/src/date_time_rule.cpp", 106 "entity_recognition/date_time_recognition/src/date_time_sequence.cpp", 107 "entity_recognition/date_time_recognition/src/rules_engine.cpp", 108 "entity_recognition/phone_number_recognition/src/border_rule.cpp", 109 "entity_recognition/phone_number_recognition/src/code_rule.cpp", 110 "entity_recognition/phone_number_recognition/src/find_rule.cpp", 111 "entity_recognition/phone_number_recognition/src/negative_rule.cpp", 112 "entity_recognition/phone_number_recognition/src/phone_number_matched.cpp", 113 "entity_recognition/phone_number_recognition/src/phone_number_rule.cpp", 114 "entity_recognition/phone_number_recognition/src/positive_rule.cpp", 115 "entity_recognition/phone_number_recognition/src/regex_rule.cpp", 116 "entity_recognition/src/entity_recognizer.cpp", 117 "parameter_upgrade/src/signature_verifier.cpp", 118 "parameter_upgrade/src/upgrade_utils.cpp", 119 "src/character.cpp", 120 "src/collator.cpp", 121 "src/date_time_format.cpp", 122 "src/displaynames.cpp", 123 "src/format_utils.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/intl_date_time_format.cpp", 131 "src/intl_plural_rules.cpp", 132 "src/locale_compare.cpp", 133 "src/locale_config.cpp", 134 "src/locale_data.cpp", 135 "src/locale_helper.cpp", 136 "src/locale_info.cpp", 137 "src/locale_matcher.cpp", 138 "src/locale_util.cpp", 139 "src/measure_data.cpp", 140 "src/multi_users.cpp", 141 "src/number_format.cpp", 142 "src/phone_number_format.cpp", 143 "src/plural_rules.cpp", 144 "src/relative_time_format.cpp", 145 "src/simple_date_time_format.cpp", 146 "src/simple_number_format.cpp", 147 "src/styled_number_format.cpp", 148 "src/system_locale_manager.cpp", 149 "src/taboo.cpp", 150 "src/taboo_utils.cpp", 151 "src/utils.cpp", 152 "timezone/src/zone_offset_transition.cpp", 153 "timezone/src/zone_rules.cpp", 154 ] 155 version_script = "libintl_util.map" 156 deps = [ 157 ":CN_phonenumber_xml", 158 ":GB_phonenumber_xml", 159 ":bo_lang_xml", 160 ":common_datetime_xml", 161 ":common_phonenumber_xml", 162 ":config_locales_old_xml", 163 ":config_locales_xml", 164 ":dialect_languages_xml", 165 ":en_Latn_lang_xml", 166 ":en_datetime_xml", 167 ":i18n.para", 168 ":i18n.para.dac", 169 ":i18n_param_config_xml", 170 ":lang_supported_locales", 171 ":region_supported_locales_xml", 172 ":root_timezone_xml", 173 ":timezones_xml", 174 ":ug_lang_xml", 175 ":zh_Hans_lang_xml", 176 ":zh_Hans_timezone_xml", 177 ":zh_Hant_HK_lang_xml", 178 ":zh_Hant_lang_xml", 179 ":zh_datetime_xml", 180 ] 181 external_deps += [ 182 "access_token:libaccesstoken_sdk", 183 "access_token:libtokenid_sdk", 184 "c_utils:utils", 185 "config_policy:configpolicy_util", 186 "icu:icundk", 187 "init:libbegetutil", 188 "ipc:ipc_core", 189 "libphonenumber:phonenumber_standard", 190 "libpng:libpng", 191 "libxml2:libxml2", 192 "openssl:libcrypto_shared", 193 "openssl:libssl_shared", 194 "os_account:os_account_innerkits", 195 "preferences:native_preferences", 196 ] 197 public_external_deps = [] 198 defines = [] 199 if (i18n_support_ui) { 200 public_external_deps += [ 201 "ability_base:base", 202 "ability_base:configuration", 203 ] 204 external_deps += [ 205 "ability_base:want", 206 "ability_runtime:ability_manager", 207 "ability_runtime:app_manager", 208 "common_event_service:cesfwk_innerkits", 209 ] 210 defines += [ "SUPPORT_GRAPHICS" ] 211 } 212 if (is_asan) { 213 defines += [ "SUPPORT_ASAN" ] 214 } 215 if (target_platform == "pc") { 216 defines += [ "SUPPORT_MULTI_USER" ] 217 } 218 } 219 install_images = [ system_base_dir ] 220 relative_install_dir = "platformsdk" 221 subsystem_name = "global" 222 innerapi_tags = [ "platformsdk" ] 223 part_name = "i18n" 224} 225 226ohos_prebuilt_para("i18n.para") { 227 source = "//base/global/i18n/frameworks/intl/etc/i18n.para" 228 part_name = "i18n" 229 subsystem_name = "global" 230 module_install_dir = "etc/param" 231} 232 233ohos_prebuilt_para("i18n.para.dac") { 234 source = "//base/global/i18n/frameworks/intl/etc/i18n.para.dac" 235 part_name = "i18n" 236 subsystem_name = "global" 237 module_install_dir = "etc/param" 238} 239 240ohos_prebuilt_etc("config_locales_xml") { 241 source = "//base/global/i18n/frameworks/intl/etc/supported_locales.xml" 242 module_install_dir = "usr/ohos_locale_config/" 243 part_name = "i18n" 244 subsystem_name = "global" 245} 246 247ohos_prebuilt_etc("config_locales_old_xml") { 248 source = "//base/global/i18n/frameworks/intl/etc/supported_locales_old.xml" 249 module_install_dir = "usr/ohos_locale_config/" 250 part_name = "i18n" 251 subsystem_name = "global" 252} 253 254ohos_prebuilt_etc("i18n_param_config_xml") { 255 source = "//base/global/i18n/frameworks/intl/etc/i18n_param_config.xml" 256 module_install_dir = "etc/xml/" 257 part_name = "i18n" 258 subsystem_name = "global" 259} 260 261ohos_prebuilt_etc("CN_phonenumber_xml") { 262 source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/phonenumber/CN.xml" 263 module_install_dir = "usr/ohos_locale_config/phonenumber/" 264 part_name = "i18n" 265 subsystem_name = "global" 266} 267 268ohos_prebuilt_etc("GB_phonenumber_xml") { 269 source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/phonenumber/GB.xml" 270 module_install_dir = "usr/ohos_locale_config/phonenumber/" 271 part_name = "i18n" 272 subsystem_name = "global" 273} 274 275ohos_prebuilt_etc("common_phonenumber_xml") { 276 source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/phonenumber/common.xml" 277 module_install_dir = "usr/ohos_locale_config/phonenumber/" 278 part_name = "i18n" 279 subsystem_name = "global" 280} 281 282ohos_prebuilt_etc("zh_datetime_xml") { 283 source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/datetime/zh.xml" 284 module_install_dir = "usr/ohos_locale_config/datetime/" 285 part_name = "i18n" 286 subsystem_name = "global" 287} 288 289ohos_prebuilt_etc("en_datetime_xml") { 290 source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/datetime/en.xml" 291 module_install_dir = "usr/ohos_locale_config/datetime/" 292 part_name = "i18n" 293 subsystem_name = "global" 294} 295 296ohos_prebuilt_etc("common_datetime_xml") { 297 source = "//base/global/i18n/frameworks/intl/entity_recognition/etc/datetime/common.xml" 298 module_install_dir = "usr/ohos_locale_config/datetime/" 299 part_name = "i18n" 300 subsystem_name = "global" 301} 302 303ohos_prebuilt_etc("lang_supported_locales") { 304 source = "//base/global/i18n/frameworks/intl/etc/lang/supported_locales.xml" 305 module_install_dir = "etc/ohos_lang_config/" 306 part_name = "i18n" 307 subsystem_name = "global" 308} 309 310ohos_prebuilt_etc("zh_Hans_lang_xml") { 311 source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hans.xml" 312 module_install_dir = "etc/ohos_lang_config/" 313 part_name = "i18n" 314 subsystem_name = "global" 315} 316 317ohos_prebuilt_etc("zh_Hant_lang_xml") { 318 source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hant.xml" 319 module_install_dir = "etc/ohos_lang_config/" 320 part_name = "i18n" 321 subsystem_name = "global" 322} 323 324ohos_prebuilt_etc("zh_Hant_HK_lang_xml") { 325 source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hant-HK.xml" 326 module_install_dir = "etc/ohos_lang_config/" 327 part_name = "i18n" 328 subsystem_name = "global" 329} 330 331ohos_prebuilt_etc("bo_lang_xml") { 332 source = "//base/global/i18n/frameworks/intl/etc/lang/bo.xml" 333 module_install_dir = "etc/ohos_lang_config/" 334 part_name = "i18n" 335 subsystem_name = "global" 336} 337 338ohos_prebuilt_etc("ug_lang_xml") { 339 source = "//base/global/i18n/frameworks/intl/etc/lang/ug.xml" 340 module_install_dir = "etc/ohos_lang_config/" 341 part_name = "i18n" 342 subsystem_name = "global" 343} 344 345ohos_prebuilt_etc("zh_Hans_timezone_xml") { 346 source = "//base/global/i18n/frameworks/intl/etc/timezone/zh_Hans.xml" 347 module_install_dir = "usr/ohos_timezone/ohos_city_dispname/" 348 part_name = "i18n" 349 subsystem_name = "global" 350} 351 352ohos_prebuilt_etc("en_Latn_lang_xml") { 353 source = "//base/global/i18n/frameworks/intl/etc/lang/en-Latn.xml" 354 module_install_dir = "etc/ohos_lang_config/" 355 part_name = "i18n" 356 subsystem_name = "global" 357} 358 359ohos_prebuilt_etc("root_timezone_xml") { 360 source = "//base/global/i18n/frameworks/intl/etc/timezone/root.xml" 361 module_install_dir = "usr/ohos_timezone/ohos_city_dispname/" 362 part_name = "i18n" 363 subsystem_name = "global" 364} 365 366ohos_prebuilt_etc("timezones_xml") { 367 source = "//base/global/i18n/frameworks/intl/etc/timezone/ohos_timezones.xml" 368 module_install_dir = "usr/ohos_timezone/" 369 part_name = "i18n" 370 subsystem_name = "global" 371} 372 373ohos_prebuilt_etc("region_supported_locales_xml") { 374 source = "//base/global/i18n/frameworks/intl/etc/region/supported_regions.xml" 375 module_install_dir = "usr/ohos_locale_config/region/" 376 part_name = "i18n" 377 subsystem_name = "global" 378} 379 380ohos_prebuilt_etc("dialect_languages_xml") { 381 source = "//base/global/i18n/frameworks/intl/etc/dialect_languages.xml" 382 module_install_dir = "usr/ohos_locale_config/" 383 part_name = "i18n" 384 subsystem_name = "global" 385} 386