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") 15import("//foundation/resourceschedule/background_task_mgr/bgtaskmgr.gni") 16 17cflags = [] 18 19config("bgtaskmgr_public_config") { 20 include_dirs = [ "napi/include" ] 21} 22 23ohos_shared_library("backgroundtaskmanager") { 24 sources = [ 25 "napi/src/bg_continuous_task_napi_module.cpp", 26 "napi/src/cancel_suspend_delay.cpp", 27 "napi/src/common.cpp", 28 "napi/src/efficiency_resources_operation.cpp", 29 "napi/src/get_remaining_delay_time.cpp", 30 "napi/src/init.cpp", 31 "napi/src/request_suspend_delay.cpp", 32 ] 33 34 public_configs = [ ":bgtaskmgr_public_config" ] 35 36 deps = [ "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits" ] 37 38 external_deps = [ 39 "ability_base:want", 40 "ability_runtime:ability_context_native", 41 "ability_runtime:abilitykit_native", 42 "ability_runtime:napi_base_context", 43 "ability_runtime:wantagent_innerkits", 44 "bundle_framework:appexecfwk_base", 45 "c_utils:utils", 46 "common_event_service:cesfwk_innerkits", 47 "hilog:libhilog", 48 "ipc:ipc_single", 49 "napi:ace_napi", 50 "samgr:samgr_proxy", 51 ] 52 53 defines = [] 54 if (background_task_mgr_jsstack) { 55 defines += [ "SUPPORT_JSSTACK" ] 56 external_deps += [ "hiview:libxpower_event_js" ] 57 } 58 59 relative_install_dir = "module" 60 subsystem_name = "resourceschedule" 61 part_name = "background_task_mgr" 62} 63 64ohos_shared_library("backgroundtaskmanager_napi") { 65 sources = [ 66 "napi/src/bg_continuous_task_napi_module.cpp", 67 "napi/src/cancel_suspend_delay.cpp", 68 "napi/src/common.cpp", 69 "napi/src/efficiency_resources_operation.cpp", 70 "napi/src/get_remaining_delay_time.cpp", 71 "napi/src/init_bgtaskmgr.cpp", 72 "napi/src/request_suspend_delay.cpp", 73 ] 74 75 public_configs = [ ":bgtaskmgr_public_config" ] 76 77 deps = [ "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits" ] 78 79 external_deps = [ 80 "ability_base:want", 81 "ability_runtime:ability_context_native", 82 "ability_runtime:abilitykit_native", 83 "ability_runtime:napi_base_context", 84 "ability_runtime:wantagent_innerkits", 85 "bundle_framework:appexecfwk_base", 86 "c_utils:utils", 87 "common_event_service:cesfwk_innerkits", 88 "hilog:libhilog", 89 "ipc:ipc_single", 90 "napi:ace_napi", 91 "samgr:samgr_proxy", 92 ] 93 94 defines = [] 95 if (background_task_mgr_jsstack) { 96 defines += [ "SUPPORT_JSSTACK" ] 97 external_deps += [ "hiview:libxpower_event_js" ] 98 } 99 100 relative_install_dir = "module/resourceschedule" 101 subsystem_name = "resourceschedule" 102 part_name = "background_task_mgr" 103} 104