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 = false
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}
28
29if (updater_cfg_file != "") {
30  updater_sign_on_server = true
31  import("${updater_cfg_file}")
32}
33
34template("updater_gen") {
35  if (updater_cfg_file != "") {
36    ohos_source_set(target_name) {
37      forward_variables_from(invoker, "*")
38    }
39  } else {
40    ohos_executable(target_name) {
41      if (!is_asan && !is_emulator && target_name == "updater_binary") {
42        static_link = true
43      }
44      forward_variables_from(invoker, "*")
45
46      install_images = [ "updater" ]
47      install_enable = true
48    }
49  }
50}
51