• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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/config/components/idl_tool/idl.gni")
16import("//build/ohos.gni")
17
18sys_installer_path = rebase_path("${sys_installer_absolutely_path}", ".")
19
20config("libsysinstallerkits_exported_headers") {
21  visibility = [ ":*" ]
22  include_dirs = [
23    "${sys_installer_path}/common/include",
24    "${sys_installer_path}/include",
25    "${sys_installer_path}/interfaces/innerkits",
26    "${sys_installer_path}/interfaces/inner_api/include",
27    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
28    "${target_gen_dir}",
29  ]
30}
31
32config("idl_file_headers") {
33  include_dirs = [
34    "${target_gen_dir}",
35    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
36  ]
37}
38
39idl_gen_interface("sysinstaller_interface") {
40  sources = [ "ISysInstaller.idl" ]
41  sources_callback = [ "ISysInstallerCallback.idl" ]
42  sources_common = ["Types.idl"]
43
44  log_domainid = "0xD002E01"
45  log_tag = "SysInstaller"
46
47  part_name = "sys_installer"
48  subsystem_name = "updater"
49}
50
51ohos_source_set("sys_installer_stub") {
52  sources = [
53    "${target_gen_dir}/sys_installer_callback_proxy.cpp",
54    "${target_gen_dir}/sys_installer_stub.cpp",
55  ]
56
57  include_dirs = [
58      "${target_gen_dir}",
59      "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
60  ]
61
62  deps = [ ":sysinstaller_interface" ]
63
64  external_deps = [
65    "hilog:libhilog",
66    "ipc:ipc_core",
67    "samgr:samgr_proxy",
68    "bounds_checking_function:libsec_shared",
69  ]
70
71  part_name = "sys_installer"
72  subsystem_name = "updater"
73}
74
75ohos_source_set("module_update_stub") {
76  sources = [
77    "${target_gen_dir}/sys_installer_callback_proxy.cpp",
78    "${target_gen_dir}/types.cpp",
79  ]
80
81  include_dirs = [
82    "${target_gen_dir}",
83    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
84  ]
85
86  deps = [ ":sysinstaller_interface" ]
87
88  external_deps = [
89    "hilog:libhilog",
90    "ipc:ipc_core",
91    "samgr:samgr_proxy",
92    "bounds_checking_function:libsec_shared",
93  ]
94
95  part_name = "sys_installer"
96  subsystem_name = "updater"
97}
98
99ohos_shared_library("libsysinstaller_shared") {
100  defines = [ "SYS_INSTALLER_KITS" ]
101  sources = [
102    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
103    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_kits_impl.cpp",
104    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_load_callback.cpp",
105    "${target_gen_dir}/sys_installer_callback_stub.cpp",
106    "${target_gen_dir}/sys_installer_proxy.cpp",
107    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/buffer_info_parcel.cpp",
108    "${target_gen_dir}/types.cpp",
109  ]
110
111  include_dirs = [
112    "${sys_installer_path}/common/include",
113    "${sys_installer_path}/include",
114    "${sys_installer_path}/interfaces/innerkits",
115    "${sys_installer_path}/interfaces/inner_api/include",
116    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
117    "${target_gen_dir}",
118  ]
119
120  public_configs = [ ":libsysinstallerkits_exported_headers" ]
121
122  deps = [ ":sysinstaller_interface" ]
123
124  external_deps = [
125    "bounds_checking_function:libsec_shared",
126    "c_utils:utils",
127    "hilog:libhilog",
128    "init:libbegetutil",
129    "ipc:ipc_core",
130    "lz4:liblz4_static",
131    "safwk:system_ability_fwk",
132    "samgr:samgr_proxy",
133    "updater:libupdaterlog",
134    "updater:libutils_fs",
135    "zlib:shared_libz",
136  ]
137
138  if (!is_linux && !is_mingw && !is_mac && ohos_indep_compiler_enable) {
139    external_deps += [ "hilog:libhilog_base", ]
140  }
141
142  innerapi_tags = [
143    "platformsdk",
144    "sasdk",
145  ]
146
147  part_name = "sys_installer"
148  subsystem_name = "updater"
149}
150
151ohos_static_library("libsysinstallerkits") {
152  defines = [ "SYS_INSTALLER_KITS" ]
153  sources = [
154    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
155    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_kits_impl.cpp",
156    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_load_callback.cpp",
157    "${target_gen_dir}/sys_installer_callback_stub.cpp",
158    "${target_gen_dir}/sys_installer_proxy.cpp",
159    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/buffer_info_parcel.cpp",
160    "${target_gen_dir}/types.cpp",
161  ]
162
163  include_dirs = [
164    "${sys_installer_path}/common/include",
165    "${sys_installer_path}/include",
166    "${sys_installer_path}/interfaces/innerkits",
167    "${sys_installer_path}/interfaces/inner_api/include",
168    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
169    "${target_gen_dir}",
170  ]
171
172  public_configs = [ ":libsysinstallerkits_exported_headers" ]
173
174  deps = [ ":sysinstaller_interface" ]
175
176  external_deps = [
177    "bounds_checking_function:libsec_static",
178    "c_utils:utils",
179    "hilog:libhilog",
180    "init:libbegetutil",
181    "ipc:ipc_core",
182    "safwk:system_ability_fwk",
183    "samgr:samgr_proxy",
184    "updater:libupdaterlog",
185    "updater:libutils",
186  ]
187
188  part_name = "sys_installer"
189  subsystem_name = "updater"
190}
191
192ohos_executable("sys_installer_client") {
193  sources = [ "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_client.cpp" ]
194
195  include_dirs = [
196    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
197    "${sys_installer_path}/interfaces/inner_api/include",
198  ]
199
200  deps = [
201    "${sys_installer_path}/interfaces/innerkits/ipc_client:libsysinstallerkits",
202  ]
203  external_deps = [
204    "bounds_checking_function:libsec_static",
205    "c_utils:utils",
206    "hilog:libhilog",
207    "init:libbegetutil",
208    "ipc:ipc_core",
209    "safwk:system_ability_fwk",
210    "samgr:samgr_proxy",
211  ]
212  install_enable = true
213  part_name = "sys_installer"
214  subsystem_name = "updater"
215}
216
217module_update_gen("module_update") {
218  include_dirs = [ "./include" ]
219
220  deps = [ "${sys_installer_path}/interfaces/innerkits/ipc_client:libmodule_update_shared" ]
221
222  public_configs = [ ":exported_header_files" ]
223
224  if (defined(module_update_custom_external_deps)) {
225    external_deps = module_update_custom_external_deps
226  }
227
228  part_name = "sys_installer"
229  subsystem_name = "updater"
230}
231
232config("exported_header_files") {
233  visibility = [ ":*" ]
234  include_dirs = [
235    "${sys_installer_path}/services/module_update/util/include",
236    "${sys_installer_path}/interfaces/inner_api/include",
237    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
238    "${target_gen_dir}",
239  ]
240}
241
242ohos_executable("module_update_client") {
243  sources = [ "${sys_installer_path}/services/module_update/service/main.cpp" ]
244
245  include_dirs = [ "./include" ]
246  deps = [ "${sys_installer_path}/interfaces/innerkits/ipc_client:libmodule_update_shared" ]
247  public_configs = [ ":exported_header_files" ]
248
249  external_deps = [
250    "c_utils:utils",
251    "hilog:libhilog",
252    "ipc:ipc_core",
253    "samgr:samgr_proxy",
254    "updater:libupdaterlog",
255  ]
256  install_enable = false
257  part_name = "sys_installer"
258  subsystem_name = "updater"
259}
260
261ohos_static_library("module_update_client_static") {
262  sources = [
263    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_kits_impl.cpp",
264    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_load_callback.cpp",
265    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_proxy.cpp",
266    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
267    "${sys_installer_path}/services/module_update/util/src/module_ipc_helper.cpp",
268    "${target_gen_dir}/sys_installer_callback_stub.cpp",
269    "${target_gen_dir}/types.cpp",
270  ]
271
272  include_dirs = [ "${sys_installer_path}/common/include" ]
273
274  deps = [ ":sysinstaller_interface" ]
275
276  public_configs = [ ":exported_header_files" ]
277
278  public_external_deps = [ "zlib:shared_libz" ]
279
280  external_deps = [
281    "bounds_checking_function:libsec_static",
282    "c_utils:utils",
283    "hilog:libhilog",
284    "init:libbegetutil",
285    "ipc:ipc_core",
286    "samgr:samgr_proxy",
287    "updater:libupdaterlog",
288    "zlib:shared_libz",
289  ]
290
291  part_name = "sys_installer"
292  subsystem_name = "updater"
293}
294
295ohos_shared_library("libmodule_update_shared") {
296  sources = [
297    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_kits_impl.cpp",
298    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_load_callback.cpp",
299    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_proxy.cpp",
300    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
301    "${sys_installer_path}/services/module_update/util/src/module_ipc_helper.cpp",
302    "${target_gen_dir}/sys_installer_callback_stub.cpp",
303    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/buffer_info_parcel.cpp",
304    "${target_gen_dir}/types.cpp",
305  ]
306
307  include_dirs = [ "${sys_installer_path}/common/include" ]
308
309  deps = [ ":sysinstaller_interface" ]
310
311  public_configs = [ ":exported_header_files" ]
312
313  public_external_deps = [ "zlib:shared_libz" ]
314
315  external_deps = [
316    "bounds_checking_function:libsec_static",
317    "c_utils:utils",
318    "hilog:libhilog",
319    "init:libbegetutil",
320    "ipc:ipc_core",
321    "samgr:samgr_proxy",
322    "updater:libupdaterlog",
323    "zlib:shared_libz",
324  ]
325
326  if (!is_linux && !is_mingw && !is_mac && ohos_indep_compiler_enable) {
327    external_deps += [ "hilog:libhilog_base", ]
328  }
329
330  innerapi_tags = [
331    "platformsdk",
332    "sasdk",
333  ]
334
335  part_name = "sys_installer"
336  subsystem_name = "updater"
337}
338