# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/filemanagement/app_file_service/app_file_service.gni") config("file_share_config") { visibility = [ ":*" ] include_dirs = [ "file_share/include", "//third_party/json/include", "../../common/include", ] } config("file_uri_config") { visibility = [ ":*" ] include_dirs = [ "file_uri/include", "//third_party/json/include", "../../common/include", ] } ohos_shared_library("fileshare_native") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false } sources = [ "../../common/src/json_utils.cpp", "../../common/src/sandbox_helper.cpp", "file_share/src/file_permission.cpp", "file_share/src/file_share.cpp", ] public_configs = [ ":file_share_config" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "c_utils:utils", "file_api:filemgmt_libn", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", ] defines = [] if (sandbox_manarer) { external_deps += [ "ability_runtime:uri_permission_mgr", "sandbox_manager:libsandbox_manager_sdk", ] defines += [ "SANDBOX_MANAGER", "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER", ] } part_name = "app_file_service" subsystem_name = "filemanagement" } ohos_shared_library("fileuri_native") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true cfi = true cfi_cross_dso = true debug = false } sources = [ "../../common/src/common_func.cpp", "../../common/src/json_utils.cpp", "../../common/src/sandbox_helper.cpp", "file_uri/src/file_uri.cpp", ] public_configs = [ ":file_uri_config" ] external_deps = [ "ability_base:zuri", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "samgr:samgr_proxy", ] part_name = "app_file_service" subsystem_name = "filemanagement" } ohos_prebuilt_etc("file_share_sandbox.json") { source = "../../common/file_share_sandbox.json" part_name = "app_file_service" subsystem_name = "filemanagement" module_install_dir = "etc/app_file_service" } ohos_prebuilt_etc("backup_sandbox.json") { source = "../../common/backup_sandbox.json" part_name = "app_file_service" subsystem_name = "filemanagement" module_install_dir = "etc/app_file_service" } config("remote_file_share_config") { visibility = [ ":*" ] include_dirs = [ "include", "${utils_system_safwk_path}/native/include", "remote_file_share/include", "//third_party/json/include", "${path_base}/include", "../../common/include", ".", ] } ohos_shared_library("remote_file_share_native") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true cfi = true cfi_cross_dso = true debug = false } sources = [ "../../common/src/json_utils.cpp", "../../common/src/sandbox_helper.cpp", "remote_file_share/src/remote_file_share.cpp", ] public_configs = [ ":remote_file_share_config" ] external_deps = [ "ability_base:zuri", "c_utils:utils", "hilog:libhilog", ] if (defined(global_parts_info) && defined(global_parts_info.distributedhardware_device_manager)) { external_deps += [ "device_manager:devicemanagersdk" ] defines = [ "ENABLE_DEVICE_MANAGER" ] } innerapi_tags = [ "platformsdk_indirect" ] part_name = "app_file_service" subsystem_name = "filemanagement" } config("sandbox_helper_config") { visibility = [ ":*" ] include_dirs = [ "include", "${utils_system_safwk_path}/native/include", "//third_party/json/include", "${path_base}/include", "../../common/include", ".", ] } ohos_shared_library("sandbox_helper_native") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true cfi = true cfi_cross_dso = true debug = false } sources = [ "../../common/src/json_utils.cpp", "../../common/src/sandbox_helper.cpp", ] public_configs = [ ":sandbox_helper_config" ] external_deps = [ "ability_base:zuri", "c_utils:utils", "hilog:libhilog", ] innerapi_tags = [ "platformsdk_indirect" ] part_name = "app_file_service" subsystem_name = "filemanagement" } group("app_file_service_native") { deps = [ ":fileshare_native", ":fileuri_native", ":remote_file_share_native", ":sandbox_helper_native", ] } group("etc_files") { deps = [ ":backup_sandbox.json", ":file_share_sandbox.json", ] }