1# Copyright (c) 2021-2024 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 17group("user_file_managers") { 18 deps = [ 19 ":external_file_manager_hap", 20 ":file_access_service", 21 ":file_access_service.cfg", 22 ":file_access_service_profile", 23 ] 24} 25 26ohos_hap("external_file_manager_hap") { 27 hap_profile = "file_extension_hap/entry/src/main/module.json" 28 deps = [ 29 ":external_file_manager_js_assets", 30 ":external_file_manager_resources", 31 ] 32 certificate_profile = "signature/fileextension.p7b" 33 hap_name = "external_file_manager" 34 subsystem_name = "filemanagement" 35 part_name = "user_file_service" 36 module_install_dir = "app/com.ohos.UserFile.ExternalFileManager" 37} 38 39ohos_js_assets("external_file_manager_js_assets") { 40 hap_profile = "file_extension_hap/entry/src/main/module.json" 41 ets2abc = true 42 source_dir = "file_extension_hap/entry/src/main/ets" 43} 44 45ohos_app_scope("external_file_manager_app_profile") { 46 app_profile = "file_extension_hap/AppScope/app.json" 47 sources = [ "file_extension_hap/AppScope/resources" ] 48} 49 50ohos_sa_profile("file_access_service_profile") { 51 sources = [ "5010.json" ] 52 part_name = "user_file_service" 53} 54 55ohos_prebuilt_etc("file_access_service.cfg") { 56 source = "file_access_service.cfg" 57 relative_install_dir = "init" 58 subsystem_name = "filemanagement" 59 part_name = "user_file_service" 60} 61 62config("ability_config") { 63 visibility = [ ":*" ] 64 include_dirs = [ 65 "native/file_access_service/include", 66 "${user_file_service_path}/utils", 67 "${user_file_service_path}/interfaces/inner_api/file_access/include", 68 "${user_file_service_path}/frameworks/js/napi/file_access_module", 69 "${ability_runtime_services_path}/common/include", 70 "${ability_runtime_kits_path}/ability/native/include/continuation/distributed", 71 "${ability_runtime_kits_path}/ability/native/include/continuation/kits", 72 "${ability_runtime_kits_path}/appkit/native/app/include", 73 "${ability_runtime_napi_path}/inner/napi_common", 74 "${access_token_path}/interfaces/innerkits/accesstoken/include", 75 ] 76} 77 78config("ability_public_config") { 79 visibility = [ ":*" ] 80 include_dirs = [ 81 "native/file_access_service/include", 82 "${user_file_service_path}/utils", 83 "${ability_runtime_kits_path}/appkit/native/ability_runtime/app", 84 "${ability_runtime_kits_path}/appkit/native/app/include", 85 "${ability_runtime_kits_path}/appkit/native/ability_runtime/context", 86 "${user_file_service_path}/interfaces/kits/js/src/common", 87 ] 88} 89 90ohos_resources("external_file_manager_resources") { 91 sources = [ "file_extension_hap/entry/src/main/resources" ] 92 deps = [ ":external_file_manager_app_profile" ] 93 hap_profile = "file_extension_hap/entry/src/main/module.json" 94} 95 96ohos_shared_library("file_access_service") { 97 branch_protector_ret = "pac_ret" 98 sanitize = { 99 integer_overflow = true 100 ubsan = true 101 boundary_sanitize = true 102 cfi = true 103 cfi_cross_dso = true 104 debug = false 105 } 106 107 include_dirs = [ 108 "${user_file_service_path}/services/native/file_access_service/include", 109 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", 110 ] 111 shlib_type = "sa" 112 sources = [ 113 "native/file_access_service/src/file_access_service.cpp", 114 "native/file_access_service/src/file_access_service_proxy.cpp", 115 "native/file_access_service/src/file_access_service_stub.cpp", 116 "native/file_access_service/src/observer_callback_proxy.cpp", 117 "native/file_access_service/src/observer_callback_stub.cpp", 118 ] 119 configs = [ ":ability_config" ] 120 version_script = "libfile_access_service.map" 121 public_configs = [ ":ability_public_config" ] 122 123 deps = [ "${user_file_service_path}/interfaces/inner_api/file_access:file_access_extension_ability_kit" ] 124 125 external_deps = [ 126 "ability_base:want", 127 "ability_base:zuri", 128 "ability_runtime:ability_manager", 129 "access_token:libaccesstoken_sdk", 130 "access_token:libtokenid_sdk", 131 "bundle_framework:appexecfwk_core", 132 "c_utils:utils", 133 "hilog:libhilog", 134 "hitrace:hitrace_meter", 135 "ipc:ipc_core", 136 "safwk:system_ability_fwk", 137 "samgr:samgr_proxy", 138 ] 139 140 subsystem_name = "filemanagement" 141 part_name = "user_file_service" 142} 143