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("//build/ohos.gni") 15 16init_feature_ab_partition = true 17declare_args() { 18 updater_cfg_file = "" 19 updater_ui_support = true 20 if (!defined(global_parts_info.arkui_ui_lite)) { 21 updater_ui_support = false 22 } 23 updater_hdc_depend = true 24 updater_absolutely_path = "//base/update/updater" 25 hdc_base = "//developtools/hdc" 26 updater_sign_on_server = false 27 updater_zlib_enable = true 28 29 if (defined(global_parts_info) && 30 !defined(global_parts_info.third_party_zlib)) { 31 updater_zlib_enable = false 32 } 33} 34 35if (updater_cfg_file != "") { 36 updater_sign_on_server = true 37 import("${updater_cfg_file}") 38} 39 40template("updater_gen") { 41 if (updater_cfg_file != "") { 42 ohos_source_set(target_name) { 43 forward_variables_from(invoker, "*") 44 } 45 } else { 46 ohos_executable(target_name) { 47 if (!is_asan && !is_emulator && target_name == "updater_binary" && !ohos_indep_compiler_enable) { 48 static_link = true 49 } 50 forward_variables_from(invoker, "*") 51 52 install_images = [ "updater" ] 53 install_enable = true 54 } 55 } 56} 57