# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/global/i18n/i18n.gni") import("//base/startup/init/services/etc/param/param_fixer.gni") import("//build/ohos.gni") group("build_module") { deps = [ ":intl_util", ":preferred_language", ] } group("geocoding_depends") { deps = [ "//third_party/libphonenumber/cpp:geocoding" ] } config("preferred_language_config") { include_dirs = [ "//base/global/i18n/interfaces/native/inner_api/preferred_language/include", ] } ohos_shared_library("preferred_language") { public_configs = [ ":preferred_language_config" ] include_dirs = [ "include" ] sources = [ "src/preferred_language.cpp" ] cflags_cc = [ "-Wall", "-fPIC", ] deps = [ "//base/global/i18n/frameworks/intl:intl_util" ] external_deps = [ "init:libbegetutil" ] if (i18n_support_app_preferred_language) { include_dirs += [ "//base/global/resource_management/frameworks/resmgr/include", "//foundation/bundlemanager/bundle_framework/interfaces/inner_api/appexecfwk_base/include/", "//foundation/bundlemanager/bundle_framework/interfaces/inner_api/appexecfwk_core/include/bundlemgr/", "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include/", ] external_deps += [ "ability_runtime:app_context", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "preferences:native_preferences", "resource_management:global_resmgr", "samgr:samgr_proxy", ] defines = [ "SUPPORT_APP_PREFERRED_LANGUAGE" ] } subsystem_name = "global" innerapi_tags = [ "platformsdk" ] part_name = "i18n" } config("intl_util_config") { include_dirs = [ "//third_party/icu/icu4c/source", "//third_party/icu/icu4c/source/common", "//third_party/icu/icu4c/source/i18n", "//third_party/icu/icu4c/source/common/unicode", "//base/global/i18n/frameworks/intl/include", "//base/global/i18n/interfaces/native/inner_api/i18n/include", ] if (i18n_support_ui) { include_dirs += [ "//foundation/ability/ability_base/interfaces/kits/native/configuration/include" ] } } ohos_shared_library("intl_util") { public_configs = [ ":intl_util_config" ] include_dirs = [ "//commonlibrary/c_utils/base/include", "//third_party/libxml2/include", "//third_party/libphonenumber/cpp/src", "//third_party/libphonenumber", "//third_party/protobuf/src", ] sources = [ "src/character.cpp", "src/collator.cpp", "src/date_rule_init.cpp", "src/date_time_filter.cpp", "src/date_time_format.cpp", "src/date_time_matched.cpp", "src/date_time_rule.cpp", "src/entity_recognizer.cpp", "src/holiday_manager.cpp", "src/i18n_break_iterator.cpp", "src/i18n_calendar.cpp", "src/i18n_normalizer.cpp", "src/i18n_timezone.cpp", "src/index_util.cpp", "src/locale_compare.cpp", "src/locale_config.cpp", "src/locale_info.cpp", "src/measure_data.cpp", "src/number_format.cpp", "src/phone_number_format.cpp", "src/phone_number_matched.cpp", "src/phone_number_rule.cpp", "src/plural_rules.cpp", "src/regex_rule.cpp", "src/relative_time_format.cpp", "src/rules_engine.cpp", "src/system_locale_manager.cpp", "src/taboo.cpp", "src/taboo_utils.cpp", "src/utils.cpp", ] version_script = "libintl_util.map" cflags_cc = [ "-Wall", "-fPIC", ] deps = [ ":CN_phonenumber_xml", ":GB_phonenumber_xml", ":common_datetime_xml", ":common_phonenumber_xml", ":config_locales_xml", ":config_regions_xml", ":dialect_languages_xml", ":en_Latn_lang_xml", ":en_Latn_region_xml", ":en_datetime_xml", ":forbidden_languages_xml", ":forbidden_regions_xml", ":i18n.para", ":i18n.para.dac", ":lang_supported_locales", ":region_supported_locales_xml", ":root_timezone_xml", ":timezones_xml", ":tz_pixel_dat", ":white_languages_xml", ":zh_Hans_lang_xml", ":zh_Hans_region_xml", ":zh_Hans_timezone_xml", ":zh_datetime_xml", "//third_party/icu/icu4c:ohos_icudat", "//third_party/icu/icu4c:shared_icui18n", "//third_party/icu/icu4c:shared_icuuc", "//third_party/libphonenumber/cpp:phonenumber_standard", "//third_party/libpng:libpng", "//third_party/libxml2:xml2", ] use_exceptions = true external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", ] defines = [] if (i18n_support_ui) { include_dirs += [ "//foundation/ability/ability_runtime/interfaces/inner_api/app_manager/include/appmgr", "//foundation/ability/ability_runtime/interfaces/inner_api/ability_manager/include", "//foundation/multimodalinput/input/interfaces/native/innerkits/event/include/", ] external_deps += [ "ability_base:configuration", "ability_base:want", "ability_runtime:ability_manager", "ability_runtime:app_manager", "common_event_service:cesfwk_innerkits", ] defines += [ "SUPPORT_GRAPHICS" ] } if (is_asan) { defines += [ "SUPPORT_ASAN" ] } install_images = [ system_base_dir ] relative_install_dir = "platformsdk" subsystem_name = "global" innerapi_tags = [ "platformsdk" ] part_name = "i18n" } ohos_prebuilt_para("i18n.para") { source = "//base/global/i18n/frameworks/intl/etc/i18n.para" part_name = "i18n" module_install_dir = "etc/param" } ohos_prebuilt_para("i18n.para.dac") { source = "//base/global/i18n/frameworks/intl/etc/i18n.para.dac" part_name = "i18n" module_install_dir = "etc/param" } ohos_prebuilt_etc("config_locales_xml") { source = "//base/global/i18n/frameworks/intl/etc/supported_locales.xml" module_install_dir = "usr/ohos_locale_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("config_regions_xml") { source = "//base/global/i18n/frameworks/intl/etc/supported_regions.xml" module_install_dir = "usr/ohos_locale_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("white_languages_xml") { source = "//base/global/i18n/frameworks/intl/etc/white_languages.xml" module_install_dir = "usr/ohos_locale_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("forbidden_languages_xml") { source = "//base/global/i18n/frameworks/intl/etc/forbidden_languages.xml" module_install_dir = "usr/ohos_locale_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("CN_phonenumber_xml") { source = "//base/global/i18n/frameworks/intl/etc/phonenumber/CN.xml" module_install_dir = "usr/ohos_locale_config/phonenumber/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("GB_phonenumber_xml") { source = "//base/global/i18n/frameworks/intl/etc/phonenumber/GB.xml" module_install_dir = "usr/ohos_locale_config/phonenumber/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("common_phonenumber_xml") { source = "//base/global/i18n/frameworks/intl/etc/phonenumber/common.xml" module_install_dir = "usr/ohos_locale_config/phonenumber/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("zh_datetime_xml") { source = "//base/global/i18n/frameworks/intl/etc/datetime/zh.xml" module_install_dir = "usr/ohos_locale_config/datetime/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("en_datetime_xml") { source = "//base/global/i18n/frameworks/intl/etc/datetime/en.xml" module_install_dir = "usr/ohos_locale_config/datetime/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("common_datetime_xml") { source = "//base/global/i18n/frameworks/intl/etc/datetime/common.xml" module_install_dir = "usr/ohos_locale_config/datetime/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("forbidden_regions_xml") { source = "//base/global/i18n/frameworks/intl/etc/forbidden_regions.xml" module_install_dir = "usr/ohos_locale_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("lang_supported_locales") { source = "//base/global/i18n/frameworks/intl/etc/lang/supported_locales.xml" module_install_dir = "etc/ohos_lang_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("zh_Hans_lang_xml") { source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hans.xml" module_install_dir = "etc/ohos_lang_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("zh_Hans_timezone_xml") { source = "//base/global/i18n/frameworks/intl/etc/timezone/zh_Hans.xml" module_install_dir = "usr/ohos_timezone/ohos_city_dispname/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("en_Latn_lang_xml") { source = "//base/global/i18n/frameworks/intl/etc/lang/en-Latn.xml" module_install_dir = "etc/ohos_lang_config/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("root_timezone_xml") { source = "//base/global/i18n/frameworks/intl/etc/timezone/root.xml" module_install_dir = "usr/ohos_timezone/ohos_city_dispname/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("timezones_xml") { source = "//base/global/i18n/frameworks/intl/etc/timezone/ohos_timezones.xml" module_install_dir = "usr/ohos_timezone/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("tz_pixel_dat") { source = "//base/global/i18n/frameworks/intl/etc/timezone/tz_2023001-000360.dat" module_install_dir = "usr/ohos_timezone/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("region_supported_locales_xml") { source = "//base/global/i18n/frameworks/intl/etc/region/supported_regions.xml" module_install_dir = "usr/ohos_locale_config/region/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("zh_Hans_region_xml") { source = "//base/global/i18n/frameworks/intl/etc/region/zh-Hans.xml" module_install_dir = "usr/ohos_locale_config/region/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("en_Latn_region_xml") { source = "//base/global/i18n/frameworks/intl/etc/region/en-Latn-US.xml" module_install_dir = "usr/ohos_locale_config/region/" part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("dialect_languages_xml") { source = "//base/global/i18n/frameworks/intl/etc/dialect_languages.xml" module_install_dir = "usr/ohos_locale_config/" part_name = "i18n" subsystem_name = "global" }