From fadf4067462d87da90069a4581b86361b8726bc5 Mon Sep 17 00:00:00 2001 From: xianghengliang Date: Wed, 26 Jan 2022 14:31:29 +0800 Subject: [PATCH 1/5] Standardization and rectification of dfs_service part Signed-off-by: xianghengliang --- BUILD.gn | 44 +++++++++++++++++++++++++++++++++++++++ bundle.json | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ ohos.build | 29 -------------------------- 3 files changed, 104 insertions(+), 29 deletions(-) create mode 100644 BUILD.gn create mode 100644 bundle.json delete mode 100755 ohos.build diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 000000000..ee2161b0e --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright (C) 2021 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("distributedfile.gni") + +group("libdistributedfile_innerkits") { + deps = [ "${innerkits_native_path}:libdistributedfile_innerkits" ] +} + +group("services_target") { + deps = [ + "${services_path}:distributed_file.para", + "${services_path}:distributedfile_etc", + "${services_path}:distributedfile_sa_profile", + "${services_path}/distributedfiledaemon:distributedfiledaemon_target", + "${services_path}/distributedfileservice:distributedfileservice_target", + ] +} + +group("unittest") { + testonly = true + deps = [ + "${services_path}/distributedfiledaemon/test/unittest:DeviceManagerAgentTest" + ] +} + +group("moduletest") { + testonly = true + deps = [ + "test/moduletest:DistributedFileDaemonServiceTest" + ] +} + diff --git a/bundle.json b/bundle.json new file mode 100644 index 000000000..23e7bd58b --- /dev/null +++ b/bundle.json @@ -0,0 +1,60 @@ +{ + "name": "@ohos/dfs_service", + "version": "3.1", + "description": "The dfs_service module belongs to the filemanagement subsystem of OpenHarmony. It provides the ability of accessing distributed files.", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "foundation/filemanagement/dfs_service" + }, + "dirs": {}, + "scripts": {}, + "author": {}, + "repository": "", + "component": { + "name": "dfs_service", + "subsystem": "filemanagement", + "syscap": [], + "features": [], + "adapted_system_type": [], + "rom": "", + "ram": "", + "deps": { + "components": [ + "app_manager", + "appexecfwk_base", + "appexecfwk_core", + "libhilog", + "ipc_core", + "system_ability_fwk", + "samgr_proxy", + "utils_base", + "softbus_client", + "want" + ], + "third_party": [ + "thirdparty_json" + ] + }, + "build": { + "sub_component": [ + "//foundation/filemanagement/dfs_service/services/:services_target" + ], + "inner_kits": [ + { + "name": "//foundation/filemanagement/dfs_service/interfaces/innerkits/native:libdistributedfile_innerkits", + "header": { + "header_files": [ + "i_distributedfile_service.h" + ], + "header_base": "//foundation/filemanagement/dfs_service/interfaces/innerkits/native" + } + } + ], + "test": [ + "//foundation/filemanagement/dfs_service/services/distributedfiledaemon/test/unittest:unittest", + "//foundation/filemanagement/dfs_service/test/moduletest:moduletest" + ] + } + } +} diff --git a/ohos.build b/ohos.build deleted file mode 100755 index b56a40189..000000000 --- a/ohos.build +++ /dev/null @@ -1,29 +0,0 @@ -{ - "subsystem": "filemanagement", - "parts": { - "dfs_service": { - "variants": [ - "wearable", - "phone" - ], - "module_list": [ - "//foundation/filemanagement/dfs_service/services/:services_target" - ], - "inner_kits":[ - { - "name": "//foundation/filemanagement/dfs_service/interfaces/innerkits/native:libdistributedfile_innerkits", - "header": { - "header_files": [ - "i_distributedfile_service.h" - ], - "header_base": "//foundation/filemanagement/dfs_service/interfaces/innerkits/native" - } - } - ], - "test_list": [ - "//foundation/filemanagement/dfs_service/services/distributedfiledaemon/test/unittest:unittest", - "//foundation/filemanagement/dfs_service/test/moduletest:moduletest" - ] - } - } -} -- Gitee From e09a37a641fb01acbfe10166476f0755e5ae6a0a Mon Sep 17 00:00:00 2001 From: xianghengliang Date: Wed, 26 Jan 2022 15:16:21 +0800 Subject: [PATCH 2/5] Unified compilation module Signed-off-by: xianghengliang --- BUILD.gn | 19 ++++++------------- bundle.json | 7 +++---- services/BUILD.gn | 10 ---------- services/distributedfiledaemon/BUILD.gn | 4 ---- services/distributedfileservice/BUILD.gn | 3 --- test/moduletest/BUILD.gn | 5 ----- 6 files changed, 9 insertions(+), 39 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index ee2161b0e..3b38af8d2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/ohos.gni") -import("distributedfile.gni") +import("//foundation/filemanagement/dfs_service/distributedfile.gni") group("libdistributedfile_innerkits") { deps = [ "${innerkits_native_path}:libdistributedfile_innerkits" ] @@ -23,22 +23,15 @@ group("services_target") { "${services_path}:distributed_file.para", "${services_path}:distributedfile_etc", "${services_path}:distributedfile_sa_profile", - "${services_path}/distributedfiledaemon:distributedfiledaemon_target", - "${services_path}/distributedfileservice:distributedfileservice_target", + "${services_path}/distributedfiledaemon:libdistributedfiledaemon", + "${services_path}/distributedfileservice:libdistributedfileservice", ] } -group("unittest") { +group("dfs_test_moudule") { testonly = true deps = [ - "${services_path}/distributedfiledaemon/test/unittest:DeviceManagerAgentTest" + "${services_path}/distributedfiledaemon/test/unittest:DeviceManagerAgentTest", + "test/moduletest:DistributedFileDaemonServiceTest", ] } - -group("moduletest") { - testonly = true - deps = [ - "test/moduletest:DistributedFileDaemonServiceTest" - ] -} - diff --git a/bundle.json b/bundle.json index 23e7bd58b..1ee9405d3 100644 --- a/bundle.json +++ b/bundle.json @@ -38,11 +38,11 @@ }, "build": { "sub_component": [ - "//foundation/filemanagement/dfs_service/services/:services_target" + "//foundation/filemanagement/dfs_service:services_target" ], "inner_kits": [ { - "name": "//foundation/filemanagement/dfs_service/interfaces/innerkits/native:libdistributedfile_innerkits", + "name": "//foundation/filemanagement/dfs_service:libdistributedfile_innerkits", "header": { "header_files": [ "i_distributedfile_service.h" @@ -52,8 +52,7 @@ } ], "test": [ - "//foundation/filemanagement/dfs_service/services/distributedfiledaemon/test/unittest:unittest", - "//foundation/filemanagement/dfs_service/test/moduletest:moduletest" + "//foundation/filemanagement/dfs_service:dfs_test_moudule" ] } } diff --git a/services/BUILD.gn b/services/BUILD.gn index d9afcb9c6..f9b13805e 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -34,13 +34,3 @@ ohos_prebuilt_etc("distributed_file.para") { part_name = "dfs_service" module_install_dir = "etc/param" } - -group("services_target") { - deps = [ - ":distributed_file.para", - ":distributedfile_etc", - ":distributedfile_sa_profile", - "distributedfiledaemon:distributedfiledaemon_target", - "distributedfileservice:distributedfileservice_target", - ] -} diff --git a/services/distributedfiledaemon/BUILD.gn b/services/distributedfiledaemon/BUILD.gn index 35e054121..af0d2e294 100755 --- a/services/distributedfiledaemon/BUILD.gn +++ b/services/distributedfiledaemon/BUILD.gn @@ -52,7 +52,3 @@ ohos_shared_library("libdistributedfiledaemon") { part_name = "dfs_service" subsystem_name = "filemanagement" } - -group("distributedfiledaemon_target") { - deps = [ ":libdistributedfiledaemon" ] -} diff --git a/services/distributedfileservice/BUILD.gn b/services/distributedfileservice/BUILD.gn index b3ed94eb4..0e043b4a0 100644 --- a/services/distributedfileservice/BUILD.gn +++ b/services/distributedfileservice/BUILD.gn @@ -42,6 +42,3 @@ ohos_shared_library("libdistributedfileservice") { subsystem_name = "filemanagement" } -group("distributedfileservice_target") { - deps = [ ":libdistributedfileservice" ] -} diff --git a/test/moduletest/BUILD.gn b/test/moduletest/BUILD.gn index 1e39a9a80..8bc51b452 100644 --- a/test/moduletest/BUILD.gn +++ b/test/moduletest/BUILD.gn @@ -72,8 +72,3 @@ ohos_moduletest("DistributedFileDaemonServiceTest") { "samgr_standard:samgr_proxy", ] } - -group("moduletest") { - testonly = true - deps = [ ":DistributedFileDaemonServiceTest" ] -} -- Gitee From 720d8bf4a8d4b8f4517d7f897a22d2f9b7423928 Mon Sep 17 00:00:00 2001 From: xianghengliang Date: Wed, 26 Jan 2022 15:54:23 +0800 Subject: [PATCH 3/5] remove no use module app-manager Signed-off-by: xianghengliang --- BUILD.gn | 4 ++-- bundle.json | 16 +++++++--------- services/distributedfileservice/BUILD.gn | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 3b38af8d2..180b46ec8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -30,8 +30,8 @@ group("services_target") { group("dfs_test_moudule") { testonly = true - deps = [ + deps = [ "${services_path}/distributedfiledaemon/test/unittest:DeviceManagerAgentTest", "test/moduletest:DistributedFileDaemonServiceTest", - ] + ] } diff --git a/bundle.json b/bundle.json index 1ee9405d3..03a609900 100644 --- a/bundle.json +++ b/bundle.json @@ -21,16 +21,14 @@ "ram": "", "deps": { "components": [ - "app_manager", - "appexecfwk_base", - "appexecfwk_core", + "ability_runtime", + "bundle_framework", + "dsoftbus_standard", + "ipc", "libhilog", - "ipc_core", - "system_ability_fwk", - "samgr_proxy", - "utils_base", - "softbus_client", - "want" + "safwk", + "samgr_standard", + "utils_base" ], "third_party": [ "thirdparty_json" diff --git a/services/distributedfileservice/BUILD.gn b/services/distributedfileservice/BUILD.gn index 0e043b4a0..11c66c74c 100644 --- a/services/distributedfileservice/BUILD.gn +++ b/services/distributedfileservice/BUILD.gn @@ -24,7 +24,6 @@ ohos_shared_library("libdistributedfileservice") { configs = [ "${utils_path}:compiler_configs" ] external_deps = [ - "ability_runtime:app_manager", "ability_runtime:want", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", -- Gitee From 29e69e9ff3b4ba3c5fb4f8f98be4cf9a7d4a5026 Mon Sep 17 00:00:00 2001 From: xianghengliang Date: Wed, 26 Jan 2022 16:21:32 +0800 Subject: [PATCH 4/5] gn format_check fix Signed-off-by: xianghengliang --- services/distributedfileservice/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/services/distributedfileservice/BUILD.gn b/services/distributedfileservice/BUILD.gn index 11c66c74c..18acb1a25 100644 --- a/services/distributedfileservice/BUILD.gn +++ b/services/distributedfileservice/BUILD.gn @@ -40,4 +40,3 @@ ohos_shared_library("libdistributedfileservice") { part_name = "dfs_service" subsystem_name = "filemanagement" } - -- Gitee From fd7804ce8cea99c1033555e0b845a8ccb00eeb2e Mon Sep 17 00:00:00 2001 From: xianghengliang Date: Wed, 26 Jan 2022 17:30:39 +0800 Subject: [PATCH 5/5] update dependence parts name Signed-off-by: xianghengliang --- bundle.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bundle.json b/bundle.json index 03a609900..fb9e31e5b 100644 --- a/bundle.json +++ b/bundle.json @@ -23,15 +23,15 @@ "components": [ "ability_runtime", "bundle_framework", - "dsoftbus_standard", + "dsoftbus", "ipc", - "libhilog", + "hilog", "safwk", - "samgr_standard", - "utils_base" + "samgr", + "utils" ], "third_party": [ - "thirdparty_json" + "json_modern_c++" ] }, "build": { -- Gitee