From a34f0546b095b068bf92df5c3b0b28daf98dc35d Mon Sep 17 00:00:00 2001 From: xieyh0509 Date: Mon, 13 Nov 2023 19:49:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Evcard=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8Cbuild=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuxiyao223 --- bundle.json | 13 +++- frameworks/js/vcard/BUILD.gn | 59 ++++++++++++++++ test/unittest/core_service_gtest/BUILD.gn | 2 + utils/BUILD.gn | 83 +++++++++++++++++++++++ 4 files changed, 155 insertions(+), 2 deletions(-) create mode 100755 frameworks/js/vcard/BUILD.gn diff --git a/bundle.json b/bundle.json index d1a082f4f..2d016940d 100644 --- a/bundle.json +++ b/bundle.json @@ -70,7 +70,8 @@ "libxml2", "node", "openssl", - "protobuf" + "protobuf", + "glib" ] }, "build": { @@ -80,7 +81,8 @@ "fwk_group": [ "//base/telephony/core_service/interfaces/innerkits:tel_core_service_api", "//base/telephony/core_service/frameworks/js/network_search:radio", - "//base/telephony/core_service/frameworks/js/sim:sim" + "//base/telephony/core_service/frameworks/js/sim:sim", + "//base/telephony/core_service/frameworks/js/vcard:vcard" ], "service_group": [ "//base/telephony/core_service:tel_core_service", @@ -109,6 +111,13 @@ "header_files": [] }, "name":"//base/telephony/core_service/utils:libtel_common" + }, + { + "header": { + "header_base" : "//base/telephony/core_service/utils", + "header_files": [] + }, + "name":"//base/telephony/core_service/utils:libtel_vcard" } ], "test": [ diff --git a/frameworks/js/vcard/BUILD.gn b/frameworks/js/vcard/BUILD.gn new file mode 100755 index 000000000..31f0e6ffe --- /dev/null +++ b/frameworks/js/vcard/BUILD.gn @@ -0,0 +1,59 @@ +# Copyright (C) 2023 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("//build/ohos.gni") +SUBSYSTEM_DIR = "../../../../" +ohos_shared_library("vcard") { + include_dirs = [ + "$SUBSYSTEM_DIR/core_service/frameworks/js/napi", + "include", + "$SUBSYSTEM_DIR/core_service/interfaces/kits/native", + "$SUBSYSTEM_DIR/core_service/interfaces/innerkits/include", + "$SUBSYSTEM_DIR/core_service/utils/vcard/include", + "$SUBSYSTEM_DIR/core_service/utils/vcard/include/contact_data", + ] + + sources = [ + "$SUBSYSTEM_DIR/core_service/frameworks/js/napi/napi_util.cpp", + "src/napi_vcard.cpp", + ] + + configs = [ "$SUBSYSTEM_DIR/core_service/utils:telephony_log_config" ] + + deps = [ + "$SUBSYSTEM_DIR/core_service/interfaces/innerkits:tel_core_service_api", + "$SUBSYSTEM_DIR/core_service/utils:libtel_common", + "$SUBSYSTEM_DIR/core_service/utils:libtel_vcard", + "//third_party/node:node_header", + ] + + external_deps = [ + "ability_base:zuri", + "ability_runtime:abilitykit_native", + "ability_runtime:data_ability_helper", + "ability_runtime:napi_base_context", + "c_utils:utils", + "data_share:datashare_common", + "data_share:datashare_consumer", + "hilog:libhilog", + "init:libbegetutil", + "ipc:ipc_single", + "napi:ace_napi", + ] + defines = [ + "TELEPHONY_LOG_TAG = \"CoreServiceVcardJsApi\"", + "LOG_DOMAIN = 0xD001F04", + ] + subsystem_name = "telephony" + part_name = "core_service" + relative_install_dir = "module/telephony" +} diff --git a/test/unittest/core_service_gtest/BUILD.gn b/test/unittest/core_service_gtest/BUILD.gn index 28c8f8461..4a0e73768 100755 --- a/test/unittest/core_service_gtest/BUILD.gn +++ b/test/unittest/core_service_gtest/BUILD.gn @@ -36,6 +36,7 @@ ohos_unittest("tel_core_service_gtest") { "sim_test.cpp", "sim_test_util.cpp", "sim_type_convert_test.cpp", + "vcard_test.cpp", "zero_branch_test.cpp", "zero_branch_test_core_service.cpp", "zero_branch_test_sim_ril.cpp", @@ -73,6 +74,7 @@ ohos_unittest("tel_core_service_gtest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", + "core_service:libtel_vcard", "data_share:datashare_common", "data_share:datashare_consumer", "drivers_interface_ril:hril_innerkits", diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 9c1b7cedc..2ffaedde6 100755 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -37,6 +37,13 @@ config("tel_utils_config") { ] } +config("tel_contact_config") { + include_dirs = [ + "vcard/include", + "vcard/include/contact_data", + ] +} + ohos_shared_library("libtel_common") { version_script = "libtel_common.versionscript" sources = [ @@ -89,3 +96,79 @@ ohos_shared_library("libtel_common") { part_name = "core_service" subsystem_name = "telephony" } + +ohos_shared_library("libtel_vcard") { + version_script = "libtel_vcard.versionscript" + sources = [ + "vcard/src/contact_data/vcard_anniversary_data.cpp", + "vcard/src/contact_data/vcard_birthday_data.cpp", + "vcard/src/contact_data/vcard_email_data.cpp", + "vcard/src/contact_data/vcard_event_data.cpp", + "vcard/src/contact_data/vcard_im_data.cpp", + "vcard/src/contact_data/vcard_name_data.cpp", + "vcard/src/contact_data/vcard_nickname_data.cpp", + "vcard/src/contact_data/vcard_note_data.cpp", + "vcard/src/contact_data/vcard_organization_data.cpp", + "vcard/src/contact_data/vcard_phone_data.cpp", + "vcard/src/contact_data/vcard_photo_data.cpp", + "vcard/src/contact_data/vcard_postal_data.cpp", + "vcard/src/contact_data/vcard_relation_data.cpp", + "vcard/src/contact_data/vcard_sip_data.cpp", + "vcard/src/contact_data/vcard_website_data.cpp", + "vcard/src/vcard_configuration.cpp", + "vcard/src/vcard_constructor.cpp", + "vcard/src/vcard_contact.cpp", + "vcard/src/vcard_decoder.cpp", + "vcard/src/vcard_decoder_v21.cpp", + "vcard/src/vcard_decoder_v30.cpp", + "vcard/src/vcard_decoder_v40.cpp", + "vcard/src/vcard_encoder.cpp", + "vcard/src/vcard_file_utils.cpp", + "vcard/src/vcard_manager.cpp", + "vcard/src/vcard_raw_data.cpp", + "vcard/src/vcard_rdb_helper.cpp", + "vcard/src/vcard_utils.cpp", + ] + + defines = [ + "TELEPHONY_LOG_TAG = \"TelephonyVCard\"", + "LOG_DOMAIN = 0xD001F04", + ] + + if (is_standard_system) { + defines += [ "STANDARD_SYSTEM_ENABLE" ] + } + + configs = [ "../utils:telephony_log_config" ] + + public_configs = [ ":tel_contact_config" ] + + if (is_double_framework) { + cflags_cc = [ "-DCONFIG_DUAL_FRAMEWORK" ] + } + + include_dirs = [ + ":tel_contact_config", + "../interfaces/innerkits/include/", + "//third_party/glib/glib", + "//third_party/glib", + ] + + deps = [ "//third_party/glib:glib_packages" ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "ability_runtime:ability_manager", + "ability_runtime:data_ability_helper", + "c_utils:utils", + "data_share:datashare_common", + "data_share:datashare_consumer", + "hilog:libhilog", + "init:libbegetutil", + ] + + innerapi_tags = [ "platformsdk" ] + part_name = "core_service" + subsystem_name = "telephony" +}