• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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.
13import("//build/ohos.gni")
14import("//build/ohos_var.gni")
15import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni")
16
17group("build_module") {
18  deps = [ ":distributeddataservice" ]
19  if (build_public_version) {
20    deps += [ ":distributeddata_profile" ]
21    deps += [ ":distributed_data.cfg" ]
22  }
23}
24
25ohos_prebuilt_etc("distributed_data.cfg") {
26  source = "distributed_data.cfg"
27  relative_install_dir = "init"
28  subsystem_name = "distributeddatamgr"
29  part_name = "datamgr_service"
30}
31
32ohos_sa_profile("distributeddata_profile") {
33  sources = [ "../sa_profile/1301.json" ]
34
35  part_name = "datamgr_service"
36}
37
38config("module_private_config") {
39  visibility = [ ":*" ]
40  include_dirs = [
41    "${kv_store_common_path}",
42    "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include",
43    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/bootstrap/include",
44    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/config/include",
45    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/crypto/include",
46    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/directory/include",
47    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/permission/include",
48    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/matrix/include",
49    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/session_manager",
50    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework/include",
51    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/backup/include",
52    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/kvdb",
53    "${device_manager_path}/interfaces/inner_kits/native_cpp/include",
54    "${distributedfilejs_path}/interfaces/kits/js/src/mod_securitylabel",
55    "../adapter/include/account",
56    "../adapter/include/permission",
57    "../adapter/include/uninstaller",
58    "../adapter/include/broadcaster",
59    "../adapter/include/utils",
60    "../adapter/include/dfx",
61    "../adapter/include",
62
63    # for ipc_core interfaces.
64    "include",
65    "src",
66    "src/security",
67    "src/backup_rule/include",
68    "//third_party/json/single_include",
69  ]
70
71  cflags = [ "-Wno-multichar" ]
72
73  cflags_cc = [ "-fvisibility=hidden" ]
74}
75
76ohos_shared_library("distributeddataservice") {
77  sources = [
78    "src/dump_helper.cpp",
79    "src/feature_stub_impl.cpp",
80    "src/kvstore_account_observer.cpp",
81    "src/kvstore_data_service.cpp",
82    "src/kvstore_device_listener.cpp",
83    "src/kvstore_meta_manager.cpp",
84    "src/security/security.cpp",
85    "src/security/sensitive.cpp",
86    "src/session_manager/route_head_handler_impl.cpp",
87    "src/session_manager/session_manager.cpp",
88    "src/session_manager/upgrade_manager.cpp",
89    "src/task_manager.cpp",
90  ]
91
92  if (datamgr_service_power) {
93    variable_sources = [
94      "src/backup_rule/src/charging.cpp",
95      "src/backup_rule/src/screen_off.cpp",
96    ]
97    sources += variable_sources
98  }
99
100  configs = [ ":module_private_config" ]
101  deps = [
102    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter",
103    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/broadcaster:distributeddata_broadcaster_static",
104    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/utils:distributeddata_utils_static",
105    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/checker:distributeddata_checker_static",
106    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/flowctrl_manager:distributeddata_flowctrl_static",
107    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/uninstaller:distributeddata_uninstaller_static",
108    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk",
109    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service:distributeddatasvc",
110  ]
111
112  external_deps = [
113    "ability_base:base",
114    "ability_base:want",
115    "access_token:libaccesstoken_sdk",
116    "bundle_framework:appexecfwk_base",
117    "bundle_framework:appexecfwk_core",
118    "c_utils:utils",
119    "dataclassification:data_transit_mgr",
120    "hilog:libhilog",
121    "hisysevent:libhisysevent",
122    "hitrace:hitrace_meter",
123    "hitrace:libhitracechain",
124    "ipc:ipc_core",
125    "kv_store:distributeddata_inner",
126    "kv_store:distributeddb",
127    "safwk:system_ability_fwk",
128    "samgr:samgr_proxy",
129  ]
130
131  if (datamgr_service_power) {
132    external_deps += [
133      "battery_manager:batterysrv_client",
134      "power_manager:powermgr_client",
135    ]
136    defines = [ "SUPPORT_POWER" ]
137  }
138
139  subsystem_name = "distributeddatamgr"
140  part_name = "datamgr_service"
141  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
142}
143