• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni")
15import("//build/ohos.gni")
16import("//foundation/arkui/ace_engine/ace_config.gni")
17
18config("ani_config") {
19  include_dirs = [
20    "${ace_root}/frameworks",
21    "${ace_root}/interfaces",
22    "${ace_root}",
23  ]
24}
25
26#构建ANI库
27ohos_shared_library("observer_ani") {
28  deps = [ "$ace_root/build:libace_compatible" ]
29  include_dirs = [ "./include" ]
30  sources = [ "./src/observer.cpp" ]
31  external_deps = [
32    "napi:ace_napi",
33    "runtime_core:ani",
34  ]
35  configs = [ "$ace_root:ace_config" ]
36  part_name = "ace_engine"
37  subsystem_name = "arkui"
38  output_extension = "so"
39}
40
41#构建abc
42generate_static_abc("observer") {
43  paths_keys = [ "@ohos.arkui.observer" ]
44  base_url = "./ets"
45  files = [ "./ets/@ohos.arkui.observer.ets" ]
46  paths_values = [ "./ets/@ohos.arkui.observer.ets" ]
47  dst_file = target_out_dir + "/observer.abc"
48  out_puts = [ target_out_dir + "/observer.abc" ]
49  is_boot_abc = "True"
50  device_dst_file = "/system/framework/observer.abc"
51}
52
53ohos_prebuilt_etc("observer_etc") {
54  source = "$target_out_dir/observer.abc"
55  module_install_dir = "framework"
56  part_name = "ace_engine"
57  subsystem_name = "arkui"
58  deps = [ ":observer" ]
59}