diff --git a/app_file_service.gni b/app_file_service.gni new file mode 100644 index 0000000000000000000000000000000000000000..1cef84c1adf4d0aa792a359f321026a16519c332 --- /dev/null +++ b/app_file_service.gni @@ -0,0 +1,14 @@ +# 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. + +third_party_path = "//third_party" diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 6e4a29c48c76bbce4aeef73cc91fe74c2bedd4fd..2fba1d617fab8f405682d5d76eecd1b1738524f1 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -12,12 +12,12 @@ # limitations under the License. import("//build/ohos.gni") +import("//foundation/filemanagement/app_file_service/app_file_service.gni") ohos_shared_library("remotefileshare") { include_dirs = [ "//foundation/arkui/napi/interfaces/kits", "//third_party/bounds_checking_function/include", - "//foundation/filemanagement/file_api/utils/filemgmt_libn/include", ] sources = [ @@ -25,10 +25,9 @@ ohos_shared_library("remotefileshare") { "remote_file_share/remotefileshare_napi.cpp", ] - deps = [ - "//foundation/filemanagement/file_api/utils/filemgmt_libn:filemgmt_libn", - "//third_party/bounds_checking_function:libsec_shared", - ] + deps = [ "${third_party_path}/bounds_checking_function:libsec_shared" ] + + external_deps = [ "file_api:filemgmt_libn" ] relative_install_dir = "module" @@ -39,7 +38,6 @@ ohos_shared_library("remotefileshare") { ohos_shared_library("fileshare") { include_dirs = [ "//foundation/filemanagement/app_file_service/interfaces/kits/js", - "//foundation/filemanagement/file_api/utils/filemgmt_libn/include", "//foundation/filemanagement/app_file_service/interfaces/kits/js/common", ] @@ -48,10 +46,6 @@ ohos_shared_library("fileshare") { "//foundation/filemanagement/app_file_service/interfaces/kits/js/file_share/grant_uri_permission.cpp", ] - deps = [ - "//foundation/filemanagement/file_api/utils/filemgmt_libn:filemgmt_libn", - ] - external_deps = [ "ability_base:want", "ability_base:zuri", @@ -60,6 +54,7 @@ ohos_shared_library("fileshare") { "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", + "file_api:filemgmt_libn", "file_api:remote_uri_native", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", @@ -74,7 +69,6 @@ ohos_shared_library("fileshare") { ohos_shared_library("fileuri") { include_dirs = [ "//foundation/filemanagement/app_file_service/interfaces/kits/js", - "//foundation/filemanagement/file_api/utils/filemgmt_libn/include", "//foundation/filemanagement/app_file_service/interfaces/kits/js/common", ] @@ -83,14 +77,11 @@ ohos_shared_library("fileuri") { "//foundation/filemanagement/app_file_service/interfaces/kits/js/file_uri/get_uri_from_path.cpp", ] - deps = [ - "//foundation/filemanagement/file_api/utils/filemgmt_libn:filemgmt_libn", - ] - external_deps = [ "ability_runtime:abilitykit_native", "bundle_framework:appexecfwk_core", "c_utils:utils", + "file_api:filemgmt_libn", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/test/fuzztest/remotefileshare_fuzzer/BUILD.gn b/test/fuzztest/remotefileshare_fuzzer/BUILD.gn index e787b85ef2706c0a14c03b5eb3666dc943f456e6..8322f005d75b5113ad748616d62c3d383b769d65 100644 --- a/test/fuzztest/remotefileshare_fuzzer/BUILD.gn +++ b/test/fuzztest/remotefileshare_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -14,6 +14,7 @@ #####################hydra-fuzz################### import("//build/config/features.gni") import("//build/test.gni") +import("//foundation/filemanagement/app_file_service/app_file_service.gni") ##############################fuzztest########################################## ohos_fuzztest("RemoteFileShareFuzzTest") { @@ -27,11 +28,14 @@ ohos_fuzztest("RemoteFileShareFuzzTest") { "-fno-omit-frame-pointer", ] sources = [ "remotefileshare_fuzzer.cpp" ] - deps = [ - "//foundation/distributeddatamgr/distributedfile/utils/filemgmt_libn", - "//third_party/bounds_checking_function:libsec_shared", + + deps = [ "${third_party_path}/bounds_checking_function:libsec_shared" ] + + external_deps = [ + "file_api:filemgmt_libn", + "hiviewdfx_hilog_native:libhilog", ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + defines = [ "LOG_TAG=\"app_file_service\"", "LOG_DOMAIN=0xD200000",