From 85b8850754a8db0b4d8837fa6aa3aae36f8372c0 Mon Sep 17 00:00:00 2001 From: changzheng6 Date: Mon, 25 Apr 2022 17:20:26 +0800 Subject: [PATCH 1/2] modify bms dep Signed-off-by: changzheng6 --- tools/bm/BUILD.gn | 2 +- tools/{BUILD.gn => bm/bundletool.gni} | 17 ++++--- tools/test/BUILD.gn | 2 - tools/test/moduletest/bm/BUILD.gn | 54 +++++++++------------- tools/test/systemtest/bm/BUILD.gn | 14 +++--- tools/test/unittest/bm/BUILD.gn | 66 ++++++++++----------------- 6 files changed, 64 insertions(+), 91 deletions(-) rename tools/{BUILD.gn => bm/bundletool.gni} (58%) diff --git a/tools/bm/BUILD.gn b/tools/bm/BUILD.gn index 5df987d3e7..3a3691fa67 100644 --- a/tools/bm/BUILD.gn +++ b/tools/bm/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/ohos.gni") -import("../../appexecfwk.gni") +import("bundletool.gni") config("tools_bm_config") { include_dirs = [ diff --git a/tools/BUILD.gn b/tools/bm/bundletool.gni similarity index 58% rename from tools/BUILD.gn rename to tools/bm/bundletool.gni index a2e5638890..ec07c263ae 100644 --- a/tools/BUILD.gn +++ b/tools/bm/bundletool.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -11,9 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -group("tools_target") { - deps = [ - "bm:tools_bm", - "zip:tools_zip", - ] -} +aafwk_path = "//foundation/aafwk/standard" +appexecfwk_path = "//foundation/appexecfwk/standard" + +common_path = "${appexecfwk_path}/common" +kits_path = "${appexecfwk_path}/kits" +innerkits_path = "${appexecfwk_path}/interfaces/innerkits" + +bundletool_path = "${appexecfwk_path}/tools/bm" +bundletool_test_path = "${appexecfwk_path}/tools/test" diff --git a/tools/test/BUILD.gn b/tools/test/BUILD.gn index 2fc8814a4a..03d81d71a9 100644 --- a/tools/test/BUILD.gn +++ b/tools/test/BUILD.gn @@ -11,8 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../appexecfwk.gni") - group("systemtest") { testonly = true diff --git a/tools/test/moduletest/bm/BUILD.gn b/tools/test/moduletest/bm/BUILD.gn index 6a7ac6decd..7fcdc4f247 100644 --- a/tools/test/moduletest/bm/BUILD.gn +++ b/tools/test/moduletest/bm/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/test.gni") -import("../../../../appexecfwk.gni") +import("../../../bm/bundletool.gni") module_output_path = "bundle_tool/tools" @@ -29,8 +29,8 @@ config("tools_bm_config_moduletest") { } tools_bm_mock_sources = [ - "${appexecfwk_path}/tools/test/mock/mock_bundle_installer_host.cpp", - "${appexecfwk_path}/tools/test/mock/mock_bundle_mgr_host.cpp", + "${bundletool_test_path}/mock/mock_bundle_installer_host.cpp", + "${bundletool_test_path}/mock/mock_bundle_mgr_host.cpp", ] ohos_moduletest("bm_command_dump_module_test") { @@ -38,16 +38,16 @@ ohos_moduletest("bm_command_dump_module_test") { sources = [ "${appexecfwk_path}/kits/appkit/napi/bundlemgr/bundle_death_recipient.cpp", - "${appexecfwk_path}/tools/bm/src/bundle_command.cpp", - "${appexecfwk_path}/tools/bm/src/shell_command.cpp", - "${appexecfwk_path}/tools/bm/src/status_receiver_impl.cpp", + "${bundletool_path}/src/bundle_command.cpp", + "${bundletool_path}/src/shell_command.cpp", + "${bundletool_path}/src/status_receiver_impl.cpp", "bm_command_dump_module_test.cpp", ] sources += tools_bm_mock_sources configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", - "${appexecfwk_path}/tools/test/unittest/bm:tools_bm_config_mock", + "${bundletool_path}:tools_bm_config", + "${bundletool_test_path}/unittest/bm:tools_bm_config_mock", ] cflags = [] @@ -72,15 +72,11 @@ ohos_moduletest("bm_command_dump_module_test") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "os_account_standard:os_account_innerkits", + "resmgr_standard:global_resmgr", "samgr_standard:samgr_proxy", "startup_l2:syspara", "utils_base:utils", ] - defines = [] - if (global_resmgr_enable) { - defines += [ "GLOBAL_RESMGR_ENABLE" ] - external_deps += [ "resmgr_standard:global_resmgr" ] - } } ohos_moduletest("bm_command_install_module_test") { @@ -88,16 +84,16 @@ ohos_moduletest("bm_command_install_module_test") { sources = [ "${appexecfwk_path}/kits/appkit/napi/bundlemgr/bundle_death_recipient.cpp", - "${appexecfwk_path}/tools/bm/src/bundle_command.cpp", - "${appexecfwk_path}/tools/bm/src/shell_command.cpp", - "${appexecfwk_path}/tools/bm/src/status_receiver_impl.cpp", + "${bundletool_path}/src/bundle_command.cpp", + "${bundletool_path}/src/shell_command.cpp", + "${bundletool_path}/src/status_receiver_impl.cpp", "bm_command_install_module_test.cpp", ] sources += tools_bm_mock_sources configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", - "${appexecfwk_path}/tools/test/unittest/bm:tools_bm_config_mock", + "${bundletool_path}:tools_bm_config", + "${bundletool_test_path}/unittest/bm:tools_bm_config_mock", ] cflags = [] @@ -122,15 +118,11 @@ ohos_moduletest("bm_command_install_module_test") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "os_account_standard:os_account_innerkits", + "resmgr_standard:global_resmgr", "samgr_standard:samgr_proxy", "startup_l2:syspara", "utils_base:utils", ] - defines = [] - if (global_resmgr_enable) { - defines += [ "GLOBAL_RESMGR_ENABLE" ] - external_deps += [ "resmgr_standard:global_resmgr" ] - } } ohos_moduletest("bm_command_uninstall_module_test") { @@ -138,16 +130,16 @@ ohos_moduletest("bm_command_uninstall_module_test") { sources = [ "${appexecfwk_path}/kits/appkit/napi/bundlemgr/bundle_death_recipient.cpp", - "${appexecfwk_path}/tools/bm/src/bundle_command.cpp", - "${appexecfwk_path}/tools/bm/src/shell_command.cpp", - "${appexecfwk_path}/tools/bm/src/status_receiver_impl.cpp", + "${bundletool_path}/src/bundle_command.cpp", + "${bundletool_path}/src/shell_command.cpp", + "${bundletool_path}/src/status_receiver_impl.cpp", "bm_command_uninstall_module_test.cpp", ] sources += tools_bm_mock_sources configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", - "${appexecfwk_path}/tools/test/unittest/bm:tools_bm_config_mock", + "${bundletool_path}:tools_bm_config", + "${bundletool_test_path}/unittest/bm:tools_bm_config_mock", ] cflags = [] @@ -172,15 +164,11 @@ ohos_moduletest("bm_command_uninstall_module_test") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "os_account_standard:os_account_innerkits", + "resmgr_standard:global_resmgr", "samgr_standard:samgr_proxy", "startup_l2:syspara", "utils_base:utils", ] - defines = [] - if (global_resmgr_enable) { - defines += [ "GLOBAL_RESMGR_ENABLE" ] - external_deps += [ "resmgr_standard:global_resmgr" ] - } } group("moduletest") { diff --git a/tools/test/systemtest/bm/BUILD.gn b/tools/test/systemtest/bm/BUILD.gn index cd85ae89ca..c2e61efefd 100644 --- a/tools/test/systemtest/bm/BUILD.gn +++ b/tools/test/systemtest/bm/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/test.gni") -import("../../../../appexecfwk.gni") +import("../../../bm/bundletool.gni") module_output_path = "bundle_tool/tools" @@ -30,8 +30,8 @@ ohos_systemtest("bm_command_install_system_test") { ] configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", - "${appexecfwk_path}/tools/test/unittest/bm:tools_bm_config_mock", + "${bundletool_path}:tools_bm_config", + "${bundletool_test_path}/unittest/bm:tools_bm_config_mock", ] cflags = [] @@ -69,8 +69,8 @@ ohos_systemtest("bm_command_uninstall_system_test") { ] configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", - "${appexecfwk_path}/tools/test/unittest/bm:tools_bm_config_mock", + "${bundletool_path}:tools_bm_config", + "${bundletool_test_path}/unittest/bm:tools_bm_config_mock", ] cflags = [] @@ -108,8 +108,8 @@ ohos_systemtest("bm_command_dump_system_test") { ] configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", - "${appexecfwk_path}/tools/test/unittest/bm:tools_bm_config_mock", + "${bundletool_path}:tools_bm_config", + "${bundletool_test_path}/unittest/bm:tools_bm_config_mock", ] cflags = [] diff --git a/tools/test/unittest/bm/BUILD.gn b/tools/test/unittest/bm/BUILD.gn index 6eedad62db..31e79e2894 100644 --- a/tools/test/unittest/bm/BUILD.gn +++ b/tools/test/unittest/bm/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/test.gni") -import("../../../../appexecfwk.gni") +import("../../../bm/bundletool.gni") module_output_path = "bundle_tool/tools" @@ -20,10 +20,10 @@ config("tools_bm_config_mock") { include_dirs = [ "${innerkits_path}/appexecfwk_base/include", "${innerkits_path}/appexecfwk_core/include/bundlemgr", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", + "${innerkits_path}/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${appexecfwk_path}/services/bundlemgr/include/sandbox_app", - "${appexecfwk_path}/tools/test/mock", + "${bundletool_test_path}/mock", "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", "//base/security/appverify/interfaces/innerkits/appverify/include", "//third_party/googletest/googlemock/include", @@ -32,8 +32,8 @@ config("tools_bm_config_mock") { } tools_bm_mock_sources = [ - "${appexecfwk_path}/tools/test/mock/mock_bundle_installer_host.cpp", - "${appexecfwk_path}/tools/test/mock/mock_bundle_mgr_host.cpp", + "${bundletool_test_path}/mock/mock_bundle_installer_host.cpp", + "${bundletool_test_path}/mock/mock_bundle_mgr_host.cpp", ] ohos_unittest("bm_command_dump_test") { @@ -43,15 +43,15 @@ ohos_unittest("bm_command_dump_test") { sources = [ "${appexecfwk_path}/kits/appkit/napi/bundlemgr/bundle_death_recipient.cpp", - "${appexecfwk_path}/tools/bm/src/bundle_command.cpp", - "${appexecfwk_path}/tools/bm/src/shell_command.cpp", - "${appexecfwk_path}/tools/bm/src/status_receiver_impl.cpp", + "${bundletool_path}/src/bundle_command.cpp", + "${bundletool_path}/src/shell_command.cpp", + "${bundletool_path}/src/status_receiver_impl.cpp", "bm_command_dump_test.cpp", ] sources += tools_bm_mock_sources configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", + "${bundletool_path}:tools_bm_config", ":tools_bm_config_mock", ] @@ -79,15 +79,11 @@ ohos_unittest("bm_command_dump_test") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "os_account_standard:os_account_innerkits", + "resmgr_standard:global_resmgr", "samgr_standard:samgr_proxy", "startup_l2:syspara", "utils_base:utils", ] - defines = [] - if (global_resmgr_enable) { - defines += [ "GLOBAL_RESMGR_ENABLE" ] - external_deps += [ "resmgr_standard:global_resmgr" ] - } } ohos_unittest("bm_command_install_test") { @@ -97,15 +93,15 @@ ohos_unittest("bm_command_install_test") { sources = [ "${appexecfwk_path}/kits/appkit/napi/bundlemgr/bundle_death_recipient.cpp", - "${appexecfwk_path}/tools/bm/src/bundle_command.cpp", - "${appexecfwk_path}/tools/bm/src/shell_command.cpp", - "${appexecfwk_path}/tools/bm/src/status_receiver_impl.cpp", + "${bundletool_path}/src/bundle_command.cpp", + "${bundletool_path}/src/shell_command.cpp", + "${bundletool_path}/src/status_receiver_impl.cpp", "bm_command_install_test.cpp", ] sources += tools_bm_mock_sources configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", + "${bundletool_path}:tools_bm_config", ":tools_bm_config_mock", ] @@ -133,15 +129,11 @@ ohos_unittest("bm_command_install_test") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "os_account_standard:os_account_innerkits", + "resmgr_standard:global_resmgr", "samgr_standard:samgr_proxy", "startup_l2:syspara", "utils_base:utils", ] - defines = [] - if (global_resmgr_enable) { - defines += [ "GLOBAL_RESMGR_ENABLE" ] - external_deps += [ "resmgr_standard:global_resmgr" ] - } } ohos_unittest("bm_command_test") { @@ -151,15 +143,15 @@ ohos_unittest("bm_command_test") { sources = [ "${appexecfwk_path}/kits/appkit/napi/bundlemgr/bundle_death_recipient.cpp", - "${appexecfwk_path}/tools/bm/src/bundle_command.cpp", - "${appexecfwk_path}/tools/bm/src/shell_command.cpp", - "${appexecfwk_path}/tools/bm/src/status_receiver_impl.cpp", + "${bundletool_path}/src/bundle_command.cpp", + "${bundletool_path}/src/shell_command.cpp", + "${bundletool_path}/src/status_receiver_impl.cpp", "bm_command_test.cpp", ] sources += tools_bm_mock_sources configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", + "${bundletool_path}:tools_bm_config", ":tools_bm_config_mock", ] @@ -187,15 +179,11 @@ ohos_unittest("bm_command_test") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "os_account_standard:os_account_innerkits", + "resmgr_standard:global_resmgr", "samgr_standard:samgr_proxy", "startup_l2:syspara", "utils_base:utils", ] - defines = [] - if (global_resmgr_enable) { - defines += [ "GLOBAL_RESMGR_ENABLE" ] - external_deps += [ "resmgr_standard:global_resmgr" ] - } } ohos_unittest("bm_command_uninstall_test") { @@ -205,15 +193,15 @@ ohos_unittest("bm_command_uninstall_test") { sources = [ "${appexecfwk_path}/kits/appkit/napi/bundlemgr/bundle_death_recipient.cpp", - "${appexecfwk_path}/tools/bm/src/bundle_command.cpp", - "${appexecfwk_path}/tools/bm/src/shell_command.cpp", - "${appexecfwk_path}/tools/bm/src/status_receiver_impl.cpp", + "${bundletool_path}/src/bundle_command.cpp", + "${bundletool_path}/src/shell_command.cpp", + "${bundletool_path}/src/status_receiver_impl.cpp", "bm_command_uninstall_test.cpp", ] sources += tools_bm_mock_sources configs = [ - "${appexecfwk_path}/tools/bm:tools_bm_config", + "${bundletool_path}:tools_bm_config", ":tools_bm_config_mock", ] @@ -241,15 +229,11 @@ ohos_unittest("bm_command_uninstall_test") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "os_account_standard:os_account_innerkits", + "resmgr_standard:global_resmgr", "samgr_standard:samgr_proxy", "startup_l2:syspara", "utils_base:utils", ] - defines = [] - if (global_resmgr_enable) { - defines += [ "GLOBAL_RESMGR_ENABLE" ] - external_deps += [ "resmgr_standard:global_resmgr" ] - } } group("unittest") { -- Gitee From 12fcd7fc2c5e12c0567f570a50ce23cb5016624d Mon Sep 17 00:00:00 2001 From: changzheng6 Date: Mon, 25 Apr 2022 17:21:53 +0800 Subject: [PATCH 2/2] modify bms dep Signed-off-by: changzheng6 --- tools/bm/bundletool.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bm/bundletool.gni b/tools/bm/bundletool.gni index ec07c263ae..3c39c1239c 100644 --- a/tools/bm/bundletool.gni +++ b/tools/bm/bundletool.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2022 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 -- Gitee