1# Copyright (c) 2022-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/idl_tool/idl.gni") 15import("//build/ohos.gni") 16import("//foundation/filemanagement/user_file_service/filemanagement_aafwk.gni") 17 18idl_gen_interface("IFile_Access_Ext_Base") { 19 src_idl = rebase_path("IFileAccessExtBase.idl") 20 hitrace = "HITRACE_TAG_FILEMANAGEMENT" 21 log_domainid = "0xD00430A" 22 log_tag = "filemanagement" 23} 24 25config("IFile_Access_Ext_Base_config") { 26 visibility = [ ":*" ] 27 include_dirs = [ 28 "include", 29 "${user_file_service_path}/utils", 30 "${user_file_service_path}/services/native/file_access_service/include", 31 "${user_file_service_path}/interfaces/kits/js/src/common", 32 "${target_gen_dir}", 33 ] 34} 35 36ohos_source_set("file_access_ext_base_source") { 37 sanitize = { 38 cfi = true 39 cfi_cross_dso = true 40 debug = false 41 } 42 public_configs = [ ":IFile_Access_Ext_Base_config" ] 43 output_values = get_target_outputs(":IFile_Access_Ext_Base") 44 sources = filter_include(output_values, [ "*.cpp" ]) 45 deps = [ ":IFile_Access_Ext_Base" ] 46 47 external_deps = [ 48 "ability_base:want", 49 "ability_base:zuri", 50 "ability_runtime:ability_connect_callback_stub", 51 "c_utils:utils", 52 "hilog:libhilog", 53 "hitrace:hitrace_meter", 54 "ipc:ipc_core", 55 "ipc:ipc_single", 56 ] 57 58 subsystem_name = "filemanagement" 59 part_name = "user_file_service" 60} 61 62ohos_source_set("file_access_ext_base_include") { 63 sanitize = { 64 cfi = true 65 cfi_cross_dso = true 66 debug = false 67 } 68 public_configs = [ ":IFile_Access_Ext_Base_config" ] 69 deps = [ ":IFile_Access_Ext_Base" ] 70 71 external_deps = [ 72 "ability_base:want", 73 "ability_base:zuri", 74 "ability_runtime:ability_connect_callback_stub", 75 "c_utils:utils", 76 "hilog:libhilog", 77 "hitrace:hitrace_meter", 78 "ipc:ipc_core", 79 "ipc:ipc_single", 80 ] 81 82 subsystem_name = "filemanagement" 83 part_name = "user_file_service" 84} 85 86config("ability_config") { 87 visibility = [ ":*" ] 88 include_dirs = [ 89 "include", 90 "${user_file_service_path}/utils", 91 "${user_file_service_path}/interfaces/kits/js/src/common", 92 ] 93 94 cflags = [] 95 if (target_cpu == "arm") { 96 cflags += [ "-DBINDER_IPC_32BIT" ] 97 } 98} 99 100config("ability_public_config") { 101 visibility = [ ":*" ] 102 include_dirs = [ 103 "include", 104 "${user_file_service_path}/utils", 105 "${user_file_service_path}/services/native/file_access_service/include", 106 "${user_file_service_path}/interfaces/kits/js/src/common", 107 ] 108} 109 110ohos_shared_library("file_access_extension_ability_kit") { 111 branch_protector_ret = "pac_ret" 112 sanitize = { 113 integer_overflow = true 114 ubsan = true 115 boundary_sanitize = true 116 cfi = true 117 cfi_cross_dso = true 118 debug = false 119 } 120 121 include_dirs = [ 122 "${commonlibrary_path}/c_utils/base/include", 123 "${user_file_service_path}/services/native/file_access_service/include", 124 ] 125 126 deps = [ 127 ":file_access_ext_base_source", 128 "${user_file_service_path}/services:file_access_service_base_source", 129 ] 130 131 sources = [ 132 "${user_file_service_path}/services/native/file_access_service/src/file_access_service_client.cpp", 133 "src/app_file_access_ext_connection.cpp", 134 "src/file_access_ext_ability.cpp", 135 "src/file_access_ext_stub_impl.cpp", 136 "src/file_access_helper.cpp", 137 "src/js_file_access_ext_ability.cpp", 138 "src/napi_common_fileaccess.cpp", 139 "src/uri_ext.cpp", 140 ] 141 configs = [ ":ability_config" ] 142 143 version_script = "libfile_access_extension_ability_kit.map" 144 public_configs = [ 145 ":ability_public_config", 146 "${ability_runtime_path}/frameworks/native/ability:ability_context_public_config", 147 ] 148 149 external_deps = [ 150 "ability_base:want", 151 "ability_base:zuri", 152 "ability_runtime:ability_connect_callback_stub", 153 "ability_runtime:ability_manager", 154 "ability_runtime:app_context", 155 "ability_runtime:extensionkit_native", 156 "ability_runtime:napi_common", 157 "ability_runtime:runtime", 158 "access_token:libaccesstoken_sdk", 159 "access_token:libtokenid_sdk", 160 "bundle_framework:appexecfwk_base", 161 "bundle_framework:appexecfwk_core", 162 "c_utils:utils", 163 "file_api:filemgmt_libn", 164 "hilog:libhilog", 165 "hitrace:hitrace_meter", 166 "init:libbegetutil", 167 "ipc:ipc_core", 168 "ipc:ipc_napi", 169 "napi:ace_napi", 170 "os_account:os_account_innerkits", 171 "samgr:samgr_proxy", 172 ] 173 174 subsystem_name = "filemanagement" 175 part_name = "user_file_service" 176 innerapi_tags = [ "platformsdk" ] 177} 178 179ohos_shared_library("file_access_extension_ability_module") { 180 branch_protector_ret = "pac_ret" 181 sanitize = { 182 integer_overflow = true 183 ubsan = true 184 boundary_sanitize = true 185 cfi = true 186 cfi_cross_dso = true 187 debug = false 188 } 189 190 sources = [ "src/file_access_ext_ability_module_loader.cpp" ] 191 192 configs = [ ":ability_config" ] 193 public_configs = [ ":ability_public_config" ] 194 195 deps = [ ":file_access_extension_ability_kit" ] 196 197 external_deps = [ 198 "ability_runtime:abilitykit_native", 199 "ability_runtime:runtime", 200 "bundle_framework:appexecfwk_base", 201 "c_utils:utils", 202 "common_event_service:cesfwk_innerkits", 203 "hilog:libhilog", 204 "ipc:ipc_napi", 205 "ipc:ipc_single", 206 "napi:ace_napi", 207 ] 208 209 relative_install_dir = "extensionability/" 210 subsystem_name = "filemanagement" 211 part_name = "user_file_service" 212} 213