• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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    "//foundation/distributeddatamgr/distributedfile/distributedfile_aafwk.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
29ohos_shared_library("fileio") {
30  subsystem_name = "distributeddatamgr"
31  part_name = "distributedfilejs"
32
33  relative_install_dir = "module"
34
35  include_dirs = [
36    "//third_party/node/src",
37    "//foundation/arkui/napi/interfaces/kits",
38    "//third_party/bounds_checking_function/include",
39    "//third_party/libuv/include",
40    "//third_party/openssl/include",
41    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi",
42    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
43    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/file_helper",
44    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/native/remote_uri",
45  ]
46
47  sources = file_common_src
48  sources += [
49    "src/common/file_helper/hash_file.cpp",
50    "src/mod_fileio/class_constants/constants.cpp",
51    "src/mod_fileio/class_dir/dir_n_exporter.cpp",
52    "src/mod_fileio/class_dirent/dirent_n_exporter.cpp",
53    "src/mod_fileio/class_randomaccessfile/randomaccessfile_n_exporter.cpp",
54    "src/mod_fileio/class_stat/stat_n_exporter.cpp",
55    "src/mod_fileio/class_stream/flush.cpp",
56    "src/mod_fileio/class_stream/stream_n_exporter.cpp",
57    "src/mod_fileio/class_watcher/watcher_n_exporter.cpp",
58    "src/mod_fileio/common_func.cpp",
59    "src/mod_fileio/module.cpp",
60    "src/mod_fileio/properties/chmod.cpp",
61    "src/mod_fileio/properties/chown.cpp",
62    "src/mod_fileio/properties/close.cpp",
63    "src/mod_fileio/properties/copy_file.cpp",
64    "src/mod_fileio/properties/create_randomaccessfile.cpp",
65    "src/mod_fileio/properties/create_stream.cpp",
66    "src/mod_fileio/properties/fchmod.cpp",
67    "src/mod_fileio/properties/fchown.cpp",
68    "src/mod_fileio/properties/fdatasync.cpp",
69    "src/mod_fileio/properties/fdopen_stream.cpp",
70    "src/mod_fileio/properties/fstat.cpp",
71    "src/mod_fileio/properties/fsync.cpp",
72    "src/mod_fileio/properties/ftruncate.cpp",
73    "src/mod_fileio/properties/hash.cpp",
74    "src/mod_fileio/properties/lchown.cpp",
75    "src/mod_fileio/properties/link.cpp",
76    "src/mod_fileio/properties/lseek.cpp",
77    "src/mod_fileio/properties/lstat.cpp",
78    "src/mod_fileio/properties/mkdtemp.cpp",
79    "src/mod_fileio/properties/open.cpp",
80    "src/mod_fileio/properties/open_dir.cpp",
81    "src/mod_fileio/properties/posix_fallocate.cpp",
82    "src/mod_fileio/properties/prop_n_exporter.cpp",
83    "src/mod_fileio/properties/read_dir.cpp",
84    "src/mod_fileio/properties/read_text.cpp",
85    "src/mod_fileio/properties/rename.cpp",
86    "src/mod_fileio/properties/rmdir.cpp",
87    "src/mod_fileio/properties/rmdirent.cpp",
88    "src/mod_fileio/properties/stat.cpp",
89    "src/mod_fileio/properties/symlink.cpp",
90    "src/mod_fileio/properties/truncate.cpp",
91    "src/mod_fileio/properties/watcher.cpp",
92  ]
93
94  deps = [
95    "//foundation/arkui/napi:ace_napi",
96    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/native:remote_uri_native",
97    "//third_party/bounds_checking_function:libsec_static",
98    "//third_party/openssl:libcrypto_static",
99  ]
100
101  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
102}
103
104ohos_shared_library("file") {
105  subsystem_name = "distributeddatamgr"
106  part_name = "distributedfilejs"
107
108  relative_install_dir = "module"
109
110  include_dirs = [
111    "//third_party/node/src",
112    "//foundation/arkui/napi/interfaces/kits",
113    "//third_party/bounds_checking_function/include",
114    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi",
115    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
116    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/file_helper",
117  ]
118
119  sources = file_common_src
120  sources += [
121    "src/common/ability_helper.cpp",
122    "src/mod_file/class_file/file_n_exporter.cpp",
123    "src/mod_file/common_func.cpp",
124    "src/mod_file/module.cpp",
125  ]
126
127  deps = [
128    "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
129    "//foundation/arkui/napi:ace_napi",
130    "//third_party/bounds_checking_function:libsec_static",
131  ]
132
133  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
134}
135
136ohos_shared_library("statfs") {
137  subsystem_name = "distributeddatamgr"
138  part_name = "distributedfilejs"
139
140  relative_install_dir = "module"
141
142  sources = [
143    "src/mod_statfs/statfs_n_exporter.cpp",
144    "src/mod_statfs/statfs_napi.cpp",
145  ]
146
147  deps = [
148    "//foundation/distributeddatamgr/distributedfile/utils/filemgmt_libhilog",
149    "//foundation/distributeddatamgr/distributedfile/utils/filemgmt_libn",
150  ]
151}
152
153ohos_shared_library("environment") {
154  subsystem_name = "distributeddatamgr"
155  part_name = "distributedfilejs"
156
157  relative_install_dir = "module"
158
159  include_dirs = [
160    "//third_party/node/src",
161    "//foundation/arkui/napi/interfaces/kits",
162    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
163  ]
164
165  sources = [
166    "src/common/napi/n_async/n_async_work_callback.cpp",
167    "src/common/napi/n_async/n_async_work_promise.cpp",
168    "src/common/napi/n_async/n_ref.cpp",
169    "src/common/napi/n_func_arg.cpp",
170    "src/common/napi/n_val.cpp",
171    "src/common/uni_error.cpp",
172    "src/mod_environment/environment_n_exporter.cpp",
173    "src/mod_environment/environment_napi.cpp",
174  ]
175
176  deps = [ "//foundation/arkui/napi:ace_napi" ]
177
178  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
179}
180
181ohos_shared_library("securitylabel") {
182  subsystem_name = "distributeddatamgr"
183  part_name = "distributedfilejs"
184
185  relative_install_dir = "module"
186
187  cflags = [ "-Wno-format" ]
188
189  include_dirs = [
190    "//foundation/arkui/napi/interfaces/kits",
191    "//foundation/arkui/ace_engine/frameworks/base/utils",
192    "//foundation/arkui/ace_engine/frameworks",
193    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
194  ]
195
196  sources = file_common_src
197  sources += [
198    "src/mod_securitylabel/securitylabel_n_exporter.cpp",
199    "src/mod_securitylabel/securitylabel_napi.cpp",
200  ]
201
202  deps = [ "//foundation/arkui/napi:ace_napi" ]
203
204  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
205}
206
207ohos_shared_library("document") {
208  subsystem_name = "distributeddatamgr"
209  part_name = "distributedfilejs"
210
211  relative_install_dir = "module"
212
213  include_dirs = [
214    "//third_party/node/src",
215    "//foundation/arkui/napi/interfaces/kits",
216    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
217  ]
218
219  sources = [
220    "src/common/napi/n_async/n_async_work_callback.cpp",
221    "src/common/napi/n_async/n_async_work_promise.cpp",
222    "src/common/napi/n_async/n_ref.cpp",
223    "src/common/napi/n_func_arg.cpp",
224    "src/common/napi/n_val.cpp",
225    "src/common/uni_error.cpp",
226    "src/mod_document/document_n_exporter.cpp",
227    "src/mod_document/document_napi.cpp",
228  ]
229
230  deps = [ "//foundation/arkui/napi:ace_napi" ]
231
232  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
233}
234
235group("build_kits_js") {
236  deps = [
237    ":document",
238    ":environment",
239    ":file",
240    ":fileio",
241    ":securitylabel",
242    ":statfs",
243  ]
244}
245