1# Copyright (c) 2025 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("//build/config/components/ets_frontend/ets2abc_config.gni") 15import("//build/ohos.gni") 16import("//foundation/distributeddatamgr/data_share/datashare.gni") 17 18ohos_shared_library("datashare_ani") { 19 branch_protector_ret = "pac_ret" 20 sanitize = { 21 integer_overflow = true 22 ubsan = true 23 boundary_sanitize = true 24 cfi = true 25 cfi_cross_dso = true 26 debug = false 27 } 28 29 sources = [ 30 "src/ani_datashare_helper.cpp", 31 "src/ani_datashare_inner_observer.cpp", 32 "src/ani_datashare_observer.cpp", 33 "${datashare_ani_path}/common/src/ani_utils.cpp", 34 ] 35 36 include_dirs = [ 37 "include/", 38 "${datashare_base_path}/interfaces/inner_api/common/include", 39 "${datashare_ani_path}/common/include", 40 ] 41 42 deps = [ 43 "${datashare_innerapi_path}:datashare_consumer", 44 "${datashare_innerapi_path}/common:datashare_common", 45 ] 46 47 external_deps = [ 48 "ability_runtime:ani_base_context", 49 "ability_runtime:ani_common", 50 "ability_runtime:app_context", 51 "access_token:libtokenid_sdk", 52 "c_utils:utils", 53 "hilog:libhilog", 54 "hitrace:hitrace_meter", 55 "hitrace:libhitracechain", 56 "ipc:ipc_single", 57 "runtime_core:ani", 58 ] 59 60 subsystem_name = "distributeddatamgr" 61 part_name = "data_share" 62 output_extension = "so" 63} 64 65generate_static_abc("datashare_abc") { 66 base_url = "ets" 67 files = [ "ets/@ohos.data.dataShare.ets" ] 68 dst_file = "$target_out_dir/datashare.abc" 69 out_puts = [ "$target_out_dir/datashare.abc" ] 70 is_boot_abc = "True" 71 device_dst_file = "/system/framework/datashare.abc" 72} 73 74ohos_prebuilt_etc("datashare_abc_etc") { 75 source = "$target_out_dir/datashare.abc" 76 module_install_dir = "framework" 77 subsystem_name = "distributeddatamgr" 78 part_name = "data_share" 79 deps = [ ":datashare_abc" ] 80} 81 82group("data_share") { 83 deps = [ 84 ":datashare_ani", 85 ":datashare_abc_etc", 86 ] 87} 88 89ohos_shared_library("datasharepredicates_ani") { 90 sanitize = { 91 ubsan = true 92 boundary_sanitize = true 93 cfi = true 94 cfi_cross_dso = true 95 debug = false 96 } 97 98 sources = [ 99 "src/data_share_predicates.cpp", 100 "${datashare_ani_path}/common/src/ani_utils.cpp", 101 ] 102 103 include_dirs = [ 104 "include", 105 "${datashare_common_native_path}/include", 106 "${datashare_ani_path}/common/include", 107 ] 108 109 deps = [ "${datashare_innerapi_path}/common:datashare_common" ] 110 111 external_deps = [ 112 "c_utils:utils", 113 "hilog:libhilog", 114 "ipc:ipc_core", 115 "runtime_core:ani", 116 ] 117 118 subsystem_name = "distributeddatamgr" 119 part_name = "data_share" 120 output_extension = "so" 121} 122 123generate_static_abc("data_share_predicates_abc") { 124 base_url = "ets" 125 files = [ "ets/@ohos.data.dataSharePredicates.ets" ] 126 dst_file = "$target_out_dir/data_share_predicates.abc" 127 out_puts = [ "$target_out_dir/data_share_predicates.abc" ] 128 is_boot_abc = "True" 129 device_dst_file = "/system/framework/data_share_predicates.abc" 130} 131 132ohos_prebuilt_etc("data_share_predicates_abc_etc") { 133 source = "$target_out_dir/data_share_predicates.abc" 134 module_install_dir = "framework" 135 subsystem_name = "distributeddatamgr" 136 part_name = "data_share" 137 deps = [ ":data_share_predicates_abc" ] 138} 139 140group("data_share_predicates") { 141 deps = [ 142 ":data_share_predicates_abc_etc", 143 ":datasharepredicates_ani", 144 ] 145} 146