• 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")
16
17config("resourceManager_config") {
18  include_dirs = [
19    "./include",
20    "../../../../frameworks/resmgr/include",
21  ]
22}
23
24ohos_shared_library("resourceManager_ani") {
25  public_configs = [ ":resourceManager_config" ]
26  include_dirs = [
27    "./include",
28    "../../../../frameworks/resmgr/include",
29  ]
30  sources = [
31    "./src/resourceManager.cpp",
32    "./src/resource_manager_ani_utils.cpp",
33  ]
34  defines = [ "CONFIG_HILOG" ]
35
36  deps = [ "../../../../frameworks/resmgr:global_resmgr" ]
37
38  external_deps = [
39    "ability_base:configuration",
40    "ability_runtime:app_context",
41    "ace_engine:drawable_descriptor",
42    "bundle_framework:appexecfwk_base",
43    "cJSON:cjson",
44    "c_utils:utils",
45    "hilog:libhilog",
46    "ipc:ipc_single",
47    "runtime_core:ani",
48  ]
49
50  branch_protector_ret = "pac_ret"
51  sanitize = {
52    boundary_sanitize = true
53    cfi = true
54    cfi_cross_dso = true
55    debug = false
56    integer_overflow = true
57    ubsan = true
58  }
59
60  part_name = "resource_management"
61  subsystem_name = "global"
62}
63
64ohos_shared_library("resmgr_ani") {
65  include_dirs = [ "./include" ]
66  sources = [ "./src/resmgr_ani.cpp" ]
67  defines = [ "CONFIG_HILOG" ]
68  deps = [ ":resourceManager_ani" ]
69  external_deps = [
70    "ability_base:configuration",
71    "ability_runtime:app_context",
72    "bundle_framework:appexecfwk_base",
73    "hilog:libhilog",
74    "ipc:ipc_single",
75    "runtime_core:ani",
76  ]
77
78  branch_protector_ret = "pac_ret"
79  sanitize = {
80    boundary_sanitize = true
81    cfi = true
82    cfi_cross_dso = true
83    debug = false
84    integer_overflow = true
85    ubsan = true
86  }
87
88  part_name = "resource_management"
89  subsystem_name = "global"
90}
91
92generate_static_abc("resourceManager") {
93  base_url = "./ets"
94  files = [ "./ets/@ohos.resourceManager.ets" ]
95  is_boot_abc = "True"
96  device_dst_file = "system/framework/resourceManager.abc"
97}
98
99generate_static_abc("resource") {
100  base_url = "./ets"
101  files = [
102    "./ets/global/resource.ets",
103    "./ets/global/resourceInner.ets",
104  ]
105  is_boot_abc = "True"
106  device_dst_file = "system/framework/resource.abc"
107}
108
109generate_static_abc("rawFileDescriptor") {
110  base_url = "./ets"
111  files = [
112    "./ets/global/rawFileDescriptor.ets",
113    "./ets/global/rawFileDescriptorInner.ets"
114    ]
115  is_boot_abc = "True"
116  device_dst_file = "system/framework/rawFileDescriptor.abc"
117  dependencies = [ ":copy_rawFileDescriptorInner_ets" ]
118}
119
120ohos_prebuilt_etc("resourceManager_etc") {
121  source = "$target_out_dir/resourceManager.abc"
122  module_install_dir = "framework"
123  part_name = "resource_management"
124  subsystem_name = "global"
125  deps = [ ":resourceManager" ]
126}
127
128ohos_prebuilt_etc("resource_etc") {
129  source = "$target_out_dir/resource.abc"
130  module_install_dir = "framework"
131  part_name = "resource_management"
132  subsystem_name = "global"
133  deps = [ ":resource" ]
134}
135
136ohos_prebuilt_etc("rawFileDescriptor_etc") {
137  source = "$target_out_dir/rawFileDescriptor.abc"
138  module_install_dir = "framework"
139  part_name = "resource_management"
140  subsystem_name = "global"
141  deps = [ ":rawFileDescriptor" ]
142}
143
144ohos_copy("copy_resourceManager_ets") {
145  sources = [ "./ets/global/resourceInner.ets" ]
146  outputs = [ "$ohos_ets_inner_path/global/resourceInner.ets" ]
147  subsystem_name = "global"
148  part_name = "resource_management"
149}
150
151ohos_copy("copy_rawFileDescriptorInner_ets") {
152  sources = [ "./ets/global/rawFileDescriptorInner.ets" ]
153  outputs = [ "$ohos_ets_inner_path/global/rawFileDescriptorInner.ets" ]
154  subsystem_name = "global"
155  part_name = "resource_management"
156}
157