# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni")
import("//build/ohos.gni")
import("//foundation/arkui/ace_engine/ace_config.gni")

#构建ANI库
ohos_shared_library("test_ani") {
  shlib_type = "ani"
  deps = [ "$ace_root/build:libace_compatible" ]
  include_dirs = [ "./include" ]
  sources = [ "./src/test.cpp" ]
  external_deps = [
    #"runtime_core:libarkruntime",
    "napi:ace_napi",
    "runtime_core:ani",
  ]
  configs = [ "$ace_root:ace_config" ]
  part_name = "ace_engine"
  subsystem_name = "arkui"
  output_extension = "so"
}

#构建abc
generate_static_abc("arkui_test") {
  base_url = "./ets"
  files = [ "./ets/@ohos.arkui.Test.ets" ]
  is_boot_abc = "True"
  device_dst_file = "/system/framework/arkui_test.abc"
}

ohos_prebuilt_etc("test_etc") {
  source = "$target_out_dir/arkui_test.abc"
  module_install_dir = "framework"
  part_name = "ace_engine"
  subsystem_name = "arkui"
  deps = [ ":arkui_test" ]
}