# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//ark/ts2abc/ts2panda/ts2abc_config.gni") import("//build/ohos.gni") import("//build/ohos/ace/ace.gni") import("//foundation/ace/ace_engine/ace_config.gni") group("build_module") { deps = [ ":distributeddataobject" ] } # compile .js to .abc. action("gen_distributed_data_object_abc") { visibility = [ ":*" ] script = "//ark/ts2abc/ts2panda/scripts/generate_js_bytecode.py" args = [ "--src-js", rebase_path("distributed_data_object.js"), "--dst-file", rebase_path(target_out_dir + "/distributed_data_object.abc"), "--node", rebase_path("${node_path}"), "--frontend-tool-path", rebase_path("${ts2abc_build_path}"), "--node-modules", rebase_path("${node_modules}"), ] deps = [ "//ark/ts2abc/ts2panda:ark_ts2abc_build" ] inputs = [ "distributed_data_object.js" ] outputs = [ target_out_dir + "/distributed_data_object.abc" ] } config("objectstore_config") { visibility = [ "//foundation/distributeddatamgr/objectstore:*" ] cflags = [ "-DHILOG_ENABLE" ] include_dirs = [ "../../frameworks/jskitsimpl/include/adaptor", "../../frameworks/jskitsimpl/include/common", "../../frameworks/innerkitsimpl/include/adaptor", "../../frameworks/innerkitsimpl/include/common", "../../frameworks/innerkitsimpl/include/communicator", "../../interfaces/innerkits", "//third_party/bounds_checking_function/include", "//foundation/aafwk/standard/frameworks/kits/appkit/native/ability_runtime/context", ] } config("objectstore_public_config") { visibility = [ ":*" ] include_dirs = [ ".", "//foundation/distributeddatamgr/distributeddatamgr/services/distributeddataservice/libs/distributeddb/interfaces/include", ] } base_output_path = get_label_info(":distributed_data_object_js", "target_out_dir") distributed_data_object_js_obj_path = base_output_path + "/distributed_data_object.o" gen_js_obj("distributed_data_object_js") { input = "distributed_data_object.js" output = distributed_data_object_js_obj_path dep = ":gen_distributed_data_object_abc" } abc_output_path = get_label_info(":distributed_data_object_abc", "target_out_dir") distributed_data_object_abc_obj_path = abc_output_path + "/distributed_data_object_abc.o" gen_js_obj("distributed_data_object_abc") { input = "$target_out_dir/distributed_data_object.abc" output = distributed_data_object_abc_obj_path dep = ":gen_distributed_data_object_abc" } ohos_shared_library("distributeddataobject") { part_name = "distributeddataobject" sources = [ "../../frameworks/jskitsimpl/src/adaptor/js_distributedobject.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_distributedobjectstore.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_module_init.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_notifier_impl.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_object_wrapper.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_watcher.cpp", "../../frameworks/jskitsimpl/src/common/js_util.cpp", "../../frameworks/jskitsimpl/src/common/uv_queue.cpp", ] configs = [ ":objectstore_config" ] deps = [ ":distributed_data_object_abc", ":distributed_data_object_js", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:app_context", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/distributeddatamgr/distributeddatamgr/services/distributeddataservice/libs/distributeddb:distributeddb", "//foundation/distributeddatamgr/objectstore/interfaces/innerkits:distributeddataobject_impl", "//third_party/libuv:uv", "//utils/native/base:utils", "//utils/native/base:utilsecurec", ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "ability_runtime:runtime", "dsoftbus_standard:softbus_client", "hiviewdfx_hilog_native:libhilog", "napi:ace_napi", ] public_configs = [ ":objectstore_public_config" ] relative_install_dir = "module/data" subsystem_name = "distributeddataobject" }