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("//build/ohos/taihe_idl/taihe.gni") 17import("//drivers/external_device_manager/extdevmgr.gni") 18 19copy_taihe_idl("copy_deviceManager") { 20 sources = [ "idl/ohos.driver.deviceManager.taihe" ] 21 external_deps = [] 22} 23 24subsystem_name = "hdf" 25part_name = "external_device_manager" 26 27taihe_generated_file_path = "$taihe_file_path/out/$subsystem_name/$part_name" 28ohos_taihe("run_taihe") { 29 taihe_generated_file_path = "$taihe_generated_file_path" 30 deps = [ ":copy_deviceManager" ] 31 outputs = [ 32 "$taihe_generated_file_path/src/ohos.driver.deviceManager.abi.c", 33 "$taihe_generated_file_path/src/ohos.driver.deviceManager.ani.cpp", 34 ] 35} 36 37taihe_shared_library("device_manager_taihe_native") { 38 taihe_generated_file_path = "$taihe_generated_file_path" 39 part_name = "$part_name" 40 subsystem_name = "$subsystem_name" 41 sources = get_target_outputs(":run_taihe") 42 include_dirs = [ 43 "./include/", 44 "${utils_path}/include/", 45 "${ext_mgr_path}/interfaces/innerkits/", 46 ] 47 48 sources += [ 49 "${ext_mgr_path}/services/native/driver_extension_manager/src/driver_ext_mgr_types.cpp", 50 "src/ani_constructor.cpp", 51 "src/ohos.driver.deviceManager.impl.cpp", 52 ] 53 deps = [ 54 ":run_taihe", 55 "${ext_mgr_path}/interfaces/innerkits:driver_ext_mgr_client", 56 ] 57 58 external_deps = [ 59 "bundle_framework:appexecfwk_base", 60 "bundle_framework:appexecfwk_core", 61 "c_utils:utils", 62 "eventhandler:libeventhandler", 63 "hilog:libhilog", 64 "ipc:ipc_single", 65 "ipc:rpc_ani", 66 "runtime_core:ani", 67 ] 68} 69 70generate_static_abc("device_manager_abc") { 71 base_url = "$taihe_generated_file_path" 72 files = [ "$taihe_generated_file_path/@ohos.driver.deviceManager.ets" ] 73 is_boot_abc = "True" 74 device_dst_file = "/system/framework/device_manager_abc.abc" 75 dependencies = [ ":run_taihe" ] 76} 77 78ohos_prebuilt_etc("device_manager_etc") { 79 source = "$target_out_dir/device_manager_abc.abc" 80 module_install_dir = "framework" 81 part_name = "$part_name" 82 subsystem_name = "$subsystem_name" 83 deps = [ ":device_manager_abc" ] 84} 85 86# generate_static_abc("device_manager_test") { 87# base_url = "$taihe_generated_file_path" 88# files = [ "$taihe_generated_file_path/@ohos.driver.deviceManager.ets" ] 89# is_boot_abc = "True" 90# device_dst_file = "/system/framework/device_manager_abc.abc" 91# dependencies = [ ":run_taihe" ] 92# } 93 94group("device_manager_taihe") { 95 deps = [ 96 ":device_manager_etc", 97 ":device_manager_taihe_native", 98 ] 99} 100