diff --git a/services/ui/BUILD.gn b/services/ui/BUILD.gn index 5eb07f06e7ee7946e2e52372d3cb9de5ef12240c..e465e142b19932539b3885a7293bed5931557c84 100644 --- a/services/ui/BUILD.gn +++ b/services/ui/BUILD.gn @@ -38,6 +38,19 @@ config("updater_ui_support_cfg") { } } +if (defined(updater_ui_extend_cfg)) { + action("copy_ui_extend_cfg") { + script = "copy_ui_extend_cfg.py" + updater_ui_extend_cfg_target_path = "${target_gen_dir}/" + updater_ui_extend_cfg_name + sources = [ updater_ui_extend_cfg ] + outputs = [ "${target_gen_dir}/test.txt" ] + args = [ + rebase_path(updater_ui_extend_cfg, "."), + rebase_path(updater_ui_extend_cfg_target_path, "."), + ] + } +} + ohos_static_library("libui") { public_configs = [ ":updater_ui_support_cfg" ] @@ -97,6 +110,12 @@ ohos_static_library("libui") { "${updater_path}/utils:libutils", ] + if (defined(updater_ui_extend_cfg)) { + deps += [ "${updater_path}/services/ui:copy_ui_extend_cfg" ] + updater_ui_extend_cfg_target_path = "${target_gen_dir}/" + updater_ui_extend_cfg_name + include_dirs += [ updater_ui_extend_cfg_target_path ] + } + external_deps = [ "bounds_checking_function:libsec_static", "cJSON:cjson", @@ -118,10 +137,6 @@ ohos_static_library("libui") { external_deps += updater_ui_custom_deps } - if (defined(updater_ui_custom_cfg)) { - public_configs += updater_ui_custom_cfg - } - subsystem_name = "updater" part_name = "updater" } diff --git a/services/ui/copy_ui_extend_cfg.py b/services/ui/copy_ui_extend_cfg.py new file mode 100644 index 0000000000000000000000000000000000000000..f109ea6eaea7cdea64d61a1258a1642d34ed18fa --- /dev/null +++ b/services/ui/copy_ui_extend_cfg.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import shutil +import sys + +os.chdir(os.path.dirname(__file__)) + +if __name__ == '__main__': + src_path = sys.argv[1] + tgt_path = sys.argv[2] + shutil.copy(src_path, tgt_path) \ No newline at end of file