1# Copyright (c) 2021-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. 13 14import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") 15import("//build/ohos.gni") 16import("//foundation/arkui/ace_engine/ace_config.gni") 17import("//foundation/arkui/ace_engine/build/ace_gen_obj.gni") 18 19base_output_path = get_label_info(":gen_abc_proxyclass", "target_out_dir") 20abcproxyclass_obj_path = base_output_path + "/abc_pamgmt_class.o" 21 22es2abc_gen_abc("gen_paMgmt_abc") { 23 extra_visibility = [ ":*" ] # Only targets in this file can depend on this. 24 src_js = rebase_path( 25 "//foundation/arkui/ace_engine/adapter/ohos/entrance/pa_engine/engine/jsi/paMgmt.js") 26 dst_file = rebase_path(base_output_path + "/paMgmt.abc") 27 28 in_puts = [ "//foundation/arkui/ace_engine/adapter/ohos/entrance/pa_engine/engine/jsi/paMgmt.js" ] 29 out_puts = [ base_output_path + "/paMgmt.abc" ] 30} 31 32gen_obj("abc_proxyclass") { 33 input = base_output_path + "/paMgmt.abc" 34 if (use_mac) { 35 abcproxyclass_obj_path = base_output_path + "/abc_pamgmt_class.c" 36 } 37 output = abcproxyclass_obj_path 38 snapshot_dep = [ ":gen_paMgmt_abc" ] 39} 40 41template("js_pa_engine_ark") { 42 forward_variables_from(invoker, "*") 43 44 ohos_source_set(target_name) { 45 subsystem_name = ace_engine_subsystem 46 part_name = ace_engine_part 47 defines += invoker.defines 48 49 configs = [ 50 "$ace_root:ace_config", 51 "$ark_runtime_path/libpandabase:arkbase_public_config", 52 "//arkcompiler/ets_runtime:ark_jsruntime_public_config", 53 ] 54 55 include_dirs = [ 56 "$ability_runtime_inner_api_path/ability_manager/include", 57 "$ability_runtime_path/interfaces/kits/native/ability/native", 58 "$ability_runtime_services_path/common/include", 59 "$ability_runtime_services_path/abilitymgr/include", 60 "$ability_runtime_napi_path/context", 61 "$ability_runtime_napi_path/inner/napi_common", 62 "//foundation/arkui/ace_engine/adapter/ohos/entrance/pa_engine/engine/common", 63 ] 64 deps = [ 65 "$ability_runtime_napi_path/inner/napi_common:napi_common", 66 "$ability_runtime_path/frameworks/native/ability/native:abilitykit_native", 67 "$ability_runtime_path/frameworks/native/appkit:appkit_native", 68 "//arkcompiler/ets_runtime:libark_jsruntime", 69 "//foundation/arkui/napi:ace_napi", 70 "//foundation/arkui/napi:ace_napi_ark", 71 "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk", 72 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 73 ] 74 external_deps = [ 75 "ability_base:want", 76 "ability_base:zuri", 77 "bundle_framework:appexecfwk_base", 78 "bundle_framework:appexecfwk_core", 79 "c_utils:utils", 80 "eventhandler:libeventhandler", 81 "form_fwk:form_manager", 82 "hiviewdfx_hilog_native:libhilog", 83 "ipc:ipc_core", 84 "ipc_js:rpc", 85 "napi:ace_napi", 86 "relational_store:native_dataability", 87 "relational_store:native_rdb", 88 ] 89 90 public_deps = 91 [ "//base/global/resource_management/frameworks/resmgr:global_resmgr" ] 92 93 sources = [ 94 "$ace_root/adapter/ohos/entrance/pa_engine/engine/common/js_backend_timer_module.cpp", 95 "$ace_root/frameworks/bridge/js_frontend/engine/jsi/ark_js_runtime.cpp", 96 "$ace_root/frameworks/bridge/js_frontend/engine/jsi/ark_js_value.cpp", 97 "$ace_root/frameworks/bridge/js_frontend/engine/jsi/jsi_base_utils.cpp", 98 "jsi_pa_engine.cpp", 99 "jsi_pa_engine_loader.cpp", 100 ] 101 102 defines += [ "PA_SUPPORT" ] 103 104 deps += [ ":gen_obj_src_abc_proxyclass" ] 105 106 if (target_cpu == "arm64") { 107 defines += [ "APP_USE_ARM64" ] 108 } else if (target_cpu == "arm") { 109 defines += [ "APP_USE_ARM" ] 110 } 111 } 112} 113 114foreach(item, ace_platforms) { 115 platform = item.name 116 engine_config = { 117 } 118 engine_config = item.config 119 support_engines = [] 120 support_engines = engine_config.js_engines 121 foreach(engine, support_engines) { 122 if (engine.engine_name == "ark") { 123 js_pa_engine_ark("js_pa_engine_bridge_ark_$platform") { 124 defines = engine.engine_defines 125 config = { 126 } 127 128 if (defined(item.config)) { 129 config = item.config 130 } 131 if (defined(config.defines)) { 132 defines += config.defines 133 } 134 } 135 } 136 } 137} 138