1# Copyright (c) 2022-2023 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/ohos.gni") 15import("//foundation/filemanagement/user_file_service/filemanagement_aafwk.gni") 16 17config("ability_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "include", 21 "${user_file_service_path}/utils", 22 "${ability_runtime_services_path}/common/include", 23 "${ability_runtime_kits_path}/ability/native/include/continuation/distributed", 24 "${ability_runtime_kits_path}/ability/native/include/continuation/kits", 25 "${ability_runtime_kits_path}/appkit/native/app/include", 26 "${ability_runtime_napi_path}/inner/napi_common", 27 "${access_token_path}/interfaces/innerkits/accesstoken/include", 28 "${user_file_service_path}/interfaces/kits/js/src/common", 29 ] 30 31 cflags = [] 32 if (target_cpu == "arm") { 33 cflags += [ "-DBINDER_IPC_32BIT" ] 34 } 35} 36 37config("ability_public_config") { 38 visibility = [ ":*" ] 39 include_dirs = [ 40 "include", 41 "${user_file_service_path}/utils", 42 "${ability_runtime_kits_path}/appkit/native/ability_runtime/app", 43 "${ability_runtime_kits_path}/appkit/native/app/include", 44 "${ability_runtime_kits_path}/appkit/native/ability_runtime/context", 45 "${user_file_service_path}/services/native/file_access_service/include", 46 "${user_file_service_path}/interfaces/kits/js/src/common", 47 ] 48} 49 50ohos_shared_library("file_access_extension_ability_kit") { 51 branch_protector_ret = "pac_ret" 52 sanitize = { 53 integer_overflow = true 54 ubsan = true 55 boundary_sanitize = true 56 cfi = true 57 cfi_cross_dso = true 58 debug = false 59 } 60 61 include_dirs = [ 62 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", 63 "${commonlibrary_path}/c_utils/base/include", 64 "${file_api_path}/utils/filemgmt_libn/include", 65 "${user_file_service_path}/services/native/file_access_service/include", 66 ] 67 68 sources = [ 69 "${user_file_service_path}/services/native/file_access_service/src/file_access_service_proxy.cpp", 70 "src/file_access_ext_ability.cpp", 71 "src/file_access_ext_connection.cpp", 72 "src/file_access_ext_proxy.cpp", 73 "src/file_access_ext_stub.cpp", 74 "src/file_access_ext_stub_impl.cpp", 75 "src/file_access_helper.cpp", 76 "src/js_file_access_ext_ability.cpp", 77 "src/napi_common_fileaccess.cpp", 78 ] 79 configs = [ ":ability_config" ] 80 81 version_script = "libfile_access_extension_ability_kit.map" 82 public_configs = [ 83 ":ability_public_config", 84 "${ability_runtime_path}/frameworks/native/ability:ability_context_public_config", 85 ] 86 87 external_deps = [ 88 "ability_base:want", 89 "ability_base:zuri", 90 "ability_runtime:ability_manager", 91 "ability_runtime:app_context", 92 "ability_runtime:extensionkit_native", 93 "ability_runtime:napi_common", 94 "ability_runtime:runtime", 95 "access_token:libaccesstoken_sdk", 96 "access_token:libtokenid_sdk", 97 "bundle_framework:appexecfwk_base", 98 "bundle_framework:appexecfwk_core", 99 "c_utils:utils", 100 "hilog:libhilog", 101 "hitrace:hitrace_meter", 102 "init:libbegetutil", 103 "ipc:ipc_core", 104 "napi:ace_napi", 105 "os_account:os_account_innerkits", 106 "samgr:samgr_proxy", 107 ] 108 109 subsystem_name = "filemanagement" 110 part_name = "user_file_service" 111 innerapi_tags = [ "platformsdk" ] 112} 113 114ohos_shared_library("file_access_extension_ability_module") { 115 branch_protector_ret = "pac_ret" 116 sanitize = { 117 integer_overflow = true 118 ubsan = true 119 boundary_sanitize = true 120 cfi = true 121 cfi_cross_dso = true 122 debug = false 123 } 124 125 sources = [ "src/file_access_ext_ability_module_loader.cpp" ] 126 127 configs = [ ":ability_config" ] 128 public_configs = [ ":ability_public_config" ] 129 130 deps = [ ":file_access_extension_ability_kit" ] 131 132 external_deps = [ 133 "ability_runtime:abilitykit_native", 134 "ability_runtime:runtime", 135 "bundle_framework:appexecfwk_base", 136 "c_utils:utils", 137 "common_event_service:cesfwk_innerkits", 138 "hilog:libhilog", 139 "napi:ace_napi", 140 ] 141 142 relative_install_dir = "extensionability/" 143 subsystem_name = "filemanagement" 144 part_name = "user_file_service" 145} 146