From 9212ee78ed549c8ac9156ff6c16186ba62e9b469 Mon Sep 17 00:00:00 2001 From: RainyDay_005 Date: Fri, 23 Feb 2024 11:00:26 +0800 Subject: [PATCH 1/2] Signed-off-by: RainyDay_005 --- frameworks/js/napi/update/BUILD.gn | 15 +++-------- frameworks/js/napi/update/update_helper.gni | 30 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 frameworks/js/napi/update/update_helper.gni diff --git a/frameworks/js/napi/update/BUILD.gn b/frameworks/js/napi/update/BUILD.gn index c356937e..191ddb70 100644 --- a/frameworks/js/napi/update/BUILD.gn +++ b/frameworks/js/napi/update/BUILD.gn @@ -14,6 +14,7 @@ import("//build/ohos.gni") import("../../../../updateengine.gni") import("../session/update_session.gni") +import("../update_helper.gni") ohos_shared_library("$updateengine_client_library_name") { sanitize = { @@ -27,26 +28,18 @@ ohos_shared_library("$updateengine_client_library_name") { sources = [] if (ability_ability_runtime_enable) { sources += [ - "$updateengine_root_path/frameworks/js/napi/update/common/src/client_helper.cpp", - "$updateengine_root_path/frameworks/js/napi/update/common/src/iupdater.cpp", - "$updateengine_root_path/frameworks/js/napi/update/src/define_property.cpp", - "$updateengine_root_path/frameworks/js/napi/update/src/local_updater.cpp", - "$updateengine_root_path/frameworks/js/napi/update/src/restorer.cpp", - "$updateengine_root_path/frameworks/js/napi/update/src/session_manager.cpp", - "$updateengine_root_path/frameworks/js/napi/update/src/update_client.cpp", "$updateengine_root_path/frameworks/js/napi/update/src/update_module.cpp", - "$updateengine_root_path/frameworks/js/napi/update/src/update_session.cpp", ] + sources += update_helper_sources sources += session_sources } include_dirs = [ - "$updateengine_root_path/frameworks/js/napi/update/common/include", - "$updateengine_root_path/frameworks/js/napi/update/include", - "//third_party/json/include", "//third_party/node/src", # napi ] + include_dirs += update_helper_common_include_dirs + include_dirs += update_helper_include_dirs include_dirs += session_include_dirs deps = [ diff --git a/frameworks/js/napi/update/update_helper.gni b/frameworks/js/napi/update/update_helper.gni new file mode 100644 index 00000000..2e07cec7 --- /dev/null +++ b/frameworks/js/napi/update/update_helper.gni @@ -0,0 +1,30 @@ +# Copyright (c) 2024 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. + +root_path = "//base/update/updateservice" + +update_helper_sources = [ + "$root_path/frameworks/js/napi/update/common/src/client_helper.cpp", + "$root_path/frameworks/js/napi/update/common/src/iupdater.cpp", + "$root_path/frameworks/js/napi/update/src/define_property.cpp", + "$root_path/frameworks/js/napi/update/src/local_updater.cpp", + "$root_path/frameworks/js/napi/update/src/restorer.cpp", + "$root_path/frameworks/js/napi/update/src/session_manager.cpp", + "$root_path/frameworks/js/napi/update/src/update_client.cpp", + "$root_path/frameworks/js/napi/update/src/update_session.cpp", +] + +update_helper_include_dirs = [ "$root_path/frameworks/js/napi/update/include" ] + +update_helper_common_include_dirs = + [ "$root_path/frameworks/js/napi/update/common/include" ] -- Gitee From 8d624b50de1bc6d2c5d69e9cccda6e14064e39d7 Mon Sep 17 00:00:00 2001 From: RainyDay Date: Fri, 23 Feb 2024 03:44:13 +0000 Subject: [PATCH 2/2] update frameworks/js/napi/update/BUILD.gn. Signed-off-by: RainyDay --- frameworks/js/napi/update/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/js/napi/update/BUILD.gn b/frameworks/js/napi/update/BUILD.gn index 191ddb70..297ec374 100644 --- a/frameworks/js/napi/update/BUILD.gn +++ b/frameworks/js/napi/update/BUILD.gn @@ -14,7 +14,7 @@ import("//build/ohos.gni") import("../../../../updateengine.gni") import("../session/update_session.gni") -import("../update_helper.gni") +import("./update_helper.gni") ohos_shared_library("$updateengine_client_library_name") { sanitize = { -- Gitee