1816fd32cSopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd.
2816fd32cSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3816fd32cSopenharmony_ci# you may not use this file except in compliance with the License.
4816fd32cSopenharmony_ci# You may obtain a copy of the License at
5816fd32cSopenharmony_ci#
6816fd32cSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7816fd32cSopenharmony_ci#
8816fd32cSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9816fd32cSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10816fd32cSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11816fd32cSopenharmony_ci# See the License for the specific language governing permissions and
12816fd32cSopenharmony_ci# limitations under the License.
13816fd32cSopenharmony_ci
14816fd32cSopenharmony_ciimport("//build/ohos.gni")
15816fd32cSopenharmony_ciimport("//foundation/distributeddatamgr/data_share/datashare.gni")
16816fd32cSopenharmony_ci
17816fd32cSopenharmony_ciconfig("ability_config") {
18816fd32cSopenharmony_ci  visibility = [ ":*" ]
19816fd32cSopenharmony_ci  include_dirs = [
20816fd32cSopenharmony_ci    "common/include",
21816fd32cSopenharmony_ci    "consumer/include",
22816fd32cSopenharmony_ci    "provider/include",
23816fd32cSopenharmony_ci    "${datashare_native_consumer_path}/include",
24816fd32cSopenharmony_ci    "${datashare_native_provider_path}/include",
25816fd32cSopenharmony_ci    "${datashare_native_proxy_path}/include",
26816fd32cSopenharmony_ci  ]
27816fd32cSopenharmony_ci
28816fd32cSopenharmony_ci  cflags = []
29816fd32cSopenharmony_ci  if (target_cpu == "arm") {
30816fd32cSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
31816fd32cSopenharmony_ci  }
32816fd32cSopenharmony_ci}
33816fd32cSopenharmony_ci
34816fd32cSopenharmony_ciconfig("datashare_public_config") {
35816fd32cSopenharmony_ci  visibility = [ ":*" ]
36816fd32cSopenharmony_ci  include_dirs = [
37816fd32cSopenharmony_ci    "common/include",
38816fd32cSopenharmony_ci    "consumer/include",
39816fd32cSopenharmony_ci    "provider/include",
40816fd32cSopenharmony_ci    "${datashare_common_native_path}/include",
41816fd32cSopenharmony_ci    "${datashare_native_consumer_path}/controller/common",
42816fd32cSopenharmony_ci    "${datashare_native_consumer_path}/controller/provider/include",
43816fd32cSopenharmony_ci    "${datashare_native_consumer_path}/controller/service/include",
44816fd32cSopenharmony_ci    "${datashare_native_consumer_path}/include",
45816fd32cSopenharmony_ci    "${datashare_native_provider_path}/include",
46816fd32cSopenharmony_ci    "${datashare_native_proxy_path}/include",
47816fd32cSopenharmony_ci  ]
48816fd32cSopenharmony_ci}
49816fd32cSopenharmony_ci
50816fd32cSopenharmony_cidatashare_consumer_sources = [
51816fd32cSopenharmony_ci  "${datashare_common_native_path}/src/call_reporter.cpp",
52816fd32cSopenharmony_ci  "${datashare_common_native_path}/src/datashare_string_utils.cpp",
53816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/controller/provider/src/ext_special_controller.cpp",
54816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/controller/provider/src/general_controller_provider_impl.cpp",
55816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/controller/service/src/general_controller_service_impl.cpp",
56816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/controller/service/src/persistent_data_controller.cpp",
57816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/controller/service/src/published_data_controller.cpp",
58816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/src/datashare_connection.cpp",
59816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/src/datashare_helper.cpp",
60816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/src/datashare_helper_impl.cpp",
61816fd32cSopenharmony_ci  "${datashare_native_consumer_path}/src/datashare_proxy.cpp",
62816fd32cSopenharmony_ci  "${datashare_native_proxy_path}/src/ams_mgr_proxy.cpp",
63816fd32cSopenharmony_ci  "${datashare_native_proxy_path}/src/data_proxy_observer_stub.cpp",
64816fd32cSopenharmony_ci  "${datashare_native_proxy_path}/src/data_share_manager_impl.cpp",
65816fd32cSopenharmony_ci  "${datashare_native_proxy_path}/src/data_share_service_proxy.cpp",
66816fd32cSopenharmony_ci  "${datashare_native_proxy_path}/src/idata_share_client_death_observer.cpp",
67816fd32cSopenharmony_ci  "${datashare_native_proxy_path}/src/published_data_subscriber_manager.cpp",
68816fd32cSopenharmony_ci  "${datashare_native_proxy_path}/src/rdb_subscriber_manager.cpp",
69816fd32cSopenharmony_ci]
70816fd32cSopenharmony_ci
71816fd32cSopenharmony_cidatashare_consumer_external_deps = [
72816fd32cSopenharmony_ci  "ability_base:want",
73816fd32cSopenharmony_ci  "ability_base:zuri",
74816fd32cSopenharmony_ci  "ability_runtime:app_context",
75816fd32cSopenharmony_ci  "ability_runtime:extension_manager",
76816fd32cSopenharmony_ci  "c_utils:utils",
77816fd32cSopenharmony_ci  "common_event_service:cesfwk_innerkits",
78816fd32cSopenharmony_ci  "hilog:libhilog",
79816fd32cSopenharmony_ci  "hisysevent:libhisysevent",
80816fd32cSopenharmony_ci  "hitrace:hitrace_meter",
81816fd32cSopenharmony_ci  "hitrace:libhitracechain",
82816fd32cSopenharmony_ci  "ipc:ipc_single",
83816fd32cSopenharmony_ci  "ipc:rpc",
84816fd32cSopenharmony_ci  "samgr:samgr_proxy",
85816fd32cSopenharmony_ci]
86816fd32cSopenharmony_ci
87816fd32cSopenharmony_ciconfig("permission_config") {
88816fd32cSopenharmony_ci  visibility = [ ":*" ]
89816fd32cSopenharmony_ci  include_dirs = [
90816fd32cSopenharmony_ci    "common/include",
91816fd32cSopenharmony_ci    "permission/include",
92816fd32cSopenharmony_ci    "${datashare_common_native_path}/include",
93816fd32cSopenharmony_ci    "${datashare_native_permission_path}/include",
94816fd32cSopenharmony_ci  ]
95816fd32cSopenharmony_ci}
96816fd32cSopenharmony_ci
97816fd32cSopenharmony_ciconfig("permission_public_config") {
98816fd32cSopenharmony_ci  visibility = [ ":*" ]
99816fd32cSopenharmony_ci  include_dirs = [
100816fd32cSopenharmony_ci    "common/include",
101816fd32cSopenharmony_ci    "permission/include",
102816fd32cSopenharmony_ci  ]
103816fd32cSopenharmony_ci}
104816fd32cSopenharmony_ci
105816fd32cSopenharmony_ciohos_shared_library("datashare_consumer") {
106816fd32cSopenharmony_ci  branch_protector_ret = "pac_ret"
107816fd32cSopenharmony_ci  sanitize = {
108816fd32cSopenharmony_ci    ubsan = true
109816fd32cSopenharmony_ci    boundary_sanitize = true
110816fd32cSopenharmony_ci    cfi = true
111816fd32cSopenharmony_ci    cfi_cross_dso = true
112816fd32cSopenharmony_ci    debug = false
113816fd32cSopenharmony_ci  }
114816fd32cSopenharmony_ci  include_dirs = [ "${datashare_common_native_path}/include" ]
115816fd32cSopenharmony_ci
116816fd32cSopenharmony_ci  sources = datashare_consumer_sources
117816fd32cSopenharmony_ci  configs = [ ":ability_config" ]
118816fd32cSopenharmony_ci  public_configs = [ ":datashare_public_config" ]
119816fd32cSopenharmony_ci  version_script = "consumer/libdatashare_consumer.map"
120816fd32cSopenharmony_ci  innerapi_tags = [
121816fd32cSopenharmony_ci    "platformsdk",
122816fd32cSopenharmony_ci    "sasdk",
123816fd32cSopenharmony_ci  ]
124816fd32cSopenharmony_ci  deps = [ "${datashare_innerapi_path}/common:datashare_common" ]
125816fd32cSopenharmony_ci
126816fd32cSopenharmony_ci  external_deps = datashare_consumer_external_deps
127816fd32cSopenharmony_ci  external_deps += [ "ability_runtime:ability_connect_callback_stub" ]
128816fd32cSopenharmony_ci
129816fd32cSopenharmony_ci  public_external_deps = [
130816fd32cSopenharmony_ci    "ability_runtime:dataobs_manager",
131816fd32cSopenharmony_ci    "kv_store:distributeddata_inner",
132816fd32cSopenharmony_ci  ]
133816fd32cSopenharmony_ci
134816fd32cSopenharmony_ci  subsystem_name = "distributeddatamgr"
135816fd32cSopenharmony_ci  part_name = "data_share"
136816fd32cSopenharmony_ci}
137816fd32cSopenharmony_ci
138816fd32cSopenharmony_ciohos_shared_library("datashare_permission") {
139816fd32cSopenharmony_ci  branch_protector_ret = "pac_ret"
140816fd32cSopenharmony_ci  sanitize = {
141816fd32cSopenharmony_ci    ubsan = true
142816fd32cSopenharmony_ci    boundary_sanitize = true
143816fd32cSopenharmony_ci    cfi = true
144816fd32cSopenharmony_ci    cfi_cross_dso = true
145816fd32cSopenharmony_ci    debug = false
146816fd32cSopenharmony_ci  }
147816fd32cSopenharmony_ci  include_dirs = []
148816fd32cSopenharmony_ci
149816fd32cSopenharmony_ci  sources = [
150816fd32cSopenharmony_ci    "${datashare_common_native_path}/src/datashare_string_utils.cpp",
151816fd32cSopenharmony_ci    "${datashare_native_permission_path}/src/data_share_called_config.cpp",
152816fd32cSopenharmony_ci    "${datashare_native_permission_path}/src/data_share_permission.cpp",
153816fd32cSopenharmony_ci  ]
154816fd32cSopenharmony_ci  configs = [ ":permission_config" ]
155816fd32cSopenharmony_ci  public_configs = [ ":permission_public_config" ]
156816fd32cSopenharmony_ci  version_script = "permission/libdatashare_permission.map"
157816fd32cSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
158816fd32cSopenharmony_ci  deps = [ "${datashare_innerapi_path}/common:datashare_common" ]
159816fd32cSopenharmony_ci
160816fd32cSopenharmony_ci  external_deps = [
161816fd32cSopenharmony_ci    "ability_base:zuri",
162816fd32cSopenharmony_ci    "ability_runtime:app_context",
163816fd32cSopenharmony_ci    "ability_runtime:runtime",
164816fd32cSopenharmony_ci    "access_token:libaccesstoken_sdk",
165816fd32cSopenharmony_ci    "bundle_framework:appexecfwk_base",
166816fd32cSopenharmony_ci    "bundle_framework:appexecfwk_core",
167816fd32cSopenharmony_ci    "bundle_framework:libappexecfwk_common",
168816fd32cSopenharmony_ci    "c_utils:utils",
169816fd32cSopenharmony_ci    "common_event_service:cesfwk_innerkits",
170816fd32cSopenharmony_ci    "hilog:libhilog",
171816fd32cSopenharmony_ci    "ipc:ipc_single",
172816fd32cSopenharmony_ci    "samgr:samgr_proxy",
173816fd32cSopenharmony_ci  ]
174816fd32cSopenharmony_ci
175816fd32cSopenharmony_ci  subsystem_name = "distributeddatamgr"
176816fd32cSopenharmony_ci  part_name = "data_share"
177816fd32cSopenharmony_ci}
178816fd32cSopenharmony_ci
179816fd32cSopenharmony_ciohos_shared_library("datashare_provider") {
180816fd32cSopenharmony_ci  branch_protector_ret = "pac_ret"
181816fd32cSopenharmony_ci  sanitize = {
182816fd32cSopenharmony_ci    ubsan = true
183816fd32cSopenharmony_ci    boundary_sanitize = true
184816fd32cSopenharmony_ci    cfi = true
185816fd32cSopenharmony_ci    cfi_cross_dso = true
186816fd32cSopenharmony_ci    debug = false
187816fd32cSopenharmony_ci  }
188816fd32cSopenharmony_ci  include_dirs = [ "${datashare_common_napi_path}/include" ]
189816fd32cSopenharmony_ci
190816fd32cSopenharmony_ci  sources = [
191816fd32cSopenharmony_ci    "${datashare_common_native_path}/src/datashare_string_utils.cpp",
192816fd32cSopenharmony_ci    "${datashare_native_provider_path}/src/datashare_ext_ability.cpp",
193816fd32cSopenharmony_ci    "${datashare_native_provider_path}/src/datashare_ext_ability_context.cpp",
194816fd32cSopenharmony_ci    "${datashare_native_provider_path}/src/datashare_stub.cpp",
195816fd32cSopenharmony_ci    "${datashare_native_provider_path}/src/datashare_stub_impl.cpp",
196816fd32cSopenharmony_ci    "${datashare_native_provider_path}/src/datashare_uv_queue.cpp",
197816fd32cSopenharmony_ci    "${datashare_native_provider_path}/src/js_datashare_ext_ability.cpp",
198816fd32cSopenharmony_ci    "${datashare_native_provider_path}/src/js_datashare_ext_ability_context.cpp",
199816fd32cSopenharmony_ci  ]
200816fd32cSopenharmony_ci  configs = [ ":ability_config" ]
201816fd32cSopenharmony_ci  public_configs = [ ":datashare_public_config" ]
202816fd32cSopenharmony_ci  version_script = "provider/libdatashare_provider.map"
203816fd32cSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
204816fd32cSopenharmony_ci  deps = [
205816fd32cSopenharmony_ci    "${datashare_innerapi_path}/common:datashare_common",
206816fd32cSopenharmony_ci    "${datashare_napi_path}/dataShare:datashare_jscommon",
207816fd32cSopenharmony_ci  ]
208816fd32cSopenharmony_ci
209816fd32cSopenharmony_ci  external_deps = [
210816fd32cSopenharmony_ci    "ability_base:want",
211816fd32cSopenharmony_ci    "ability_base:zuri",
212816fd32cSopenharmony_ci    "ability_runtime:ability_connect_callback_stub",
213816fd32cSopenharmony_ci    "ability_runtime:ability_context_native",
214816fd32cSopenharmony_ci    "ability_runtime:abilitykit_native",
215816fd32cSopenharmony_ci    "ability_runtime:app_context",
216816fd32cSopenharmony_ci    "ability_runtime:extensionkit_native",
217816fd32cSopenharmony_ci    "ability_runtime:napi_common",
218816fd32cSopenharmony_ci    "ability_runtime:runtime",
219816fd32cSopenharmony_ci    "access_token:libaccesstoken_sdk",
220816fd32cSopenharmony_ci    "c_utils:utils",
221816fd32cSopenharmony_ci    "common_event_service:cesfwk_innerkits",
222816fd32cSopenharmony_ci    "hilog:libhilog",
223816fd32cSopenharmony_ci    "hisysevent:libhisysevent",
224816fd32cSopenharmony_ci    "ipc:ipc_napi",
225816fd32cSopenharmony_ci    "ipc:ipc_single",
226816fd32cSopenharmony_ci    "kv_store:distributeddata_inner",
227816fd32cSopenharmony_ci    "napi:ace_napi",
228816fd32cSopenharmony_ci    "samgr:samgr_proxy",
229816fd32cSopenharmony_ci  ]
230816fd32cSopenharmony_ci
231816fd32cSopenharmony_ci  public_external_deps = [ "ability_runtime:dataobs_manager" ]
232816fd32cSopenharmony_ci
233816fd32cSopenharmony_ci  subsystem_name = "distributeddatamgr"
234816fd32cSopenharmony_ci  part_name = "data_share"
235816fd32cSopenharmony_ci}
236816fd32cSopenharmony_ci
237816fd32cSopenharmony_ciohos_shared_library("datashare_ext_ability_module") {
238816fd32cSopenharmony_ci  branch_protector_ret = "pac_ret"
239816fd32cSopenharmony_ci  sanitize = {
240816fd32cSopenharmony_ci    ubsan = true
241816fd32cSopenharmony_ci    boundary_sanitize = true
242816fd32cSopenharmony_ci    cfi = true
243816fd32cSopenharmony_ci    cfi_cross_dso = true
244816fd32cSopenharmony_ci    debug = false
245816fd32cSopenharmony_ci  }
246816fd32cSopenharmony_ci  include_dirs = [ "${datashare_native_provider_path}/include" ]
247816fd32cSopenharmony_ci
248816fd32cSopenharmony_ci  sources = [ "${datashare_native_provider_path}/src/datashare_ext_ability_module_loader.cpp" ]
249816fd32cSopenharmony_ci
250816fd32cSopenharmony_ci  configs = [ ":ability_config" ]
251816fd32cSopenharmony_ci  public_configs = [ ":datashare_public_config" ]
252816fd32cSopenharmony_ci
253816fd32cSopenharmony_ci  deps = [ ":datashare_provider" ]
254816fd32cSopenharmony_ci
255816fd32cSopenharmony_ci  external_deps = [
256816fd32cSopenharmony_ci    "ability_base:want",
257816fd32cSopenharmony_ci    "ability_runtime:abilitykit_native",
258816fd32cSopenharmony_ci    "ability_runtime:runtime",
259816fd32cSopenharmony_ci    "c_utils:utils",
260816fd32cSopenharmony_ci    "common_event_service:cesfwk_innerkits",
261816fd32cSopenharmony_ci    "hilog:libhilog",
262816fd32cSopenharmony_ci    "napi:ace_napi",
263816fd32cSopenharmony_ci  ]
264816fd32cSopenharmony_ci
265816fd32cSopenharmony_ci  relative_install_dir = "extensionability/"
266816fd32cSopenharmony_ci  subsystem_name = "distributeddatamgr"
267816fd32cSopenharmony_ci  part_name = "data_share"
268816fd32cSopenharmony_ci}
269816fd32cSopenharmony_ci
270816fd32cSopenharmony_ciohos_static_library("datashare_consumer_static") {
271816fd32cSopenharmony_ci  branch_protector_ret = "pac_ret"
272816fd32cSopenharmony_ci  sanitize = {
273816fd32cSopenharmony_ci    ubsan = true
274816fd32cSopenharmony_ci    boundary_sanitize = true
275816fd32cSopenharmony_ci    cfi = true
276816fd32cSopenharmony_ci    cfi_cross_dso = true
277816fd32cSopenharmony_ci    debug = false
278816fd32cSopenharmony_ci  }
279816fd32cSopenharmony_ci  include_dirs = [ "${datashare_common_native_path}/include" ]
280816fd32cSopenharmony_ci
281816fd32cSopenharmony_ci  sources = datashare_consumer_sources
282816fd32cSopenharmony_ci  configs = [ ":ability_config" ]
283816fd32cSopenharmony_ci  public_configs = [ ":datashare_public_config" ]
284816fd32cSopenharmony_ci  deps = [ "${datashare_innerapi_path}/common:datashare_common_static" ]
285816fd32cSopenharmony_ci
286816fd32cSopenharmony_ci  external_deps = datashare_consumer_external_deps
287816fd32cSopenharmony_ci
288816fd32cSopenharmony_ci  public_external_deps = [ "kv_store:distributeddata_inner" ]
289816fd32cSopenharmony_ci
290816fd32cSopenharmony_ci  subsystem_name = "distributeddatamgr"
291816fd32cSopenharmony_ci  part_name = "data_share"
292816fd32cSopenharmony_ci}
293