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/config/components/idl_tool/idl.gni") 15import("//build/ohos.gni") 16import("//foundation/resourceschedule/background_task_mgr/bgtaskmgr.gni") 17 18idl_gen_interface("background_task_mgr_interface") { 19 src_idl = rebase_path("IBackgroundTaskMgr.idl") 20 log_domainid = "0xD001711" 21 log_tag = "IBackgroundTaskMgr" 22} 23 24idl_gen_interface("background_task_subscriber_interface") { 25 src_idl = rebase_path("IBackgroundTaskSubscriber.idl") 26 log_domainid = "0xD001711" 27 log_tag = "IBackgroundTaskSubscriber" 28} 29 30idl_gen_interface("expired_callback_interface") { 31 src_idl = rebase_path("IExpiredCallback.idl") 32 log_domainid = "0xD001711" 33 log_tag = "IExpiredCallback" 34} 35 36config("bgtaskmgr_innerkits_public_config") { 37 include_dirs = [ 38 "include", 39 "${target_gen_dir}", 40 "${bgtaskmgr_frameworks_path}/common/include", 41 "${bgtaskmgr_frameworks_path}/include", 42 ] 43} 44 45ohos_shared_library("bgtaskmgr_innerkits") { 46 branch_protector_ret = "pac_ret" 47 sanitize = { 48 cfi = true 49 cfi_cross_dso = true 50 debug = false 51 } 52 53 deps = [ 54 ":background_task_mgr_interface", 55 ":background_task_subscriber_interface", 56 ":expired_callback_interface", 57 ] 58 59 sources = [ 60 "${bgtaskmgr_frameworks_path}/src/background_task_manager.cpp", 61 "src/background_task_mgr_helper.cpp", 62 "src/background_task_subscriber.cpp", 63 "src/continuous_task_callback_info.cpp", 64 "src/continuous_task_param.cpp", 65 "src/delay_suspend_info.cpp", 66 "src/efficiency_resource_info.cpp", 67 "src/expired_callback.cpp", 68 "src/resource_callback_info.cpp", 69 "src/resource_type.cpp", 70 "src/transient_task_app_info.cpp", 71 ] 72 73 output_values = get_target_outputs(":background_task_mgr_interface") 74 sources += filter_include(output_values, 75 [ 76 "*_proxy.cpp", 77 "*_stub.cpp", 78 ]) 79 80 subscriber_output_values = 81 get_target_outputs(":background_task_subscriber_interface") 82 sources += filter_include(subscriber_output_values, 83 [ 84 "*_proxy.cpp", 85 "*_stub.cpp", 86 ]) 87 88 expired_callback_output_values = 89 get_target_outputs(":expired_callback_interface") 90 sources += filter_include(expired_callback_output_values, 91 [ 92 "*_proxy.cpp", 93 "*_stub.cpp", 94 ]) 95 96 public_configs = [ ":bgtaskmgr_innerkits_public_config" ] 97 98 external_deps = [ 99 "ability_runtime:wantagent_innerkits", 100 "c_utils:utils", 101 "common_event_service:cesfwk_innerkits", 102 "hilog:libhilog", 103 "hitrace:hitrace_meter", 104 "ipc:ipc_core", 105 "ipc:ipc_single", 106 "samgr:samgr_proxy", 107 ] 108 109 public_external_deps = [ "json:nlohmann_json_static" ] 110 111 subsystem_name = "resourceschedule" 112 part_name = "background_task_mgr" 113 innerapi_tags = [ "platformsdk" ] 114 version_script = "libbgtaskmgr_innerkits.versionscript" 115} 116 117ohos_source_set("background_task_mgr_stub") { 118 branch_protector_ret = "pac_ret" 119 sanitize = { 120 cfi = true 121 cfi_cross_dso = true 122 debug = false 123 } 124 output_values = get_target_outputs(":background_task_mgr_interface") 125 sources = filter_include(output_values, [ "*_stub.cpp" ]) 126 public_configs = [ ":bgtaskmgr_innerkits_public_config" ] 127 deps = [ ":background_task_mgr_interface" ] 128 subsystem_name = "resourceschedule" 129 part_name = "background_task_mgr" 130 external_deps = [ 131 "ability_runtime:wantagent_innerkits", 132 "c_utils:utils", 133 "hilog:libhilog", 134 "ipc:ipc_core", 135 "ipc:ipc_single", 136 "samgr:samgr_proxy", 137 ] 138} 139 140ohos_source_set("background_task_mgr_proxy") { 141 branch_protector_ret = "pac_ret" 142 sanitize = { 143 cfi = true 144 cfi_cross_dso = true 145 debug = false 146 } 147 output_values = get_target_outputs(":background_task_mgr_interface") 148 sources = filter_include(output_values, [ "*_proxy.cpp" ]) 149 public_configs = [ ":bgtaskmgr_innerkits_public_config" ] 150 deps = [ ":background_task_mgr_interface" ] 151 subsystem_name = "resourceschedule" 152 part_name = "background_task_mgr" 153 external_deps = [ 154 "ability_runtime:wantagent_innerkits", 155 "c_utils:utils", 156 "hilog:libhilog", 157 "ipc:ipc_core", 158 "ipc:ipc_single", 159 "samgr:samgr_proxy", 160 ] 161} 162 163ohos_source_set("background_task_subscriber_stub") { 164 branch_protector_ret = "pac_ret" 165 sanitize = { 166 cfi = true 167 cfi_cross_dso = true 168 debug = false 169 } 170 output_values = get_target_outputs(":background_task_subscriber_interface") 171 sources = filter_include(output_values, [ "*_stub.cpp" ]) 172 public_configs = [ ":bgtaskmgr_innerkits_public_config" ] 173 deps = [ ":background_task_subscriber_interface" ] 174 subsystem_name = "resourceschedule" 175 part_name = "background_task_mgr" 176 external_deps = [ 177 "ability_runtime:wantagent_innerkits", 178 "c_utils:utils", 179 "hilog:libhilog", 180 "ipc:ipc_core", 181 "ipc:ipc_single", 182 "samgr:samgr_proxy", 183 ] 184} 185 186ohos_source_set("background_task_subscriber_proxy") { 187 branch_protector_ret = "pac_ret" 188 sanitize = { 189 cfi = true 190 cfi_cross_dso = true 191 debug = false 192 } 193 output_values = get_target_outputs(":background_task_subscriber_interface") 194 sources = filter_include(output_values, [ "*_proxy.cpp" ]) 195 public_configs = [ ":bgtaskmgr_innerkits_public_config" ] 196 deps = [ ":background_task_subscriber_interface" ] 197 subsystem_name = "resourceschedule" 198 part_name = "background_task_mgr" 199 external_deps = [ 200 "ability_runtime:wantagent_innerkits", 201 "c_utils:utils", 202 "hilog:libhilog", 203 "ipc:ipc_core", 204 "ipc:ipc_single", 205 "samgr:samgr_proxy", 206 ] 207} 208 209ohos_source_set("expired_callback_stub") { 210 branch_protector_ret = "pac_ret" 211 sanitize = { 212 cfi = true 213 cfi_cross_dso = true 214 debug = false 215 } 216 output_values = get_target_outputs(":expired_callback_interface") 217 sources = filter_include(output_values, [ "*_stub.cpp" ]) 218 public_configs = [ ":bgtaskmgr_innerkits_public_config" ] 219 deps = [ ":expired_callback_interface" ] 220 subsystem_name = "resourceschedule" 221 part_name = "background_task_mgr" 222 external_deps = [ 223 "ability_runtime:wantagent_innerkits", 224 "c_utils:utils", 225 "hilog:libhilog", 226 "ipc:ipc_core", 227 "ipc:ipc_single", 228 "samgr:samgr_proxy", 229 ] 230} 231 232ohos_source_set("expired_callback_proxy") { 233 branch_protector_ret = "pac_ret" 234 sanitize = { 235 cfi = true 236 cfi_cross_dso = true 237 debug = false 238 } 239 output_values = get_target_outputs(":expired_callback_interface") 240 sources = filter_include(output_values, [ "*_proxy.cpp" ]) 241 public_configs = [ ":bgtaskmgr_innerkits_public_config" ] 242 deps = [ ":expired_callback_interface" ] 243 subsystem_name = "resourceschedule" 244 part_name = "background_task_mgr" 245 external_deps = [ 246 "ability_runtime:wantagent_innerkits", 247 "c_utils:utils", 248 "hilog:libhilog", 249 "ipc:ipc_core", 250 "ipc:ipc_single", 251 "samgr:samgr_proxy", 252 ] 253} 254