• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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("//build/ohos_var.gni")
16import("//foundation/ability/dmsfwk/dmsfwk.gni")
17
18group("unittest") {
19  testonly = true
20  deps = [ "test:unittest" ]
21}
22
23config("distributed_sched_config") {
24  visibility = [ ":*" ]
25  visibility += [ "./test/*" ]
26  include_dirs = [
27    "include",
28    "${communication_path}/dsoftbus/dsoftbus_enhance/interfaces/kits/broadcast",
29    "${communication_path}/dsoftbus/interfaces/kits/common",
30    "${dms_path}/interfaces/kits/napi/include",
31    "${dms_path}/interfaces/innerkits/common/include",
32    "include/distributedWant",
33    "//third_party/cJSON",
34  ]
35  defines = []
36  if (dmsfwk_mission_manager) {
37    defines += [ "SUPPORT_DISTRIBUTED_MISSION_MANAGER" ]
38  }
39  if (dmsfwk_report_memmgr || dmsfwk_report_memmgr_plugins) {
40    defines += [ "SUPPORT_DISTRIBUTEDCOMPONENT_TO_MEMMGR" ]
41  }
42  if (dmsfwk_standard_form_share) {
43    defines += [ "SUPPORT_DISTRIBUTED_FORM_SHARE" ]
44  }
45  if (efficiency_manager_service_enable) {
46    defines += [ "EFFICIENCY_MANAGER_ENABLE" ]
47  }
48  if (dmsfwk_service_disable) {
49    defines += [ "DMS_SERVICE_DISABLE" ]
50  }
51  if (os_account_part) {
52    defines += [ "OS_ACCOUNT_PART" ]
53  }
54  if (dmsfwk_ces_listener) {
55    defines += [ "SUPPORT_COMMON_EVENT_SERVICE" ]
56  }
57  if (dmsfwk_mmi_listener) {
58    defines += [ "SUPPORT_MULTIMODALINPUT_SERVICE" ]
59  }
60}
61
62ohos_shared_library("distributedschedsvr") {
63  branch_protector_ret = "pac_ret"
64  sanitize = {
65    cfi = true
66    cfi_cross_dso = true
67    debug = false
68  }
69
70  install_enable = true
71  sources = [
72    "src/ability_connection_wrapper_proxy.cpp",
73    "src/ability_connection_wrapper_stub.cpp",
74    "src/adapter/dnetwork_adapter.cpp",
75    "src/app_state_observer.cpp",
76    "src/bundle/bundle_manager_callback_stub.cpp",
77    "src/bundle/bundle_manager_internal.cpp",
78    "src/connect_death_recipient.cpp",
79    "src/deviceManager/dms_device_info.cpp",
80    "src/dfx/dms_hisysevent_report.cpp",
81    "src/dfx/dms_hitrace_chain.cpp",
82    "src/distributedWant/distributed_operation.cpp",
83    "src/distributedWant/distributed_operation_builder.cpp",
84    "src/distributedWant/distributed_want.cpp",
85    "src/distributedWant/distributed_want_params.cpp",
86    "src/distributedWant/distributed_want_params_wrapper.cpp",
87    "src/distributed_device_node_listener.cpp",
88    "src/distributed_event_died_listener.cpp",
89    "src/distributed_sched_adapter.cpp",
90    "src/distributed_sched_continuation.cpp",
91    "src/distributed_sched_dumper.cpp",
92    "src/distributed_sched_permission.cpp",
93    "src/distributed_sched_proxy.cpp",
94    "src/distributed_sched_service.cpp",
95    "src/distributed_sched_stub.cpp",
96    "src/dms_callback_task.cpp",
97    "src/dms_free_install_callback.cpp",
98    "src/dms_free_install_callback_proxy.cpp",
99    "src/dms_free_install_callback_stub.cpp",
100    "src/dms_token_callback.cpp",
101    "src/dms_version_manager.cpp",
102    "src/dtbschedmgr_device_info_storage.cpp",
103  ]
104
105  if (!dmsfwk_softbus_adapter_common) {
106    sources += [ "src/softbus_adapter/softbus_adapter.cpp" ]
107  } else {
108    sources += [ "src/softbus_adapter/softbus_adapter_common.cpp" ]
109  }
110
111  configs = [
112    ":distributed_sched_config",
113    "//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
114  ]
115
116  deps = [ "//third_party/cJSON:cjson" ]
117
118  external_deps = [
119    "ability_base:base",
120    "ability_base:want",
121    "ability_base:zuri",
122    "ability_runtime:ability_manager",
123    "ability_runtime:app_manager",
124    "ability_runtime:mission_info",
125    "access_token:libaccesstoken_sdk",
126    "bundle_framework:appexecfwk_base",
127    "bundle_framework:appexecfwk_core",
128    "c_utils:utils",
129    "device_auth:deviceauth_sdk",
130    "device_info_manager:distributed_device_profile_common",
131    "device_info_manager:distributed_device_profile_sdk",
132    "device_manager:devicemanagersdk",
133    "device_security_level:dslm_sdk",
134    "distributed_bundle_framework:dbms_fwk",
135    "dsoftbus:softbus_client",
136    "eventhandler:libeventhandler",
137    "hilog:libhilog",
138    "hisysevent:libhisysevent",
139    "hitrace:hitrace_meter",
140    "hitrace:libhitracechain",
141    "init:libbegetutil",
142    "ipc:ipc_core",
143    "kv_store:distributeddata_inner",
144    "safwk:system_ability_fwk",
145    "samgr:samgr_proxy",
146  ]
147  if (os_account_part) {
148    external_deps += [ "os_account:os_account_innerkits" ]
149  }
150
151  if (efficiency_manager_service_enable) {
152    external_deps += [ "efficiency_manager:suspend_manager_client" ]
153  }
154
155  if (dmsfwk_standard_form_share) {
156    external_deps += [ "form_fwk:form_manager" ]
157    sources += [ "src/form_mgr_death_recipient.cpp" ]
158  }
159
160  if (dmsfwk_mission_manager) {
161    sources += [
162      "src/mission/distributed_data_change_listener.cpp",
163      "src/mission/distributed_data_storage.cpp",
164      "src/mission/distributed_mission_broadcast_listener.cpp",
165      "src/mission/distributed_mission_change_listener.cpp",
166      "src/mission/distributed_mission_died_listener.cpp",
167      "src/mission/distributed_mission_focused_listener.cpp",
168      "src/mission/distributed_mission_info.cpp",
169      "src/mission/distributed_sched_mission_manager.cpp",
170      "src/mission/dms_continue_recv_manager.cpp",
171      "src/mission/dms_continue_send_manager.cpp",
172      "src/mission/kvstore_death_recipient.cpp",
173      "src/mission/mission_changed_notify.cpp",
174      "src/mission/mission_info_converter.cpp",
175      "src/mission/snapshot.cpp",
176      "src/mission/snapshot_converter.cpp",
177    ]
178    external_deps += [ "image_framework:image_native" ]
179  }
180
181  if (dmsfwk_report_memmgr) {
182    external_deps += [ "memmgr:memmgrclient" ]
183  }
184
185  if (dmsfwk_report_memmgr_plugins) {
186    external_deps += [ "memmgr_plugin:memmgrclient" ]
187  }
188
189  if (dmsfwk_ces_listener) {
190    external_deps += [ "common_event_service:cesfwk_innerkits" ]
191    sources += [ "src/common_event_listener.cpp" ]
192  }
193
194  if (dmsfwk_mmi_listener) {
195    external_deps += [ "input:libmmi-client" ]
196    sources += [ "src/adapter/mmi_adapter.cpp" ]
197  } else {
198    sources += [ "src/adapter/mmi_adapter_common.cpp" ]
199  }
200
201  install_images = [ system_base_dir ]
202  relative_install_dir = "platformsdk"
203  part_name = "dmsfwk"
204  subsystem_name = "ability"
205}
206