1# Copyright (C) 2023 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/ohos.gni") 15import( 16 "../../../../../../../arkcompiler/ets_frontend/ts2panda/ts2abc_config.gni") 17import("../../../../filemanagement_aafwk.gni") 18 19# compile .js to .abc. 20action("gen_picker_abc") { 21 visibility = [ ":*" ] 22 script = "../../../../../../../arkcompiler/ets_frontend/ts2panda/scripts/generate_js_bytecode.py" 23 24 args = [ 25 "--src-js", 26 rebase_path("picker.js"), 27 "--dst-file", 28 rebase_path(target_out_dir + "/picker.abc"), 29 "--node", 30 rebase_path("${node_path}"), 31 "--frontend-tool-path", 32 rebase_path("${ts2abc_build_path}"), 33 "--node-modules", 34 rebase_path("${node_modules}"), 35 "--module", 36 ] 37 deps = [ 38 "../../../../../../../arkcompiler/ets_frontend/ts2panda:ark_ts2abc_build", 39 ] 40 inputs = [ "picker.js" ] 41 outputs = [ target_out_dir + "/picker.abc" ] 42} 43 44base_output_path = get_label_info(":picker_js", "target_out_dir") 45picker_obj_path = base_output_path + "/picker.o" 46gen_js_obj("picker_js") { 47 input = "picker.js" 48 output = picker_obj_path 49 dep = ":gen_picker_abc" 50} 51 52abc_output_path = get_label_info(":picker_abc", "target_out_dir") 53picker_abc_obj_path = abc_output_path + "/picker_abc.o" 54gen_js_obj("picker_abc") { 55 input = "$target_out_dir/picker.abc" 56 output = picker_abc_obj_path 57 dep = ":gen_picker_abc" 58} 59 60ohos_shared_library("picker") { 61 ldflags = [ "-Wl" ] 62 sources = [ "native_module_ohos_picker.cpp" ] 63 64 deps = [ 65 ":picker_abc", 66 ":picker_js", 67 "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", 68 ] 69 70 sanitize = { 71 cfi = true 72 debug = false 73 } 74 75 relative_install_dir = "module/file" 76 subsystem_name = "filemanagement" 77 part_name = "user_file_service" 78} 79