• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
13import("//arkcompiler/ets_frontend/ts2panda/ts2abc_config.gni")
14import("//build/ohos.gni")
15import("//build/ohos/ace/ace.gni")
16import("//foundation/arkui/ace_engine/ace_config.gni")
17
18group("build_module") {
19  deps = [ ":distributeddataobject" ]
20}
21
22# compile .js to .abc.
23action("gen_distributed_data_object_abc") {
24  visibility = [ ":*" ]
25  script = "//arkcompiler/ets_frontend/ts2panda/scripts/generate_js_bytecode.py"
26
27  args = [
28    "--src-js",
29    rebase_path("distributed_data_object.js"),
30    "--dst-file",
31    rebase_path(target_out_dir + "/distributed_data_object.abc"),
32    "--node",
33    rebase_path("${node_path}"),
34    "--frontend-tool-path",
35    rebase_path("${ts2abc_build_path}"),
36    "--node-modules",
37    rebase_path("${node_modules}"),
38    "--module",
39  ]
40  deps = [ "//arkcompiler/ets_frontend/ts2panda:ark_ts2abc_build" ]
41  inputs = [ "distributed_data_object.js" ]
42  outputs = [ target_out_dir + "/distributed_data_object.abc" ]
43}
44
45config("objectstore_config") {
46  visibility = [ "//foundation/distributeddatamgr/objectstore:*" ]
47
48  cflags = [ "-DHILOG_ENABLE" ]
49
50  include_dirs = [
51    "../../frameworks/jskitsimpl/include/adaptor",
52    "../../frameworks/jskitsimpl/include/common",
53    "../../frameworks/innerkitsimpl/include/adaptor",
54    "../../frameworks/innerkitsimpl/include/common",
55    "../../frameworks/innerkitsimpl/include/communicator",
56    "../../interfaces/innerkits",
57    "//third_party/bounds_checking_function/include",
58    "//foundation/ability/ability_runtime/interfaces/kits/native/appkit/ability_runtime/context",
59    "//foundation/distributeddatamgr/kv_store/frameworks/common",
60    "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/interfaces/include",
61    "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/interfaces/include/relational",
62    "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/include",
63  ]
64}
65
66config("objectstore_public_config") {
67  visibility = [ ":*" ]
68
69  include_dirs = [
70    ".",
71    "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/interfaces/include",
72  ]
73}
74
75base_output_path =
76    get_label_info(":distributed_data_object_js", "target_out_dir")
77distributed_data_object_js_obj_path =
78    base_output_path + "/distributed_data_object.o"
79gen_js_obj("distributed_data_object_js") {
80  input = "distributed_data_object.js"
81  output = distributed_data_object_js_obj_path
82  dep = ":gen_distributed_data_object_abc"
83}
84
85abc_output_path =
86    get_label_info(":distributed_data_object_abc", "target_out_dir")
87distributed_data_object_abc_obj_path =
88    abc_output_path + "/distributed_data_object_abc.o"
89gen_js_obj("distributed_data_object_abc") {
90  input = "$target_out_dir/distributed_data_object.abc"
91  output = distributed_data_object_abc_obj_path
92  dep = ":gen_distributed_data_object_abc"
93}
94
95ohos_shared_library("distributeddataobject") {
96  part_name = "data_object"
97  sources = [
98    "../../frameworks/jskitsimpl/src/adaptor/js_distributedobject.cpp",
99    "../../frameworks/jskitsimpl/src/adaptor/js_distributedobjectstore.cpp",
100    "../../frameworks/jskitsimpl/src/adaptor/js_module_init.cpp",
101    "../../frameworks/jskitsimpl/src/adaptor/js_object_wrapper.cpp",
102    "../../frameworks/jskitsimpl/src/adaptor/js_watcher.cpp",
103    "../../frameworks/jskitsimpl/src/adaptor/notifier_impl.cpp",
104    "../../frameworks/jskitsimpl/src/common/js_ability.cpp",
105    "../../frameworks/jskitsimpl/src/common/js_util.cpp",
106    "../../frameworks/jskitsimpl/src/common/napi_queue.cpp",
107    "../../frameworks/jskitsimpl/src/common/object_error.cpp",
108    "../../frameworks/jskitsimpl/src/common/uv_queue.cpp",
109  ]
110
111  configs = [ ":objectstore_config" ]
112
113  deps = [
114    ":distributed_data_object_abc",
115    ":distributed_data_object_js",
116    "//foundation/ability/ability_runtime/frameworks/native/ability/native:abilitykit_native",
117    "//foundation/distributeddatamgr/data_object/interfaces/innerkits:distributeddataobject_impl",
118    "//third_party/libuv:uv",
119  ]
120  external_deps = [
121    "ability_runtime:abilitykit_native",
122    "ability_runtime:app_context",
123    "ability_runtime:napi_base_context",
124    "access_token:libaccesstoken_sdk",
125    "hiviewdfx_hilog_native:libhilog",
126    "napi:ace_napi",
127  ]
128
129  public_configs = [ ":objectstore_public_config" ]
130  relative_install_dir = "module/data"
131  subsystem_name = "distributeddatamgr"
132}
133