1# Copyright (c) 2022 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/updateservice/updateengine.gni") 15import("//build/ohos.gni") 16import("$updateengine_root_path/services/core/ability/log/log.gni") 17import("$updateengine_root_path/services/core/ability/sqlite/sqlite.gni") 18import("$updateengine_root_path/services/firmware/firmware.gni") 19import("$updateengine_root_path/services/startup/startup.gni") 20 21declare_args() { 22 ability_ability_base_enable = true 23 if (!defined(global_parts_info.ability_ability_base)) { 24 ability_ability_base_enable = false 25 } 26 27 communication_netmanager_base_enable = true 28 if (!defined(global_parts_info.communication_netmanager_base)) { 29 communication_netmanager_base_enable = false 30 } 31 preference_native_preferences_enable = true 32 if (!defined(global_parts_info.distributeddatamgr_preferences)) { 33 preference_native_preferences_enable = false 34 } 35} 36 37sa_sources = [ 38 "$updateengine_root_path/services/callback/src/update_callback.cpp", 39 "$updateengine_root_path/services/callback/src/update_callback_proxy.cpp", 40 "$updateengine_root_path/services/callback/src/update_callback_stub.cpp", 41 "$updateengine_root_path/services/core/ability/adapter/src/config_parse.cpp", 42 "$updateengine_root_path/services/core/ability/adapter/src/device_adapter.cpp", 43 "$updateengine_root_path/services/core/ability/alarm/src/timer_manager.cpp", 44 "$updateengine_root_path/services/core/ability/status_cache/src/status_cache.cpp", 45 "$updateengine_root_path/services/core/ability/utils/src/file_utils.cpp", 46 "$updateengine_root_path/services/core/ability/utils/src/sha256_utils.cpp", 47 "$updateengine_root_path/services/core/ability/utils/src/time_utils_proxy.cpp", 48 "$updateengine_root_path/services/engine/src/message_parcel_helper.cpp", 49 "$updateengine_root_path/services/engine/src/progress_thread.cpp", 50 "$updateengine_root_path/services/engine/src/update_helper.cpp", 51 "$updateengine_root_path/services/engine/src/update_service.cpp", 52 "$updateengine_root_path/services/engine/src/update_service_cache.cpp", 53 "$updateengine_root_path/services/engine/src/update_service_impl_firmware.cpp", 54 "$updateengine_root_path/services/engine/src/update_service_impl_manager.cpp", 55 "$updateengine_root_path/services/engine/src/update_service_local_updater.cpp", 56 "$updateengine_root_path/services/engine/src/update_service_restorer.cpp", 57 "$updateengine_root_path/services/engine/src/update_service_stub.cpp", 58 "$updateengine_root_path/services/engine/src/update_service_util_hmos.cpp", 59] 60 61if (ability_ability_base_enable || ability_ability_runtime_enable) { 62 sa_sources += [ 63 "$updateengine_root_path/services/core/ability/alarm/src/alarm_timer_utils.cpp", 64 "$updateengine_root_path/services/core/ability/callback/src/base_callback_utils.cpp", 65 "$updateengine_root_path/services/engine/src/update_notify.cpp", 66 ] 67} else { 68 sa_sources += [ "$updateengine_root_path/services/core/ability/callback/src/base_callback_utils_empty.cpp" ] 69} 70 71if (communication_netmanager_base_enable) { 72 sa_sources += [ 73 "$updateengine_root_path/services/utils/src/dupdate_net_manager.cpp", 74 "$updateengine_root_path/services/utils/src/dupdate_net_observer.cpp", 75 ] 76} else { 77 sa_sources += [ 78 "$updateengine_root_path/services/utils/src/dupdate_net_manager_empty.cpp", 79 ] 80} 81 82if (preference_native_preferences_enable) { 83 sa_sources += [ "$updateengine_root_path/services/core/ability/preference/src/preference_utils.cpp" ] 84} else { 85 sa_sources += [ "$updateengine_root_path/services/core/ability/preference/src/preference_utils_empty.cpp" ] 86} 87 88sa_sources += firmware_src 89sa_sources += sqlite_src 90sa_sources += update_log_src 91sa_sources += startup_src 92 93sa_include_dirs = [ 94 "$updateengine_root_path/services/auto_update/include", 95 "$updateengine_root_path/services/bi_report/include", 96 "$updateengine_root_path/services/callback/include", 97 "$updateengine_root_path/services/core/ability/adapter/include", 98 "$updateengine_root_path/services/core/ability/alarm/include", 99 "$updateengine_root_path/services/core/ability/callback/include", 100 "$updateengine_root_path/services/core/ability/common/include", 101 "$updateengine_root_path/services/core/ability/define/include", 102 "$updateengine_root_path/services/core/ability/model/include", 103 "$updateengine_root_path/services/core/ability/net/include", 104 "$updateengine_root_path/services/core/ability/preference/include", 105 "$updateengine_root_path/services/core/ability/status_cache/include", 106 "$updateengine_root_path/services/core/ability/utils/include", 107 "$updateengine_root_path/services/engine/include", 108 "$updateengine_root_path/services/osal/include", 109 "$updateengine_root_path/services/service/include", 110 "$updateengine_root_path/services/utils/include", 111 "$updateengine_root_path/interfaces/inner_api/common/include", 112 "$updateengine_root_path/interfaces/inner_api/include", 113 "//base/update/updater/interfaces/kits/include", # package.h/updaterkits.h 114 "//base/update/updater/services/include", # fs_manager/mount.h 115 "//commonlibrary/utils_lite/include", # OHOS_SUCCESS 116 "//third_party/curl/include", 117 "//utils/native/base/include", # sptr 118 "//utils/system/safwk/native/include", 119 "//third_party/libxml2/include", 120 "//third_party/glib/glib", 121 "//third_party/glib", 122 "//third_party/openssl/include", 123 "//third_party/cJSON/", 124] 125 126if (!ability_ability_base_enable || !ability_ability_runtime_enable) { 127 sa_include_dirs += [ 128 "//foundation/ability/ability_base/interfaces/inner_api/base/include", 129 "//foundation/ability/ability_base/interfaces/kits/native/uri/include", 130 "//foundation/ability/ability_base/interfaces/kits/native/want/include", 131 "//foundation/ability/ability_runtime/frameworks/simulator/common/include", 132 "//foundation/ability/ability_runtime/interfaces/inner_api/ability_manager/include", 133 "//foundation/ability/ability_runtime/interfaces/inner_api/app_manager/include/appmgr", 134 "//foundation/ability/ability_runtime/interfaces/kits/native/ability/native", 135 "//foundation/bundlemanager/bundle_framework/interfaces/inner_api/appexecfwk_base/include", 136 ] 137} 138 139if (!preference_native_preferences_enable) { 140 sa_include_dirs += [ 141 "//foundation/distributeddatamgr/preferences/interfaces/inner_api/include", 142 ] 143} 144 145if (!communication_netmanager_base_enable) { 146 sa_include_dirs += [ 147 "//foundation/communication/netmanager_base/interfaces/innerkits/include", 148 "//foundation/communication/netmanager_base/interfaces/innerkits/netconnclient/include", 149 "//foundation/communication/netmanager_base/interfaces/innerkits/netconnclient/include/proxy", 150 ] 151} 152 153if (!relational_store_native_rdb_enable) { 154 sa_include_dirs += [ 155 "//base/update/updateservice/services/core/ability/sqlite/core/include", 156 "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb/include", 157 ] 158} 159 160sa_include_dirs += firmware_include 161sa_include_dirs += sqlite_include 162sa_include_dirs += update_log_include 163sa_include_dirs += startup_include 164sa_include_dirs += 165 [ "//base/update/updateservice/interfaces/innner_api/modulemgr/include" ] 166 167sa_deps = [ 168 "$updateengine_root_path/interfaces/inner_api/modulemgr:update_module_mgr", 169 "//third_party/cJSON:cjson", 170 "//third_party/curl:curl", 171 "//third_party/libxml2:libxml2", 172 "//third_party/mbedtls:mbedtls_shared", 173 "//third_party/openssl:libcrypto_shared", 174 "//third_party/openssl:libssl_shared", 175] 176 177sa_deps += firmware_deps 178sa_deps += update_log_deps 179sa_deps += startup_deps 180 181sa_external_deps = [ 182 "access_token:libaccesstoken_sdk", 183 "access_token:libtokenid_sdk", 184 "c_utils:utils", # refbase 185 "common_event_service:cesfwk_innerkits", 186 "hilog:libhilog", 187 "hisysevent:libhisysevent", 188 "init:libbegetutil", 189 "ipc:ipc_core", 190 "safwk:system_ability_fwk", 191 "samgr:samgr_proxy", 192 "updater:libpackageExt", # "package/package.h" 193 "updater:libupdaterkits", # "updaterkits/updaterkits.h" 194] 195 196if (ability_ability_base_enable) { 197 sa_external_deps += [ 198 "ability_base:base", 199 "ability_base:want", 200 "ability_runtime:wantagent_innerkits", 201 "time_service:time_client", 202 ] 203} 204if (ability_ability_runtime_enable) { 205 sa_external_deps += [ "ability_runtime:ability_manager" ] 206} 207if (communication_netmanager_base_enable) { 208 sa_external_deps += [ "netmanager_base:net_conn_manager_if" ] 209} 210if (preference_native_preferences_enable) { 211 sa_external_deps += [ "preferences:native_preferences" ] 212} 213 214if (ability_ability_runtime_enable) { 215 sa_external_deps += firmware_external_deps 216} 217 218sa_external_deps += sqlite_external_deps 219sa_external_deps += update_log_external_deps 220sa_external_deps += startup_external_deps 221 222sa_public_deps = [] 223sa_public_deps += startup_public_deps 224 225sa_defines = [ 226 "DUAL_ADAPTER", 227 "UPDATE_SERVICE", 228] 229 230if (ability_ability_base_enable) { 231 sa_defines += [ "ABILITY_BASE_ENABLE" ] 232} 233if (ability_ability_runtime_enable) { 234 sa_defines += [ "ABILITY_RUNTIME_ENABLE" ] 235} 236if (communication_netmanager_base_enable) { 237 sa_defines += [ "NETMANAGER_BASE_ENABLE" ] 238} 239if (preference_native_preferences_enable) { 240 sa_defines += [ "NATIVE_PREFERENCES_ENABLE" ] 241} 242sa_defines += sqlite_defines 243 244sa_cflags = [ 245 "-fPIC", 246 "-Os", 247 "-Werror", 248] 249