1# Copyright (c) 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("//foundation/resourceschedule/device_standby/standby_service.gni") 15 16config("standby_utils_policy_config") { 17 include_dirs = [ 18 "include", 19 "//third_party/json/single_include", 20 ] 21} 22 23StandbyUtilsPolicy = [ 24 "src/json_utils.cpp", 25 "src/standby_config_manager.cpp", 26] 27 28StandbyUtilsPolicyExternalDeps = [ 29 "c_utils:utils", 30 "hilog:libhilog", 31 "ipc:ipc_single", 32] 33 34ohos_shared_library("standby_utils_policy") { 35 sources = StandbyUtilsPolicy 36 37 public_configs = [ ":standby_utils_policy_config" ] 38 39 deps = [ "${standby_utils_common_path}:standby_utils_common" ] 40 41 external_deps = StandbyUtilsPolicyExternalDeps 42 43 defines = [] 44 if (enable_standby_configpolicy) { 45 external_deps += [ "config_policy:configpolicy_util" ] 46 defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ] 47 } 48 49 subsystem_name = "resourceschedule" 50 part_name = "${standby_service_part_name}" 51 version_script = "libstandby_utils_policy.versionscript" 52} 53 54ohos_static_library("standby_utils_policy_static") { 55 sources = StandbyUtilsPolicy 56 57 public_configs = [ ":standby_utils_policy_config" ] 58 59 deps = [ "${standby_utils_common_path}:standby_utils_common" ] 60 61 external_deps = StandbyUtilsPolicyExternalDeps 62 63 defines = [] 64 if (enable_standby_configpolicy) { 65 external_deps += [ "config_policy:configpolicy_util" ] 66 defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ] 67 } 68 69 subsystem_name = "resourceschedule" 70 part_name = "${standby_service_part_name}" 71} 72 73ohos_prebuilt_etc("stancby_service_policy_config_device_standby") { 74 source = "configs/device_standby_config.json" 75 install_enable = true 76 subsystem_name = "resourceschedule" 77 part_name = "${standby_service_part_name}" 78 module_install_dir = "etc/standby_service" 79} 80 81ohos_prebuilt_etc("stancby_service_policy_config_resource_config") { 82 source = "configs/standby_strategy_config.json" 83 install_enable = true 84 subsystem_name = "resourceschedule" 85 part_name = "${standby_service_part_name}" 86 module_install_dir = "etc/standby_service" 87} 88 89group("standby_service_config") { 90 deps = [ 91 ":stancby_service_policy_config_device_standby", 92 ":stancby_service_policy_config_resource_config", 93 ] 94} 95