# Copyright (c) 2022-2026 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("//build/ohos.gni")
import("//foundation/arkui/ace_engine/ace_config.gni")
app_framework_root = "//foundation/appframework"
ability_runtime_cross_platform_path =
"//foundation/appframework/ability/ability_runtime/cross_platform"
app_framework_resource_path = "//foundation/appframework/resource_management"
app_framework_window_path = "//foundation/appframework/window_manager"
app_framework_hiviewdfx_path = "//foundation/appframework/hiviewdfx"
# build static
template("ace_osal_android_source_set") {
forward_variables_from(invoker, "*")
ohos_source_set(target_name) {
defines += invoker.defines
libs = [ "log" ]
if (defined(ace_engine_feature_enable_upgrade_skia) &&
ace_engine_feature_enable_upgrade_skia) {
defines += [ "USE_NEW_SKIA" ]
}
sources = [
"accessibility_event_manager.cpp",
"accessibility_type_convertor.cpp",
"ace_checker.cpp",
"ace_engine_ext.cpp",
"ace_forward_compatibility.cpp",
"ace_trace.cpp",
"advance/ai_write_adapter.cpp",
"advance/data_detector_adapter.cpp",
"advance/data_detector_mgr.cpp",
"advance/image_analyzer_adapter_impl.cpp",
"advance/image_analyzer_manager.cpp",
"advance/image_analyzer_mgr.cpp",
"advance/text_share_adapter.cpp",
"advance/text_translation_adapter.cpp",
"app_bar_helper_impl.cpp",
"cpu_boost.cpp",
"display_info_utils.cpp",
"display_manager_android.cpp",
"drag_window.cpp",
"dynamic_module_helper.cpp",
"event_report.cpp",
"feature_manager.cpp",
"feature_param.cpp",
"file_asset_provider.cpp",
"file_uri_helper_android.cpp",
"frame_report.cpp",
"frame_trace_adapter_impl.cpp",
"hitrace_meter.cpp",
"high_contrast_observer.cpp",
"image_packer_android.cpp",
"image_perf_android.cpp",
"image_source_android.cpp",
"input_manager.cpp",
"input_method_manager_android.cpp",
"js_accessibility_manager.cpp",
"layout_inspector.cpp",
"log_wrapper.cpp",
"mock/accessibility_constants.cpp",
"mock/accessibility_element_info.cpp",
"mock/accessibility_event_info.cpp",
"modal_ui_extension_impl.cpp",
"mouse_style_android.cpp",
"navigation_route.cpp",
"package_event_proxy_android.cpp",
"page_url_checker_android.cpp",
"perf_interfaces.cpp",
"picture_android.cpp",
"pixel_map_android.cpp",
"resource_adapter_impl_v2.cpp",
"resource_convertor.cpp",
"resource_theme_style.cpp",
"ressched_report.cpp",
"screen_lock_manager_android.cpp",
"socperf_client_impl.cpp",
"statistic_event_adapter.cpp",
"statusbar_event_proxy_android.cpp",
"stylus_detector_default.cpp",
"stylus_detector_mgr.cpp",
"subwindow_android.cpp",
"system_bar_style_ohos.cpp",
"system_properties.cpp",
"system_properties_multi_thread.cpp",
"utils.cpp",
"thread_priority.cpp",
"time_event_proxy_android.cpp",
"trace_id_impl.cpp",
"view_data_wrap_impl.cpp",
"want_wrap_android.cpp",
"websocket_manager.cpp",
]
include_dirs = [
"$ace_root/adapter/android/entrance/java/jni",
"$ace_root/frameworks/core/common",
"$ace_root/interfaces/inner_api/ace",
"$app_framework_window_path/dm/include",
"$app_framework_window_path/interfaces/innerkits/dm",
"$app_framework_window_path/utils/include",
"//third_party/zlib",
"$ace_root/frameworks/bridge/common/accessibility",
"$ace_root/adapter/android/osal/mock",
"//foundation/graphic/graphic_surface/interfaces/inner_api/surface",
"//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter",
"$app_framework_hiviewdfx_path/vsnprintf/include",
"$app_framework_hiviewdfx_path/hilog/include"
]
deps = [
"$ace_root/adapter/android/entrance/java/jni:ace_common_jni_$platform",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$app_framework_resource_path:global_resmgr",
"$app_framework_resource_path/interfaces/js/innerkits/core:resmgr_napi_core",
"$app_framework_resource_path/interfaces/js/kits:resourcemanager",
"$app_framework_resource_path/interfaces/native/resource:rawfile",
"$app_framework_window_path/dm:dm",
"$app_framework_hiviewdfx_path/hilog:hiviewdfx_hilog_base",
]
configs = [
"$ability_runtime_cross_platform_path/interfaces/kits/native/ability:abilitykit_native_config",
"$ability_runtime_cross_platform_path/interfaces/kits/native/appkit:appkit_native_config",
"$ace_root:ace_config",
"$crossplatform_multimedia_root/image_framework/interfaces/innerkits:image_external_config",
]
if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
deps += [ "$ace_graphic/rosen/modules/render_service_client:librender_service_client_static" ]
deps += [ "$ace_napi:ace_napi" ]
}
deps += [ "//foundation/multimodalinput/input/frameworks/proxy:libmmi-client-crossplatform" ]
}
}
foreach(item, ace_platforms) {
platform = item.name
if (platform == "android") {
ace_osal_android_source_set("ace_osal_android") {
platform = item.name
defines = []
config = {
}
if (defined(item.config)) {
config = item.config
}
if (defined(config.defines)) {
defines = config.defines
}
}
}
}