From 58457b9d67b0f7afdb3d5620929620c51ee2ceb1 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Thu, 27 Apr 2023 12:25:06 +0000 Subject: [PATCH 1/2] =?UTF-8?q?app=5Ffile=5Fservice:=E9=83=A8=E4=BB=B6?= =?UTF-8?q?=E5=8C=96=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: I68d33c8a36964cf34c336c4d0c17076dc0740332 --- BUILD.gn | 4 ++-- backup.gni | 1 + bundle.json | 4 ++-- .../remote_file_share/native/BUILD.gn | 11 ++++++----- interfaces/kits/js/BUILD.gn | 18 +++++++++--------- test/fuzztest/BUILD.gn | 2 +- test/fuzztest/remotefileshare_fuzzer/BUILD.gn | 1 - test/unittest/remote_file_share/BUILD.gn | 5 +++-- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index c51710244..c70a22860 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -16,8 +16,8 @@ import("//build/ohos.gni") group("libremotefileshare") { deps = [ "interfaces/innerkits/native/file_share:fileshare_native", - "//foundation/filemanagement/app_file_service/interfaces/innerkits/remote_file_share/native:remote_file_share_native", - "//foundation/filemanagement/app_file_service/interfaces/kits/js:remotefileshare", + "interfaces/innerkits/remote_file_share/native:remote_file_share_native", + "interfaces/kits/js:remotefileshare", ] } diff --git a/backup.gni b/backup.gni index 767cb94c6..2c7e0acbf 100644 --- a/backup.gni +++ b/backup.gni @@ -30,6 +30,7 @@ path_samgr = "//foundation/systemabilitymgr/samgr" path_init = "//base/startup/init" path_filemgmt_libn = "//foundation/filemanagement/file_api/utils/filemgmt_libn" path_backup_mock = "//foundation/filemanagement/app_file_service/tests/mock" +path_utils_system_safwk = "//utils/system/safwk" backup_mock_parcel_include_dirs = [ "$path_backup_mock/parcel/include" ] backup_mock_parcel_src = [ "$path_backup_mock/parcel/src/parcel.cpp" ] diff --git a/bundle.json b/bundle.json index 4f1a1d4c8..c74353ee9 100644 --- a/bundle.json +++ b/bundle.json @@ -20,8 +20,8 @@ "adapted_system_type": [ "standard" ], - "rom": "", - "ram": "", + "rom": "1024KB", + "ram": "1024KB", "build": { "group_type": { "base_group": [], diff --git a/interfaces/innerkits/remote_file_share/native/BUILD.gn b/interfaces/innerkits/remote_file_share/native/BUILD.gn index 6c93c13a2..7e5acbe58 100644 --- a/interfaces/innerkits/remote_file_share/native/BUILD.gn +++ b/interfaces/innerkits/remote_file_share/native/BUILD.gn @@ -12,19 +12,20 @@ # limitations under the License. import("//build/ohos.gni") - +import("//foundation/filemanagement/app_file_service/backup.gni") config("remote_file_share_config") { visibility = [ ":*" ] include_dirs = [ "include", - "//utils/system/safwk/native/include", - "//commonlibrary/c_utils/base/include", - "//foundation/filemanagement/app_file_service/interfaces/innerkits/remote_file_share/native", + "${path_utils_system_safwk}/native/include", + "${path_base}/include", + ".", ] } ohos_shared_library("remote_file_share_native") { - sources = [ "//foundation/filemanagement/app_file_service/services/remote_file_share/src/remote_file_share.cpp" ] + sources = + [ "${path_backup}/services/remote_file_share/src/remote_file_share.cpp" ] public_configs = [ ":remote_file_share_config" ] diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index b64a78556..2c2cdb565 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -17,7 +17,7 @@ import("//foundation/filemanagement/app_file_service/backup.gni") ohos_shared_library("remotefileshare") { include_dirs = [ - "//foundation/arkui/napi/interfaces/kits", + "${path_napi}/interfaces/kits", "//third_party/bounds_checking_function/include", ] @@ -38,13 +38,13 @@ ohos_shared_library("remotefileshare") { ohos_shared_library("fileshare") { include_dirs = [ - "//foundation/filemanagement/app_file_service/interfaces/kits/js", - "//foundation/filemanagement/app_file_service/interfaces/kits/js/common", + ".", + "common", ] sources = [ - "//foundation/filemanagement/app_file_service/interfaces/kits/js/file_share/fileshare_n_exporter.cpp", - "//foundation/filemanagement/app_file_service/interfaces/kits/js/file_share/grant_uri_permission.cpp", + "file_share/fileshare_n_exporter.cpp", + "file_share/grant_uri_permission.cpp", ] external_deps = [ @@ -70,13 +70,13 @@ ohos_shared_library("fileshare") { ohos_shared_library("fileuri") { include_dirs = [ - "//foundation/filemanagement/app_file_service/interfaces/kits/js", - "//foundation/filemanagement/app_file_service/interfaces/kits/js/common", + ".", + "common", ] sources = [ - "//foundation/filemanagement/app_file_service/interfaces/kits/js/file_uri/file_uri_n_exporter.cpp", - "//foundation/filemanagement/app_file_service/interfaces/kits/js/file_uri/get_uri_from_path.cpp", + "file_uri/file_uri_n_exporter.cpp", + "file_uri/get_uri_from_path.cpp", ] external_deps = [ diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index dd4bc44e6..cb07dfdcf 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -17,6 +17,6 @@ group("fuzztest") { deps += [ # deps file - "//foundation/filemanagement/app_file_service/test/fuzztest/remotefileshare_fuzzer:RemoteFileShareFuzzTest", + "remotefileshare_fuzzer:RemoteFileShareFuzzTest", ] } diff --git a/test/fuzztest/remotefileshare_fuzzer/BUILD.gn b/test/fuzztest/remotefileshare_fuzzer/BUILD.gn index 8322f005d..862109d05 100644 --- a/test/fuzztest/remotefileshare_fuzzer/BUILD.gn +++ b/test/fuzztest/remotefileshare_fuzzer/BUILD.gn @@ -19,7 +19,6 @@ import("//foundation/filemanagement/app_file_service/app_file_service.gni") ##############################fuzztest########################################## ohos_fuzztest("RemoteFileShareFuzzTest") { module_out_path = "filemanagement/app_file_service" - fuzz_config_file = "//foundation/filemanagement/app_file_service/test/fuzztest/remotefileshare_fuzzer" include_dirs = [] cflags = [ "-g", diff --git a/test/unittest/remote_file_share/BUILD.gn b/test/unittest/remote_file_share/BUILD.gn index a9c46ef1d..4794210fd 100644 --- a/test/unittest/remote_file_share/BUILD.gn +++ b/test/unittest/remote_file_share/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//build/test.gni") +import("//foundation/filemanagement/app_file_service/backup.gni") ohos_unittest("remote_file_share_test") { module_out_path = "filemanagement/app_file_service" @@ -23,8 +24,8 @@ ohos_unittest("remote_file_share_test") { include_dirs = [ "include", "../../../interfaces/innerkits/remote_file_share/native", - "//utils/system/safwk/native/include", - "//commonlibrary/c_utils/base/include", + "${path_utils_system_safwk}/native/include", + "${path_base}/include", ] deps = [ -- Gitee From e594e24488070b61185b88c1f2ce5a9b7baac1d1 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Fri, 28 Apr 2023 08:22:34 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: I8c9fea205c21cdd95b1aa7b45a49ea9b09e2a867 --- app_file_service.gni | 3 +++ backup.gni | 1 - bundle.json | 19 ++++++++++--------- .../remote_file_share/native/BUILD.gn | 3 +-- test/fuzztest/remotefileshare_fuzzer/BUILD.gn | 2 ++ test/unittest/remote_file_share/BUILD.gn | 3 ++- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app_file_service.gni b/app_file_service.gni index 65e5e6a76..e97d14426 100644 --- a/app_file_service.gni +++ b/app_file_service.gni @@ -13,3 +13,6 @@ third_party_path = "//third_party" utils_system_safwk_path = "//utils/system/safwk" +path_base = "//commonlibrary/c_utils/base" +path_napi = "//foundation/arkui/napi" +app_file_service_path = "//foundation/filemanagement/app_file_service" diff --git a/backup.gni b/backup.gni index cb3bf277e..767cb94c6 100644 --- a/backup.gni +++ b/backup.gni @@ -31,7 +31,6 @@ path_init = "//base/startup/init" path_filemgmt_libn = "//foundation/filemanagement/file_api/utils/filemgmt_libn" path_backup_mock = "//foundation/filemanagement/app_file_service/tests/mock" - backup_mock_parcel_include_dirs = [ "$path_backup_mock/parcel/include" ] backup_mock_parcel_src = [ "$path_backup_mock/parcel/src/parcel.cpp" ] backup_mock_parameter_include_dirs = [ "$path_backup_mock/parameter/include" ] diff --git a/bundle.json b/bundle.json index c74353ee9..36fdad926 100644 --- a/bundle.json +++ b/bundle.json @@ -17,6 +17,7 @@ "SystemCapability.FileManagement.AppFileService", "SystemCapability.FileManagement.StorageService.Backup" ], + "deps": {}, "adapted_system_type": [ "standard" ], @@ -42,19 +43,19 @@ { "name": "//foundation/filemanagement/app_file_service/interfaces/innerkits/native/file_share:fileshare_native", "header": { - "header_files": [ - "file_share.h" - ], - "header_base": "//foundation/filemanagement/app_file_service/interfaces/innerkits/native/file_share/include" + "header_files": [ + "file_share.h" + ], + "header_base": "//foundation/filemanagement/app_file_service/interfaces/innerkits/native/file_share/include" } }, { "name": "//foundation/filemanagement/app_file_service/interfaces/innerkits/remote_file_share/native:remote_file_share_native", "header": { - "header_files": [ - "remote_file_share.h" - ], - "header_base": "//foundation/filemanagement/app_file_service/interfaces/innerkits/remote_file_share/native" + "header_files": [ + "remote_file_share.h" + ], + "header_base": "//foundation/filemanagement/app_file_service/interfaces/innerkits/remote_file_share/native" } }, { @@ -80,4 +81,4 @@ ] } } -} +} \ No newline at end of file diff --git a/interfaces/innerkits/remote_file_share/native/BUILD.gn b/interfaces/innerkits/remote_file_share/native/BUILD.gn index 49b36dd0e..2a3094ff8 100644 --- a/interfaces/innerkits/remote_file_share/native/BUILD.gn +++ b/interfaces/innerkits/remote_file_share/native/BUILD.gn @@ -24,8 +24,7 @@ config("remote_file_share_config") { } ohos_shared_library("remote_file_share_native") { - sources = - [ "${path_backup}/services/remote_file_share/src/remote_file_share.cpp" ] + sources = [ "${app_file_service_path}/services/remote_file_share/src/remote_file_share.cpp" ] public_configs = [ ":remote_file_share_config" ] diff --git a/test/fuzztest/remotefileshare_fuzzer/BUILD.gn b/test/fuzztest/remotefileshare_fuzzer/BUILD.gn index 862109d05..b35418744 100644 --- a/test/fuzztest/remotefileshare_fuzzer/BUILD.gn +++ b/test/fuzztest/remotefileshare_fuzzer/BUILD.gn @@ -19,6 +19,8 @@ import("//foundation/filemanagement/app_file_service/app_file_service.gni") ##############################fuzztest########################################## ohos_fuzztest("RemoteFileShareFuzzTest") { module_out_path = "filemanagement/app_file_service" + fuzz_config_file = + "${app_file_service_path}/test/fuzztest/remotefileshare_fuzzer" include_dirs = [] cflags = [ "-g", diff --git a/test/unittest/remote_file_share/BUILD.gn b/test/unittest/remote_file_share/BUILD.gn index 351eb4e20..8af8d3df7 100644 --- a/test/unittest/remote_file_share/BUILD.gn +++ b/test/unittest/remote_file_share/BUILD.gn @@ -16,7 +16,8 @@ import("//foundation/filemanagement/app_file_service/app_file_service.gni") ohos_unittest("remote_file_share_test") { module_out_path = "filemanagement/app_file_service" - + fuzz_config_file = + "${app_file_service_path}/test/fuzztest/remotefileshare_fuzzer" resource_config_file = "../resource/ohos_test.xml" sources = [ "remote_file_share_test.cpp" ] -- Gitee