# Copyright (c) 2021-2023 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("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") import("//build/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") import("//foundation/arkui/ace_engine/build/ace_gen_obj.gni") base_output_path = get_label_info(":gen_abc_proxyclass", "target_out_dir") abcproxyclass_obj_path = base_output_path + "/abc_pamgmt_class.o" es2abc_gen_abc("gen_paMgmt_abc") { extra_visibility = [ ":*" ] # Only targets in this file can depend on this. src_js = rebase_path( "//foundation/arkui/ace_engine/adapter/ohos/entrance/pa_engine/engine/jsi/paMgmt.js") dst_file = rebase_path(base_output_path + "/paMgmt.abc") in_puts = [ "//foundation/arkui/ace_engine/adapter/ohos/entrance/pa_engine/engine/jsi/paMgmt.js" ] out_puts = [ base_output_path + "/paMgmt.abc" ] } gen_obj("abc_proxyclass") { input = base_output_path + "/paMgmt.abc" if (use_mac) { abcproxyclass_obj_path = base_output_path + "/abc_pamgmt_class.c" } output = abcproxyclass_obj_path snapshot_dep = [ ":gen_paMgmt_abc" ] } template("js_pa_engine_ark") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { subsystem_name = ace_engine_subsystem part_name = ace_engine_part defines += invoker.defines configs = [ "$ace_root:ace_config" ] include_dirs = [ "$ace_root/adapter/ohos/entrance/pa_engine/engine/common" ] deps = [] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:abilitykit_native", "ability_runtime:appkit_native", "ability_runtime:js_environment", "ability_runtime:napi_ability_common", "ability_runtime:napi_common", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "ets_runtime:libark_jsruntime", "eventhandler:libeventhandler", "ffrt:libffrt", "form_fwk:form_manager", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "ipc:ipc_napi", "napi:ace_napi", "relational_store:native_dataability", "relational_store:native_rdb", "resource_management:global_resmgr", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (is_standard_system) { defines += [ "ENABLE_HITRACE" ] external_deps += [ "hitrace:libhitracechain" ] } sources = [ "$ace_root/adapter/ohos/entrance/pa_engine/engine/common/js_backend_asset_manager.cpp", "$ace_root/adapter/ohos/entrance/pa_engine/engine/common/js_backend_timer_module.cpp", "$ace_root/adapter/ohos/osal/log_wrapper.cpp", "$ace_root/frameworks/bridge/js_frontend/engine/jsi/ark_js_runtime.cpp", "$ace_root/frameworks/bridge/js_frontend/engine/jsi/ark_js_value.cpp", "$ace_root/frameworks/bridge/js_frontend/engine/jsi/jsi_base_utils.cpp", "jsi_pa_engine.cpp", "jsi_pa_engine_loader.cpp", ] if (defined(config.hdc_register_support) && config.hdc_register_support) { sources += [ "$ace_root/frameworks/core/common/hdc_register.cpp" ] } defines += [ "PA_SUPPORT" ] deps += [ ":gen_obj_src_abc_proxyclass", "$ace_root/frameworks/base:ace_memory_monitor_ohos", ] if (target_cpu == "arm64") { defines += [ "APP_USE_ARM64" ] } else if (target_cpu == "arm") { defines += [ "APP_USE_ARM" ] } } } foreach(item, ace_platforms) { platform = item.name engine_config = { } engine_config = item.config support_engines = [] support_engines = engine_config.js_engines foreach(engine, support_engines) { if (engine.engine_name == "ark") { js_pa_engine_ark("js_pa_engine_bridge_ark_$platform") { defines = engine.engine_defines config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines += config.defines } } } } }