diff --git a/tools/bm/BUILD.gn b/tools/bm/BUILD.gn index 5df987d3e76be86932008a0734c85f9f788aa32d..3a3691fa6780df731682bc7b82b5826933e8936f 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 a2e56388900d8e41af13209540c70d17ceab21b5..3c39c1239ca881c5f849e82ef9d2f583e783df28 100644 --- a/tools/BUILD.gn +++ b/tools/bm/bundletool.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 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 @@ -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 2fc8814a4a22c446e3d63fd050630587b7ee823e..03d81d71a970cdc3c62123e4e0e0bbfc8e1ee376 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 6a7ac6decd65b918029724ce6c1b1b7e0d6b2268..7fcdc4f2470d1005cd47fbfe8cad3beceed8d8ca 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 cd85ae89cadc6df420ab7e61a4f258495865474c..c2e61efefd98abd778b93f6b077e5295ae71eb34 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 6eedad62dbc9ed805fd493827385e8b6a6187167..31e79e289407fc946e4b22887c9d2e1b3b4a770d 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") {