• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/update/sys_installer/sys_installer_default_cfg.gni")
15import("//build/ohos.gni")
16
17sys_installer_path = rebase_path("${sys_installer_absolutely_path}", ".")
18config("utils_exported_header") {
19  visibility = [ ":*" ]
20  include_dirs = [
21    "${sys_installer_path}/services/module_update/util/include",
22    "//third_party/cJSON",
23    "//third_party/zlib",
24    "//third_party/zlib/contrib/minizip",
25  ]
26}
27
28ohos_static_library("module_update_utils") {
29  sources = [
30    "${sys_installer_path}/services/module_update/util/src/module_file.cpp",
31    "${sys_installer_path}/services/module_update/util/src/module_utils.cpp",
32    "${sys_installer_path}/services/module_update/util/src/module_zip_helper.cpp",
33  ]
34
35  public_configs = [ ":utils_exported_header" ]
36
37  external_deps = [
38    "c_utils:utils",
39    "updater:libmiscinfo",
40    "updater:libpackageExt",
41    "updater:libupdaterlog",
42    "updater:libutils",
43  ]
44
45  if (defined(global_parts_info.startup_hvb)) {
46    sources += [ "${sys_installer_path}/services/module_update/util/src/module_hvb_ops.cpp" ]
47
48    defines = [ "SUPPORT_HVB" ]
49
50    external_deps += [
51      "hvb:libhvb_static",
52      "init:libfsmanager_static",
53    ]
54  }
55
56  part_name = "sys_installer"
57  subsystem_name = "updater"
58}
59
60config("module_update_exported_header") {
61  visibility = [ ":*" ]
62  include_dirs = [ "${sys_installer_path}/services/module_update/include" ]
63}
64
65ohos_static_library("module_update_static") {
66  sources = [
67    "${sys_installer_path}/services/module_update/src/module_dm.cpp",
68    "${sys_installer_path}/services/module_update/src/module_file_repository.cpp",
69    "${sys_installer_path}/services/module_update/src/module_loop.cpp",
70    "${sys_installer_path}/services/module_update/src/module_update.cpp",
71  ]
72
73  public_configs = [ ":module_update_exported_header" ]
74
75  public_deps = [
76    ":module_update_utils",
77    "${sys_installer_path}/interfaces/innerkits/ipc_client:module_update_client",
78  ]
79
80  external_deps = [
81    "samgr:samgr_common",
82    "updater:libupdaterlog",
83  ]
84
85  if (defined(global_parts_info.startup_hvb)) {
86    defines = [ "SUPPORT_HVB" ]
87
88    external_deps += [
89      "hvb:libhvb_static",
90      "init:libfsmanager_static",
91    ]
92  }
93
94  part_name = "sys_installer"
95  subsystem_name = "updater"
96}
97