• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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/filemanagement/file_api/file_api.gni")
17
18file_common_src = [
19  "src/common/file_helper/fd_guard.cpp",
20  "src/common/napi/n_async/n_async_work_callback.cpp",
21  "src/common/napi/n_async/n_async_work_promise.cpp",
22  "src/common/napi/n_async/n_ref.cpp",
23  "src/common/napi/n_class.cpp",
24  "src/common/napi/n_func_arg.cpp",
25  "src/common/napi/n_val.cpp",
26  "src/common/uni_error.cpp",
27]
28
29config("kits_public_config") {
30  visibility = [ ":*" ]
31
32  include_dirs = [ "src/mod_securitylabel" ]
33}
34
35ohos_shared_library("fileio") {
36  cflags = [
37    "-fvisibility=hidden",
38    "-fdata-sections",
39    "-ffunction-sections",
40    "-Oz",
41  ]
42  cflags_cc = [
43    "-fvisibility-inlines-hidden",
44    "-Oz",
45  ]
46  branch_protector_ret = "pac_ret"
47  sanitize = {
48    integer_overflow = true
49    ubsan = true
50    boundary_sanitize = true
51    cfi = true
52    cfi_cross_dso = true
53    debug = false
54  }
55
56  subsystem_name = "filemanagement"
57  part_name = "file_api"
58
59  relative_install_dir = "module"
60
61  include_dirs = [
62    "src/common",
63    "src/common/file_helper",
64    "src/common/napi",
65    "src/common/napi/n_async",
66    "src/mod_fileio",
67    "${utils_path}/common/include",
68  ]
69
70  sources = file_common_src
71  sources += [
72    "src/common/file_helper/hash_file.cpp",
73    "src/mod_fileio/class_constants/constants.cpp",
74    "src/mod_fileio/class_dir/dir_n_exporter.cpp",
75    "src/mod_fileio/class_dirent/dirent_n_exporter.cpp",
76    "src/mod_fileio/class_stat/stat_n_exporter.cpp",
77    "src/mod_fileio/class_stream/flush.cpp",
78    "src/mod_fileio/class_stream/stream_n_exporter.cpp",
79    "src/mod_fileio/class_watcher/watcher_n_exporter.cpp",
80    "src/mod_fileio/common_func.cpp",
81    "src/mod_fileio/module.cpp",
82    "src/mod_fileio/properties/chmod.cpp",
83    "src/mod_fileio/properties/chown.cpp",
84    "src/mod_fileio/properties/close.cpp",
85    "src/mod_fileio/properties/copy_file.cpp",
86    "src/mod_fileio/properties/create_stream.cpp",
87    "src/mod_fileio/properties/fchmod.cpp",
88    "src/mod_fileio/properties/fchown.cpp",
89    "src/mod_fileio/properties/fdatasync.cpp",
90    "src/mod_fileio/properties/fdopen_stream.cpp",
91    "src/mod_fileio/properties/fstat.cpp",
92    "src/mod_fileio/properties/fsync.cpp",
93    "src/mod_fileio/properties/ftruncate.cpp",
94    "src/mod_fileio/properties/hash.cpp",
95    "src/mod_fileio/properties/lchown.cpp",
96    "src/mod_fileio/properties/link.cpp",
97    "src/mod_fileio/properties/lseek.cpp",
98    "src/mod_fileio/properties/lstat.cpp",
99    "src/mod_fileio/properties/mkdtemp.cpp",
100    "src/mod_fileio/properties/open.cpp",
101    "src/mod_fileio/properties/open_dir.cpp",
102    "src/mod_fileio/properties/posix_fallocate.cpp",
103    "src/mod_fileio/properties/prop_n_exporter.cpp",
104    "src/mod_fileio/properties/read_dir.cpp",
105    "src/mod_fileio/properties/read_text.cpp",
106    "src/mod_fileio/properties/rename.cpp",
107    "src/mod_fileio/properties/rmdir.cpp",
108    "src/mod_fileio/properties/rmdirent.cpp",
109    "src/mod_fileio/properties/stat.cpp",
110    "src/mod_fileio/properties/symlink.cpp",
111    "src/mod_fileio/properties/truncate.cpp",
112    "src/mod_fileio/properties/watcher.cpp",
113  ]
114
115  deps = [
116    "${file_api_path}/interfaces/kits/native:remote_uri_native",
117    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
118  ]
119
120  use_exceptions = true
121
122  external_deps = [
123    "ability_base:zuri",
124    "bounds_checking_function:libsec_shared",
125    "c_utils:utils",
126    "hilog:libhilog",
127    "libuv:uv",
128    "napi:ace_napi",
129    "openssl:libcrypto_shared",
130  ]
131  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
132}
133
134ohos_shared_library("fs") {
135  subsystem_name = "filemanagement"
136  part_name = "file_api"
137
138  relative_install_dir = "module/file"
139
140  include_dirs = [
141    "${src_path}/common",
142    "${src_path}/common/file_helper",
143    "${src_path}/mod_fs",
144    "${src_path}/mod_fs/properties",
145    "${src_path}/mod_fs/properties/copy_listener",
146    "${utils_path}/common/include",
147  ]
148
149  sources = [
150    "src/common/file_helper/fd_guard.cpp",
151    "src/mod_fs/class_file/file_n_exporter.cpp",
152    "src/mod_fs/class_stat/stat_n_exporter.cpp",
153    "src/mod_fs/common_func.cpp",
154    "src/mod_fs/module.cpp",
155    "src/mod_fs/properties/close.cpp",
156    "src/mod_fs/properties/fdatasync.cpp",
157    "src/mod_fs/properties/fsync.cpp",
158    "src/mod_fs/properties/lstat.cpp",
159    "src/mod_fs/properties/mkdtemp.cpp",
160    "src/mod_fs/properties/open.cpp",
161    "src/mod_fs/properties/prop_n_exporter.cpp",
162    "src/mod_fs/properties/rename.cpp",
163    "src/mod_fs/properties/rmdirent.cpp",
164    "src/mod_fs/properties/stat.cpp",
165    "src/mod_fs/properties/truncate.cpp",
166    "src/mod_fs/properties/utimes.cpp",
167  ]
168
169  cflags_cc = [ "-std=c++17" ]
170
171  deps = [
172    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
173    "${utils_path}/filemgmt_libn:filemgmt_libn",
174  ]
175
176  use_exceptions = true
177
178  if (use_mingw_win) {
179    defines = [ "WIN_PLATFORM" ]
180  }
181  if (use_mac) {
182    defines = [ "IOS_PLATFORM" ]
183  }
184
185  external_deps = [
186    "hilog:libhilog",
187    "napi:ace_napi",
188  ]
189
190  if (!use_mingw_win && !use_mac) {
191    cflags = [
192      "-fvisibility=hidden",
193      "-fdata-sections",
194      "-ffunction-sections",
195      "-Oz",
196    ]
197    cflags_cc += [
198      "-fvisibility-inlines-hidden",
199      "-Oz",
200    ]
201    defines = [ "FILE_API_TRACE" ]
202    branch_protector_ret = "pac_ret"
203    sanitize = {
204      integer_overflow = true
205      ubsan = true
206      boundary_sanitize = true
207      cfi = true
208      cfi_cross_dso = true
209      debug = false
210    }
211
212    include_dirs += [ "${file_api_path}/interfaces/kits/rust/include" ]
213    sources += [
214      "src/mod_fs/class_atomicfile/atomicfile_n_exporter.cpp",
215      "src/mod_fs/class_randomaccessfile/randomaccessfile_n_exporter.cpp",
216      "src/mod_fs/class_readeriterator/readeriterator_n_exporter.cpp",
217      "src/mod_fs/class_stream/stream_n_exporter.cpp",
218      "src/mod_fs/class_tasksignal/task_signal_entity.cpp",
219      "src/mod_fs/class_tasksignal/task_signal_n_exporter.cpp",
220      "src/mod_fs/class_watcher/watcher_entity.cpp",
221      "src/mod_fs/class_watcher/watcher_n_exporter.cpp",
222      "src/mod_fs/properties/connectdfs.cpp",
223      "src/mod_fs/properties/copy.cpp",
224      "src/mod_fs/properties/copy_file.cpp",
225      "src/mod_fs/properties/copy_listener/trans_listener.cpp",
226      "src/mod_fs/properties/copydir.cpp",
227      "src/mod_fs/properties/create_randomaccessfile.cpp",
228      "src/mod_fs/properties/create_stream.cpp",
229      "src/mod_fs/properties/create_streamrw.cpp",
230      "src/mod_fs/properties/disconnectdfs.cpp",
231      "src/mod_fs/properties/dup.cpp",
232      "src/mod_fs/properties/fdopen_stream.cpp",
233      "src/mod_fs/properties/listfile.cpp",
234      "src/mod_fs/properties/lseek.cpp",
235      "src/mod_fs/properties/move.cpp",
236      "src/mod_fs/properties/movedir.cpp",
237      "src/mod_fs/properties/read_lines.cpp",
238      "src/mod_fs/properties/read_text.cpp",
239      "src/mod_fs/properties/symlink.cpp",
240      "src/mod_fs/properties/watcher.cpp",
241      "src/mod_fs/properties/xattr.cpp",
242    ]
243    external_deps += [
244      "ability_base:zuri",
245      "ability_runtime:ability_manager",
246      "ability_runtime:abilitykit_native",
247      "ability_runtime:extensionkit_native",
248      "access_token:libtokenid_sdk",
249      "app_file_service:fileuri_native",
250      "bundle_framework:appexecfwk_base",
251      "bundle_framework:appexecfwk_core",
252      "c_utils:utils",
253      "data_share:datashare_common",
254      "data_share:datashare_consumer",
255      "dfs_service:distributed_file_daemon_kit_inner",
256      "dfs_service:libdistributedfileutils",
257      "hisysevent:libhisysevent",
258      "hitrace:hitrace_meter",
259      "ipc:ipc_core",
260      "libuv:uv",
261      "samgr:samgr_proxy",
262    ]
263    deps += [
264      "${file_api_path}/interfaces/kits/native:remote_uri_native",
265      "${file_api_path}/interfaces/kits/native:task_signal_native",
266      "${file_api_path}/interfaces/kits/rust:rust_file",
267    ]
268  }
269}
270
271ohos_shared_library("hash") {
272  cflags = [
273    "-fvisibility=hidden",
274    "-fdata-sections",
275    "-ffunction-sections",
276    "-Oz",
277  ]
278  cflags_cc = [
279    "-fvisibility-inlines-hidden",
280    "-Oz",
281  ]
282  branch_protector_ret = "pac_ret"
283  sanitize = {
284    integer_overflow = true
285    ubsan = true
286    boundary_sanitize = true
287    cfi = true
288    cfi_cross_dso = true
289    debug = false
290  }
291
292  subsystem_name = "filemanagement"
293  part_name = "file_api"
294
295  relative_install_dir = "module/file"
296
297  include_dirs = [
298    "${src_path}/common",
299    "${src_path}/common/file_helper",
300    "${src_path}/mod_hash",
301    "${src_path}/mod_hash/class_hashstream",
302  ]
303
304  sources = [
305    "src/common/file_helper/fd_guard.cpp",
306    "src/common/file_helper/hash_file.cpp",
307    "src/mod_hash/class_hashstream/hashstream_n_exporter.cpp",
308    "src/mod_hash/create_streamhash.cpp",
309    "src/mod_hash/hash.cpp",
310    "src/mod_hash/module.cpp",
311  ]
312
313  deps = [
314    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
315    "${utils_path}/filemgmt_libn:filemgmt_libn",
316  ]
317
318  external_deps = [
319    "bounds_checking_function:libsec_shared",
320    "hilog:libhilog",
321    "napi:ace_napi",
322    "openssl:libcrypto_shared",
323  ]
324  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
325}
326
327ohos_shared_library("file") {
328  cflags = [
329    "-fvisibility=hidden",
330    "-fdata-sections",
331    "-ffunction-sections",
332    "-Oz",
333  ]
334  cflags_cc = [
335    "-fvisibility-inlines-hidden",
336    "-Oz",
337  ]
338  branch_protector_ret = "pac_ret"
339  sanitize = {
340    integer_overflow = true
341    ubsan = true
342    boundary_sanitize = true
343    cfi = true
344    cfi_cross_dso = true
345    debug = false
346  }
347
348  subsystem_name = "filemanagement"
349  part_name = "file_api"
350
351  relative_install_dir = "module"
352
353  include_dirs = [
354    "src/common",
355    "src/common/napi",
356    "src/common/napi/n_async",
357    "src/common/file_helper",
358    "src/mod_file",
359  ]
360
361  sources = file_common_src
362  sources += [
363    "src/common/ability_helper.cpp",
364    "src/mod_file/class_file/file_n_exporter.cpp",
365    "src/mod_file/common_func.cpp",
366    "src/mod_file/module.cpp",
367  ]
368
369  external_deps = [
370    "ability_runtime:abilitykit_native",
371    "ability_runtime:extensionkit_native",
372    "bounds_checking_function:libsec_shared",
373    "common_event_service:cesfwk_innerkits",
374    "eventhandler:libeventhandler",
375    "hilog:libhilog",
376    "napi:ace_napi",
377  ]
378
379  if (file_api_read_optimize) {
380    defines = [ "WEARABLE_PRODUCT" ]
381  }
382}
383
384ohos_shared_library("statfs") {
385  cflags = [
386    "-fvisibility=hidden",
387    "-fdata-sections",
388    "-ffunction-sections",
389    "-Oz",
390  ]
391  cflags_cc = [
392    "-fvisibility-inlines-hidden",
393    "-Oz",
394  ]
395  branch_protector_ret = "pac_ret"
396  sanitize = {
397    integer_overflow = true
398    ubsan = true
399    boundary_sanitize = true
400    cfi = true
401    cfi_cross_dso = true
402    debug = false
403  }
404
405  subsystem_name = "filemanagement"
406  part_name = "file_api"
407
408  relative_install_dir = "module"
409
410  sources = [
411    "src/mod_statfs/statfs_n_exporter.cpp",
412    "src/mod_statfs/statfs_napi.cpp",
413  ]
414
415  deps = [
416    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
417    "${utils_path}/filemgmt_libn:filemgmt_libn",
418  ]
419
420  external_deps = [
421    "hilog:libhilog",
422    "napi:ace_napi",
423  ]
424}
425
426ohos_shared_library("statvfs") {
427  cflags = [
428    "-fvisibility=hidden",
429    "-fdata-sections",
430    "-ffunction-sections",
431    "-Oz",
432  ]
433  cflags_cc = [
434    "-fvisibility-inlines-hidden",
435    "-Oz",
436  ]
437  branch_protector_ret = "pac_ret"
438  sanitize = {
439    integer_overflow = true
440    ubsan = true
441    boundary_sanitize = true
442    cfi = true
443    cfi_cross_dso = true
444    debug = false
445  }
446
447  subsystem_name = "filemanagement"
448  part_name = "file_api"
449
450  relative_install_dir = "module/file"
451
452  sources = [
453    "src/mod_statvfs/statvfs_n_exporter.cpp",
454    "src/mod_statvfs/statvfs_napi.cpp",
455  ]
456
457  deps = [
458    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
459    "${utils_path}/filemgmt_libn:filemgmt_libn",
460  ]
461
462  external_deps = [
463    "hilog:libhilog",
464    "napi:ace_napi",
465  ]
466}
467
468ohos_shared_library("environment") {
469  cflags = [
470    "-fvisibility=hidden",
471    "-fdata-sections",
472    "-ffunction-sections",
473    "-Oz",
474  ]
475  cflags_cc = [
476    "-fvisibility-inlines-hidden",
477    "-Oz",
478  ]
479  branch_protector_ret = "pac_ret"
480  sanitize = {
481    integer_overflow = true
482    ubsan = true
483    boundary_sanitize = true
484    cfi = true
485    cfi_cross_dso = true
486    debug = false
487  }
488
489  subsystem_name = "filemanagement"
490  part_name = "file_api"
491
492  relative_install_dir = "module/file"
493
494  sources = [
495    "src/mod_environment/environment_n_exporter.cpp",
496    "src/mod_environment/environment_napi.cpp",
497  ]
498
499  deps = [
500    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
501    "${utils_path}/filemgmt_libn:filemgmt_libn",
502  ]
503
504  external_deps = [
505    "access_token:libaccesstoken_sdk",
506    "access_token:libtokenid_sdk",
507    "hilog:libhilog",
508    "init:libbegetutil",
509    "ipc:ipc_core",
510    "napi:ace_napi",
511    "os_account:os_account_innerkits",
512  ]
513}
514ohos_shared_library("securitylabel") {
515  branch_protector_ret = "pac_ret"
516  sanitize = {
517    integer_overflow = true
518    ubsan = true
519    boundary_sanitize = true
520    cfi = true
521    cfi_cross_dso = true
522    debug = false
523  }
524
525  subsystem_name = "filemanagement"
526  part_name = "file_api"
527
528  relative_install_dir = "module/file"
529
530  cflags = [
531    "-fvisibility=hidden",
532    "-fdata-sections",
533    "-ffunction-sections",
534    "-Wno-format",
535    "-Oz",
536  ]
537  cflags_cc = [
538    "-fvisibility-inlines-hidden",
539    "-Oz",
540  ]
541
542  sources = [
543    "src/mod_securitylabel/securitylabel_n_exporter.cpp",
544    "src/mod_securitylabel/securitylabel_napi.cpp",
545  ]
546
547  public_configs = [ ":kits_public_config" ]
548
549  deps = [
550    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
551    "${utils_path}/filemgmt_libn:filemgmt_libn",
552  ]
553
554  external_deps = [
555    "access_token:libtokenid_sdk",
556    "c_utils:utils",
557    "hilog:libhilog",
558    "ipc:ipc_core",
559    "napi:ace_napi",
560  ]
561}
562
563ohos_shared_library("document") {
564  cflags = [
565    "-fvisibility=hidden",
566    "-fdata-sections",
567    "-ffunction-sections",
568    "-Oz",
569  ]
570  cflags_cc = [
571    "-fvisibility-inlines-hidden",
572    "-Oz",
573  ]
574  branch_protector_ret = "pac_ret"
575  sanitize = {
576    integer_overflow = true
577    ubsan = true
578    boundary_sanitize = true
579    cfi = true
580    cfi_cross_dso = true
581    debug = false
582  }
583
584  subsystem_name = "filemanagement"
585  part_name = "file_api"
586
587  relative_install_dir = "module"
588
589  include_dirs = [
590    "src/common",
591    "src/common/napi",
592    "src/common/napi/n_async",
593  ]
594
595  sources = [
596    "src/common/napi/n_async/n_async_work_callback.cpp",
597    "src/common/napi/n_async/n_async_work_promise.cpp",
598    "src/common/napi/n_async/n_ref.cpp",
599    "src/common/napi/n_func_arg.cpp",
600    "src/common/napi/n_val.cpp",
601    "src/common/uni_error.cpp",
602    "src/mod_document/document_n_exporter.cpp",
603    "src/mod_document/document_napi.cpp",
604  ]
605
606  external_deps = [
607    "hilog:libhilog",
608    "napi:ace_napi",
609  ]
610}
611
612group("build_kits_js") {
613  deps = [
614    ":document",
615    ":environment",
616    ":file",
617    ":fileio",
618    ":fs",
619    ":hash",
620    ":securitylabel",
621    ":statfs",
622    ":statvfs",
623  ]
624}
625
626group("ani_file_api") {
627  deps = [
628    ":ani_file_environment",
629    ":ani_file_fs",
630    ":ani_file_hash",
631    ":ani_file_securitylabel",
632    ":ani_file_statvfs",
633  ]
634}
635
636config("ani_config") {
637  include_dirs = [
638    "./include",
639    "${file_api_path}/interfaces/kits/rust/include",
640    "${utils_path}/common/include",
641    "${utils_path}/filemgmt_libfs/include",
642    "${utils_path}/filemgmt_libhilog",
643    "src/common",
644    "src/common/ani_helper",
645    "src/common/file_helper",
646    "src/mod_fs",
647  ]
648
649  cflags = [
650    "-fdata-sections",
651    "-ffunction-sections",
652    "-Oz",
653  ]
654  cflags_cc = [
655    "-std=c++17",
656    "-fvisibility-inlines-hidden",
657    "-Oz",
658  ]
659}
660
661ohos_shared_library("ani_file_fs") {
662  public_configs = [ ":ani_config" ]
663  include_dirs = [
664    "include/ipc",
665    "src/mod_fs/ani",
666    "src/mod_fs/class_atomicfile",
667    "src/mod_fs/class_atomicfile/ani",
668    "src/mod_fs/class_file",
669    "src/mod_fs/class_file/ani",
670    "src/mod_fs/class_randomaccessfile",
671    "src/mod_fs/class_randomaccessfile/ani",
672    "src/mod_fs/class_readeriterator",
673    "src/mod_fs/class_readeriterator/ani",
674    "src/mod_fs/class_stat",
675    "src/mod_fs/class_stat/ani",
676    "src/mod_fs/class_stream",
677    "src/mod_fs/class_stream/ani",
678    "src/mod_fs/class_tasksignal",
679    "src/mod_fs/class_tasksignal/ani",
680    "src/mod_fs/class_watcher",
681    "src/mod_fs/class_watcher/ani",
682    "src/mod_fs/properties",
683    "src/mod_fs/properties/ani",
684    "src/mod_fs/properties/copy_listener",
685    "src/mod_fs/properties/copy_listener/ani",
686  ]
687  sources = [
688    "src/common/ani_helper/ani_signature.cpp",
689    "src/common/ani_helper/error_handler.cpp",
690    "src/common/ani_helper/type_converter.cpp",
691    "src/common/file_helper/fd_guard.cpp",
692    "src/mod_fs/ani/bind_function_class.cpp",
693    "src/mod_fs/class_atomicfile/ani/atomicfile_ani.cpp",
694    "src/mod_fs/class_atomicfile/fs_atomicfile.cpp",
695    "src/mod_fs/class_file/ani/file_ani.cpp",
696    "src/mod_fs/class_file/ani/file_wrapper.cpp",
697    "src/mod_fs/class_file/file_instantiator.cpp",
698    "src/mod_fs/class_file/fs_file.cpp",
699    "src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp",
700    "src/mod_fs/class_randomaccessfile/fs_randomaccessfile.cpp",
701    "src/mod_fs/class_readeriterator/ani/reader_iterator_ani.cpp",
702    "src/mod_fs/class_readeriterator/ani/reader_iterator_result_ani.cpp",
703    "src/mod_fs/class_readeriterator/fs_reader_iterator.cpp",
704    "src/mod_fs/class_stat/ani/lstat_ani.cpp",
705    "src/mod_fs/class_stat/ani/stat_ani.cpp",
706    "src/mod_fs/class_stat/ani/stat_wrapper.cpp",
707    "src/mod_fs/class_stat/fs_stat.cpp",
708    "src/mod_fs/class_stat/stat_instantiator.cpp",
709    "src/mod_fs/class_stream/ani/stream_ani.cpp",
710    "src/mod_fs/class_stream/ani/stream_wrapper.cpp",
711    "src/mod_fs/class_stream/fs_stream.cpp",
712    "src/mod_fs/class_stream/stream_instantiator.cpp",
713    "src/mod_fs/class_tasksignal/ani/task_signal_ani.cpp",
714    "src/mod_fs/class_tasksignal/ani/task_signal_listener_ani.cpp",
715    "src/mod_fs/class_tasksignal/ani/task_signal_wrapper.cpp",
716    "src/mod_fs/class_tasksignal/fs_task_signal.cpp",
717    "src/mod_fs/class_watcher/ani/fs_watcher_ani.cpp",
718    "src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp",
719    "src/mod_fs/class_watcher/ani/watch_event_listener.cpp",
720    "src/mod_fs/class_watcher/ani/watch_event_wrapper.cpp",
721    "src/mod_fs/class_watcher/fs_file_watcher.cpp",
722    "src/mod_fs/class_watcher/fs_watcher.cpp",
723    "src/mod_fs/class_watcher/watcher_data_cache.cpp",
724    "src/mod_fs/fs_utils.cpp",
725    "src/mod_fs/properties/access_core.cpp",
726    "src/mod_fs/properties/ani/access_ani.cpp",
727    "src/mod_fs/properties/ani/close_ani.cpp",
728    "src/mod_fs/properties/ani/copy_ani.cpp",
729    "src/mod_fs/properties/ani/copy_dir_ani.cpp",
730    "src/mod_fs/properties/ani/copy_file_ani.cpp",
731    "src/mod_fs/properties/ani/create_randomaccessfile_ani.cpp",
732    "src/mod_fs/properties/ani/create_stream_ani.cpp",
733    "src/mod_fs/properties/ani/dup_ani.cpp",
734    "src/mod_fs/properties/ani/fdatasync_ani.cpp",
735    "src/mod_fs/properties/ani/fdopen_stream_ani.cpp",
736    "src/mod_fs/properties/ani/fsync_ani.cpp",
737    "src/mod_fs/properties/ani/listfile_ani.cpp",
738    "src/mod_fs/properties/ani/lseek_ani.cpp",
739    "src/mod_fs/properties/ani/mkdir_ani.cpp",
740    "src/mod_fs/properties/ani/mkdtemp_ani.cpp",
741    "src/mod_fs/properties/ani/move_ani.cpp",
742    "src/mod_fs/properties/ani/movedir_ani.cpp",
743    "src/mod_fs/properties/ani/open_ani.cpp",
744    "src/mod_fs/properties/ani/read_ani.cpp",
745    "src/mod_fs/properties/ani/read_lines_ani.cpp",
746    "src/mod_fs/properties/ani/read_text_ani.cpp",
747    "src/mod_fs/properties/ani/rename_ani.cpp",
748    "src/mod_fs/properties/ani/rmdir_ani.cpp",
749    "src/mod_fs/properties/ani/symlink_ani.cpp",
750    "src/mod_fs/properties/ani/truncate_ani.cpp",
751    "src/mod_fs/properties/ani/unlink_ani.cpp",
752    "src/mod_fs/properties/ani/utimes_ani.cpp",
753    "src/mod_fs/properties/ani/watcher_ani.cpp",
754    "src/mod_fs/properties/ani/write_ani.cpp",
755    "src/mod_fs/properties/ani/xattr_ani.cpp",
756    "src/mod_fs/properties/close_core.cpp",
757    "src/mod_fs/properties/copy_core.cpp",
758    "src/mod_fs/properties/copy_dir_core.cpp",
759    "src/mod_fs/properties/copy_file_core.cpp",
760    "src/mod_fs/properties/copy_listener/ani/progress_listener_ani.cpp",
761    "src/mod_fs/properties/copy_listener/trans_listener_core.cpp",
762    "src/mod_fs/properties/create_randomaccessfile_core.cpp",
763    "src/mod_fs/properties/create_stream_core.cpp",
764    "src/mod_fs/properties/dup_core.cpp",
765    "src/mod_fs/properties/fdatasync_core.cpp",
766    "src/mod_fs/properties/fdopen_stream_core.cpp",
767    "src/mod_fs/properties/fsync_core.cpp",
768    "src/mod_fs/properties/listfile_core.cpp",
769    "src/mod_fs/properties/lseek_core.cpp",
770    "src/mod_fs/properties/lstat_core.cpp",
771    "src/mod_fs/properties/mkdir_core.cpp",
772    "src/mod_fs/properties/mkdtemp_core.cpp",
773    "src/mod_fs/properties/move_core.cpp",
774    "src/mod_fs/properties/movedir_core.cpp",
775    "src/mod_fs/properties/open_core.cpp",
776    "src/mod_fs/properties/read_core.cpp",
777    "src/mod_fs/properties/read_lines_core.cpp",
778    "src/mod_fs/properties/read_text_core.cpp",
779    "src/mod_fs/properties/rename_core.cpp",
780    "src/mod_fs/properties/rmdir_core.cpp",
781    "src/mod_fs/properties/stat_core.cpp",
782    "src/mod_fs/properties/symlink_core.cpp",
783    "src/mod_fs/properties/truncate_core.cpp",
784    "src/mod_fs/properties/unlink_core.cpp",
785    "src/mod_fs/properties/utimes_core.cpp",
786    "src/mod_fs/properties/watcher_core.cpp",
787    "src/mod_fs/properties/write_core.cpp",
788    "src/mod_fs/properties/xattr_core.cpp",
789  ]
790  deps = [
791    ":ohos_file_fs_abc_etc",
792    "${file_api_path}/interfaces/kits/native:remote_uri_native",
793    "${file_api_path}/interfaces/kits/native:task_signal_native",
794    "${file_api_path}/interfaces/kits/rust:rust_file",
795    "${utils_path}/filemgmt_libfs:filemgmt_libfs",
796    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
797  ]
798  use_exceptions = true
799  external_deps = [
800    "ability_runtime:ability_manager",
801    "app_file_service:fileuri_native",
802    "bounds_checking_function:libsec_shared",
803    "bundle_framework:appexecfwk_base",
804    "bundle_framework:appexecfwk_core",
805    "c_utils:utils",
806    "data_share:datashare_common",
807    "data_share:datashare_consumer",
808    "dfs_service:distributed_file_daemon_kit_inner",
809    "dfs_service:libdistributedfileutils",
810    "eventhandler:libeventhandler",
811    "hilog:libhilog",
812    "hisysevent:libhisysevent",
813    "ipc:ipc_core",
814    "libuv:uv",
815    "runtime_core:ani",
816    "runtime_core:ani_helpers",
817    "runtime_core:libarkruntime",
818    "samgr:samgr_proxy",
819  ]
820
821  branch_protector_ret = "pac_ret"
822  sanitize = {
823    integer_overflow = true
824    ubsan = true
825    boundary_sanitize = true
826    cfi = true
827    cfi_cross_dso = true
828    debug = false
829  }
830  output_extension = "so"
831  subsystem_name = "filemanagement"
832  part_name = "file_api"
833}
834
835generate_static_abc("ohos_file_fs_abc") {
836  base_url = "./src/mod_fs/ani/ets"
837  files = [ "./src/mod_fs/ani/ets/@ohos.file.fs.ets" ]
838  is_boot_abc = "True"
839  device_dst_file = "/system/framework/ohos_file_fs_abc.abc"
840}
841
842ohos_prebuilt_etc("ohos_file_fs_abc_etc") {
843  source = "$target_out_dir/ohos_file_fs_abc.abc"
844  module_install_dir = "framework"
845  subsystem_name = "filemanagement"
846  part_name = "file_api"
847  deps = [ ":ohos_file_fs_abc" ]
848}
849
850ohos_shared_library("ani_file_hash") {
851  public_configs = [ ":ani_config" ]
852  include_dirs = [
853    "src/mod_hash",
854    "src/mod_hash/ani",
855    "src/mod_hash/class_hashstream",
856    "src/mod_hash/class_hashstream/ani",
857  ]
858  sources = [
859    "src/common/ani_helper/ani_signature.cpp",
860    "src/common/ani_helper/error_handler.cpp",
861    "src/common/ani_helper/type_converter.cpp",
862    "src/common/file_helper/fd_guard.cpp",
863    "src/common/file_helper/hash_file.cpp",
864    "src/mod_fs/fs_utils.cpp",
865    "src/mod_hash/ani/bind_function_class.cpp",
866    "src/mod_hash/ani/hash_ani.cpp",
867    "src/mod_hash/class_hashstream/ani/hashstream_ani.cpp",
868    "src/mod_hash/class_hashstream/hs_hashstream.cpp",
869    "src/mod_hash/hash_core.cpp",
870  ]
871
872  deps = [
873    ":ohos_file_hash_abc_etc",
874    "${file_api_path}/interfaces/kits/rust:rust_file",
875    "${utils_path}/filemgmt_libfs:filemgmt_libfs",
876    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
877  ]
878  external_deps = [
879    "eventhandler:libeventhandler",
880    "bounds_checking_function:libsec_shared",
881    "hilog:libhilog",
882    "ipc:ipc_core",
883    "libuv:uv",
884    "openssl:libcrypto_shared",
885    "runtime_core:ani",
886    "runtime_core:ani_helpers",
887    "runtime_core:libarkruntime",
888  ]
889  use_exceptions = true
890
891  branch_protector_ret = "pac_ret"
892  sanitize = {
893    integer_overflow = true
894    ubsan = true
895    boundary_sanitize = true
896    cfi = true
897    cfi_cross_dso = true
898    debug = false
899  }
900  output_extension = "so"
901  subsystem_name = "filemanagement"
902  part_name = "file_api"
903}
904
905generate_static_abc("ohos_file_hash_abc") {
906  base_url = "./src/mod_hash/ani/ets"
907  files = [ "./src/mod_hash/ani/ets/@ohos.file.hash.ets" ]
908  is_boot_abc = "True"
909  device_dst_file = "/system/framework/ohos_file_hash_abc.abc"
910}
911
912ohos_prebuilt_etc("ohos_file_hash_abc_etc") {
913  source = "$target_out_dir/ohos_file_hash_abc.abc"
914  module_install_dir = "framework"
915  subsystem_name = "filemanagement"
916  part_name = "file_api"
917  deps = [ ":ohos_file_hash_abc" ]
918}
919
920ohos_shared_library("ani_file_securitylabel") {
921  public_configs = [ ":ani_config" ]
922  include_dirs = [
923    "src/mod_securitylabel/ani",
924    "src/mod_securitylabel",
925  ]
926  sources = [
927    "src/common/ani_helper/ani_signature.cpp",
928    "src/common/ani_helper/error_handler.cpp",
929    "src/common/ani_helper/type_converter.cpp",
930    "src/common/file_helper/fd_guard.cpp",
931    "src/mod_fs/fs_utils.cpp",
932    "src/mod_securitylabel/ani/bind_function_class.cpp",
933    "src/mod_securitylabel/ani/securitylabel_ani.cpp",
934    "src/mod_securitylabel/securitylabel_core.cpp",
935  ]
936
937  deps = [
938    ":ohos_file_securityLabel_abc_etc",
939    "${file_api_path}/interfaces/kits/rust:rust_file",
940    "${utils_path}/filemgmt_libfs:filemgmt_libfs",
941    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
942  ]
943  external_deps = [
944    "bounds_checking_function:libsec_shared",
945    "eventhandler:libeventhandler",
946    "hilog:libhilog",
947    "ipc:ipc_core",
948    "libuv:uv",
949    "runtime_core:ani",
950    "runtime_core:ani_helpers",
951    "runtime_core:libarkruntime",
952  ]
953  use_exceptions = true
954
955  branch_protector_ret = "pac_ret"
956  sanitize = {
957    integer_overflow = true
958    ubsan = true
959    boundary_sanitize = true
960    cfi = true
961    cfi_cross_dso = true
962    debug = false
963  }
964  output_extension = "so"
965  subsystem_name = "filemanagement"
966  part_name = "file_api"
967}
968
969generate_static_abc("ohos_file_securityLabel_abc") {
970  base_url = "./src/mod_securitylabel/ani/ets"
971  files = [ "./src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets" ]
972  is_boot_abc = "True"
973  device_dst_file = "/system/framework/ohos_file_securityLabel_abc.abc"
974}
975
976ohos_prebuilt_etc("ohos_file_securityLabel_abc_etc") {
977  source = "$target_out_dir/ohos_file_securityLabel_abc.abc"
978  module_install_dir = "framework"
979  subsystem_name = "filemanagement"
980  part_name = "file_api"
981  deps = [ ":ohos_file_securityLabel_abc" ]
982}
983
984ohos_shared_library("ani_file_environment") {
985  public_configs = [ ":ani_config" ]
986  include_dirs = [
987    "src/mod_environment/ani",
988    "src/mod_environment",
989  ]
990
991  sources = [
992    "src/common/ani_helper/ani_signature.cpp",
993    "src/common/ani_helper/error_handler.cpp",
994    "src/common/ani_helper/type_converter.cpp",
995    "src/common/file_helper/fd_guard.cpp",
996    "src/mod_environment/ani/bind_function_class.cpp",
997    "src/mod_environment/ani/environment_ani.cpp",
998    "src/mod_environment/environment_core.cpp",
999    "src/mod_fs/fs_utils.cpp",
1000  ]
1001
1002  deps = [
1003    ":ohos_file_environment_abc_etc",
1004    "${file_api_path}/interfaces/kits/rust:rust_file",
1005    "${utils_path}/filemgmt_libfs:filemgmt_libfs",
1006    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
1007  ]
1008
1009  external_deps = [
1010    "access_token:libaccesstoken_sdk",
1011    "access_token:libtokenid_sdk",
1012    "bounds_checking_function:libsec_shared",
1013    "eventhandler:libeventhandler",
1014    "hilog:libhilog",
1015    "init:libbegetutil",
1016    "ipc:ipc_core",
1017    "libuv:uv",
1018    "openssl:libcrypto_shared",
1019    "os_account:os_account_innerkits",
1020    "runtime_core:ani",
1021    "runtime_core:ani_helpers",
1022    "runtime_core:libarkruntime",
1023  ]
1024  use_exceptions = true
1025
1026  branch_protector_ret = "pac_ret"
1027  sanitize = {
1028    integer_overflow = true
1029    ubsan = true
1030    boundary_sanitize = true
1031    cfi = true
1032    cfi_cross_dso = true
1033    debug = false
1034  }
1035  output_extension = "so"
1036  subsystem_name = "filemanagement"
1037  part_name = "file_api"
1038}
1039
1040generate_static_abc("ohos_file_environment_abc") {
1041  base_url = "./src/mod_environment/ani/ets"
1042  files = [ "./src/mod_environment/ani/ets/@ohos.file.environment.ets" ]
1043  is_boot_abc = "True"
1044  device_dst_file = "/system/framework/ohos_file_environment_abc.abc"
1045}
1046
1047ohos_prebuilt_etc("ohos_file_environment_abc_etc") {
1048  source = "$target_out_dir/ohos_file_environment_abc.abc"
1049  module_install_dir = "framework"
1050  subsystem_name = "filemanagement"
1051  part_name = "file_api"
1052  deps = [ ":ohos_file_environment_abc" ]
1053}
1054
1055ohos_shared_library("ani_file_statvfs") {
1056  public_configs = [ ":ani_config" ]
1057  include_dirs = [
1058    "src/mod_statvfs/ani",
1059    "src/mod_statvfs",
1060  ]
1061  sources = [
1062    "src/common/ani_helper/ani_signature.cpp",
1063    "src/common/ani_helper/error_handler.cpp",
1064    "src/common/ani_helper/type_converter.cpp",
1065    "src/common/file_helper/fd_guard.cpp",
1066    "src/mod_fs/fs_utils.cpp",
1067    "src/mod_statvfs/ani/bind_function_class.cpp",
1068    "src/mod_statvfs/ani/statvfs_ani.cpp",
1069    "src/mod_statvfs/statvfs_core.cpp",
1070  ]
1071
1072  deps = [
1073    ":ohos_file_statvfs_abc_etc",
1074    "${file_api_path}/interfaces/kits/rust:rust_file",
1075    "${utils_path}/filemgmt_libfs:filemgmt_libfs",
1076    "${utils_path}/filemgmt_libhilog:filemgmt_libhilog",
1077  ]
1078  external_deps = [
1079    "bounds_checking_function:libsec_shared",
1080    "eventhandler:libeventhandler",
1081    "hilog:libhilog",
1082    "ipc:ipc_core",
1083    "libuv:uv",
1084    "runtime_core:ani",
1085    "runtime_core:ani_helpers",
1086    "runtime_core:libarkruntime",
1087  ]
1088  use_exceptions = true
1089  cflags = [
1090    "-fdata-sections",
1091    "-ffunction-sections",
1092    "-Oz",
1093  ]
1094  cflags_cc = [
1095    "-fvisibility-inlines-hidden",
1096    "-Oz",
1097  ]
1098  branch_protector_ret = "pac_ret"
1099  sanitize = {
1100    integer_overflow = true
1101    ubsan = true
1102    boundary_sanitize = true
1103    cfi = true
1104    cfi_cross_dso = true
1105    debug = false
1106  }
1107  output_extension = "so"
1108  subsystem_name = "filemanagement"
1109  part_name = "file_api"
1110}
1111
1112generate_static_abc("ohos_file_statvfs_abc") {
1113  base_url = "./src/mod_statvfs/ani/ets"
1114  files = [ "./src/mod_statvfs/ani/ets/@ohos.file.statvfs.ets" ]
1115  is_boot_abc = "True"
1116  device_dst_file = "/system/framework/ohos_file_statvfs_abc.abc"
1117}
1118
1119ohos_prebuilt_etc("ohos_file_statvfs_abc_etc") {
1120  source = "$target_out_dir/ohos_file_statvfs_abc.abc"
1121  module_install_dir = "framework"
1122  subsystem_name = "filemanagement"
1123  part_name = "file_api"
1124  deps = [ ":ohos_file_statvfs_abc" ]
1125}
1126