• 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    "//third_party/bounds_checking_function:libsec_static",
97    "//third_party/openssl:libcrypto_static",
98  ]
99
100  external_deps = [ "hilog:libhilog" ]
101}
102
103ohos_shared_library("file") {
104  subsystem_name = "distributeddatamgr"
105  part_name = "distributedfilejs"
106
107  relative_install_dir = "module"
108
109  include_dirs = [
110    "//third_party/node/src",
111    "//foundation/arkui/napi/interfaces/kits",
112    "//third_party/bounds_checking_function/include",
113    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi",
114    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
115    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/file_helper",
116  ]
117
118  sources = file_common_src
119  sources += [
120    "src/common/ability_helper.cpp",
121    "src/mod_file/class_file/file_n_exporter.cpp",
122    "src/mod_file/common_func.cpp",
123    "src/mod_file/module.cpp",
124  ]
125
126  deps = [
127    "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
128    "//foundation/arkui/napi:ace_napi",
129    "//third_party/bounds_checking_function:libsec_static",
130  ]
131
132  external_deps = [ "hilog:libhilog" ]
133}
134
135ohos_shared_library("statfs") {
136  subsystem_name = "distributeddatamgr"
137  part_name = "distributedfilejs"
138
139  relative_install_dir = "module"
140
141  sources = [
142    "src/mod_statfs/statfs_n_exporter.cpp",
143    "src/mod_statfs/statfs_napi.cpp",
144  ]
145
146  deps = [
147    "//foundation/distributeddatamgr/distributedfile/utils/filemgmt_libhilog",
148    "//foundation/distributeddatamgr/distributedfile/utils/filemgmt_libn",
149  ]
150}
151
152ohos_shared_library("environment") {
153  subsystem_name = "distributeddatamgr"
154  part_name = "distributedfilejs"
155
156  relative_install_dir = "module"
157
158  include_dirs = [
159    "//third_party/node/src",
160    "//foundation/arkui/napi/interfaces/kits",
161    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
162  ]
163
164  sources = [
165    "src/common/napi/n_async/n_async_work_callback.cpp",
166    "src/common/napi/n_async/n_async_work_promise.cpp",
167    "src/common/napi/n_async/n_ref.cpp",
168    "src/common/napi/n_func_arg.cpp",
169    "src/common/napi/n_val.cpp",
170    "src/common/uni_error.cpp",
171    "src/mod_environment/environment_n_exporter.cpp",
172    "src/mod_environment/environment_napi.cpp",
173  ]
174
175  deps = [ "//foundation/arkui/napi:ace_napi" ]
176
177  external_deps = [ "hilog:libhilog" ]
178}
179
180ohos_shared_library("securitylabel") {
181  subsystem_name = "distributeddatamgr"
182  part_name = "distributedfilejs"
183
184  relative_install_dir = "module"
185
186  cflags = [ "-Wno-format" ]
187
188  include_dirs = [
189    "//foundation/arkui/napi/interfaces/kits",
190    "//foundation/arkui/ace_engine/frameworks/base/utils",
191    "//foundation/arkui/ace_engine/frameworks",
192    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
193  ]
194
195  sources = file_common_src
196  sources += [
197    "src/mod_securitylabel/securitylabel_n_exporter.cpp",
198    "src/mod_securitylabel/securitylabel_napi.cpp",
199  ]
200
201  deps = [ "//foundation/arkui/napi:ace_napi" ]
202
203  external_deps = [ "hilog:libhilog" ]
204}
205
206ohos_shared_library("document") {
207  subsystem_name = "distributeddatamgr"
208  part_name = "distributedfilejs"
209
210  relative_install_dir = "module"
211
212  include_dirs = [
213    "//third_party/node/src",
214    "//foundation/arkui/napi/interfaces/kits",
215    "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/common/napi/n_async",
216  ]
217
218  sources = [
219    "src/common/napi/n_async/n_async_work_callback.cpp",
220    "src/common/napi/n_async/n_async_work_promise.cpp",
221    "src/common/napi/n_async/n_ref.cpp",
222    "src/common/napi/n_func_arg.cpp",
223    "src/common/napi/n_val.cpp",
224    "src/common/uni_error.cpp",
225    "src/mod_document/document_n_exporter.cpp",
226    "src/mod_document/document_napi.cpp",
227  ]
228
229  deps = [ "//foundation/arkui/napi:ace_napi" ]
230
231  external_deps = [ "hilog:libhilog" ]
232}
233
234group("build_kits_js") {
235  deps = [
236    ":document",
237    ":environment",
238    ":file",
239    ":fileio",
240    ":securitylabel",
241    ":statfs",
242  ]
243}
244