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("//build/ohos.gni") 15import("//foundation/arkui/ace_engine/ace_config.gni") 16 17# build static 18template("ace_capability_ohos_source_set") { 19 forward_variables_from(invoker, "*") 20 21 ohos_source_set(target_name) { 22 subsystem_name = ace_engine_subsystem 23 part_name = ace_engine_part 24 defines += invoker.defines 25 26 configs = [ "$ace_root:ace_config" ] 27 28 sources = [ 29 "clipboard/clipboard_impl.cpp", 30 "environment/environment_impl.cpp", 31 "environment/environment_proxy_impl.cpp", 32 "html/html_to_span.cpp", 33 "html/span_to_html.cpp", 34 "package/package_event_proxy_ohos.cpp", 35 "preference/storage_impl.cpp", 36 "statusbar/statusbar_event_proxy_ohos.cpp", 37 "time/time_event_proxy_ohos.cpp", 38 ] 39 include_dirs = [] 40 41 deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code" ] 42 external_deps = [ 43 "ability_base:want", 44 "common_event_service:cesfwk_innerkits", 45 "hicollie:libhicollie", 46 "hilog:libhilog", 47 "ipc:ipc_core", 48 "libxml2:libxml2", 49 "preferences:native_preferences", 50 ] 51 if (defined(config.enable_system_clipboard) && 52 config.enable_system_clipboard) { 53 external_deps += [ "pasteboard:pasteboard_client" ] 54 defines += [ "SYSTEM_CLIPBOARD_SUPPORTED" ] 55 } 56 57 sources += [ "xcollie/xcollieInterface_impl.cpp" ] 58 if (defined(config.enable_drag_framework) && config.enable_drag_framework) { 59 if (defined(global_parts_info.distributeddatamgr_udmf)) { 60 external_deps += [ "udmf:libudmf" ] 61 external_deps += [ "udmf:udmf_client" ] 62 external_deps += [ "udmf:udmf_data_napi" ] 63 external_deps += [ "device_status:devicestatus_client" ] 64 sources += [ "udmf/udmf_impl.cpp" ] 65 sources += [ "interaction/interaction_impl.cpp" ] 66 } 67 external_deps += [ "kv_store:distributeddata_inner" ] 68 } else { 69 sources += [ "//foundation/arkui/ace_engine/adapter/preview/entrance/msdp/interaction_impl.cpp" ] 70 sources += [ "//foundation/arkui/ace_engine/adapter/preview/entrance/udmf/udmf_impl.cpp" ] 71 } 72 if (defined(config.enable_ability_component) && 73 config.enable_ability_component) { 74 if (os_account_exists) { 75 external_deps += [ "os_account:os_account_innerkits" ] 76 } 77 external_deps += [ 78 "ability_base:want", 79 "ability_runtime:abilitykit_native", 80 "ability_runtime:runtime", 81 "bundle_framework:appexecfwk_base", 82 "c_utils:utils", 83 "eventhandler:libeventhandler", 84 "graphic_2d:librender_service_client", 85 "input:libmmi-client", 86 "ipc:ipc_core", 87 "napi:ace_napi", 88 "window_manager:libwindow_extension_client", 89 "window_manager:scene_session", 90 ] 91 sources += [ 92 "window_connection/window_extension_connection_ohos.cpp", 93 "window_connection/window_extension_connection_proxy.cpp", 94 "window_connection_ng/window_extension_connection_ohos_ng.cpp", 95 "window_connection_ng/window_extension_connection_proxy_ng.cpp", 96 ] 97 } 98 } 99} 100 101foreach(item, ace_platforms) { 102 platform = item.name 103 if (platform == "ohos") { 104 ace_capability_ohos_source_set("ace_capability_ohos") { 105 defines = [] 106 config = { 107 } 108 109 if (defined(item.config)) { 110 config = item.config 111 } 112 if (defined(config.defines)) { 113 defines = config.defines 114 } 115 } 116 } 117} 118