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}", ".")
18module_update_service_gen("module_update_service") {
19  deps = [ "${sys_installer_path}/services/module_update/service:libmodule_update_service_static" ]
20
21  part_name = "sys_installer"
22  subsystem_name = "updater"
23}
24
25config("module_update_service_exported_header") {
26  visibility = [ ":*" ]
27
28  include_dirs = [
29    "${sys_installer_path}/services/module_update/include",
30    "${sys_installer_path}/services/module_update/util/include",
31  ]
32}
33
34ohos_static_library("libmodule_update_service_static") {
35  sources = [
36    "${sys_installer_path}/frameworks/ipc_server/src/module_update_service.cpp",
37    "${sys_installer_path}/frameworks/ipc_server/src/module_update_stub.cpp",
38    "${sys_installer_path}/frameworks/ipc_server/src/sys_installer_callback_proxy.cpp",
39    "${sys_installer_path}/services/module_update/service/src/module_update_consumer.cpp",
40    "${sys_installer_path}/services/module_update/service/src/module_update_main.cpp",
41    "${sys_installer_path}/services/module_update/service/src/module_update_producer.cpp",
42    "${sys_installer_path}/services/module_update/service/src/module_update_queue.cpp",
43    "${sys_installer_path}/services/module_update/util/src/module_ipc_helper.cpp",
44  ]
45
46  include_dirs = [
47    "${sys_installer_path}/common/include",
48    "${sys_installer_path}/frameworks/installer_manager/include",
49    "${sys_installer_path}/frameworks/ipc_server/include",
50    "${sys_installer_path}/interfaces/inner_api/include",
51    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
52    "${sys_installer_path}/services/module_update/service/include",
53    "${sys_installer_path}/services/module_update/include",
54  ]
55
56  public_configs = [ ":module_update_service_exported_header" ]
57
58  deps = [
59    "${sys_installer_path}/services/module_update/src:module_update_static",
60  ]
61
62  external_deps = [
63    "access_token:libaccesstoken_sdk",
64    "c_utils:utils",
65    "hilog:libhilog",
66    "hisysevent:libhisyseventmanager",
67    "init:libbeget_proxy",
68    "ipc:ipc_core",
69    "safwk:system_ability_fwk",
70    "samgr:samgr_proxy",
71    "updater:libpackage_shared",
72    "updater:libupdaterlog_shared",
73    "updater:libutils_fs",
74  ]
75
76  if (build_selinux) {
77    external_deps += [ "selinux_adapter:librestorecon" ]
78    cflags = [ "-DWITH_SELINUX" ]
79  }
80
81  part_name = "sys_installer"
82  subsystem_name = "updater"
83}
84