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 "${user_file_service_path}/services/native/file_access_service/include", 123 ] 124 125 deps = [ 126 ":file_access_ext_base_source", 127 "${user_file_service_path}/services:file_access_service_base_source", 128 ] 129 130 sources = [ 131 "${user_file_service_path}/services/native/file_access_service/src/file_access_service_client.cpp", 132 "src/app_file_access_ext_connection.cpp", 133 "src/file_access_ext_ability.cpp", 134 "src/file_access_ext_stub_impl.cpp", 135 "src/file_access_helper.cpp", 136 "src/js_file_access_ext_ability.cpp", 137 "src/napi_common_fileaccess.cpp", 138 "src/uri_ext.cpp", 139 ] 140 configs = [ ":ability_config" ] 141 142 version_script = "libfile_access_extension_ability_kit.map" 143 public_configs = [ ":ability_public_config" ] 144 145 external_deps = [ 146 "ability_base:want", 147 "ability_base:zuri", 148 "ability_runtime:ability_connect_callback_stub", 149 "ability_runtime:ability_manager", 150 "ability_runtime:app_context", 151 "ability_runtime:extensionkit_native", 152 "ability_runtime:napi_common", 153 "ability_runtime:runtime", 154 "access_token:libaccesstoken_sdk", 155 "access_token:libtokenid_sdk", 156 "bundle_framework:appexecfwk_base", 157 "bundle_framework:appexecfwk_core", 158 "c_utils:utils", 159 "file_api:filemgmt_libn", 160 "hilog:libhilog", 161 "hitrace:hitrace_meter", 162 "init:libbegetutil", 163 "ipc:ipc_core", 164 "ipc:ipc_napi", 165 "napi:ace_napi", 166 "os_account:os_account_innerkits", 167 "samgr:samgr_proxy", 168 ] 169 170 subsystem_name = "filemanagement" 171 part_name = "user_file_service" 172 innerapi_tags = [ "platformsdk" ] 173} 174 175ohos_shared_library("file_access_extension_ability_module") { 176 branch_protector_ret = "pac_ret" 177 sanitize = { 178 integer_overflow = true 179 ubsan = true 180 boundary_sanitize = true 181 cfi = true 182 cfi_cross_dso = true 183 debug = false 184 } 185 186 sources = [ "src/file_access_ext_ability_module_loader.cpp" ] 187 188 configs = [ ":ability_config" ] 189 public_configs = [ ":ability_public_config" ] 190 191 deps = [ ":file_access_extension_ability_kit" ] 192 193 external_deps = [ 194 "ability_runtime:abilitykit_native", 195 "ability_runtime:runtime", 196 "bundle_framework:appexecfwk_base", 197 "c_utils:utils", 198 "common_event_service:cesfwk_innerkits", 199 "hilog:libhilog", 200 "ipc:ipc_napi", 201 "ipc:ipc_single", 202 "napi:ace_napi", 203 ] 204 205 relative_install_dir = "extensionability/" 206 subsystem_name = "filemanagement" 207 part_name = "user_file_service" 208} 209