1# Copyright (c) 2021 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("//foundation/filemanagement/app_file_service/app_file_service.gni")
16import("//foundation/filemanagement/app_file_service/backup.gni")
17
18ohos_shared_library("fileshare") {
19  branch_protector_ret = "pac_ret"
20  sanitize = {
21    integer_overflow = true
22    cfi = true
23    cfi_cross_dso = true
24    debug = false
25  }
26
27  include_dirs = [
28    ".",
29    "../../common/include",
30    "${app_file_service_path}/interfaces/innerkits/native/file_share/include",
31  ]
32
33  sources = [
34    "../../common/src/json_utils.cpp",
35    "../../common/src/sandbox_helper.cpp",
36    "../../innerkits/native/file_share/src/file_permission.cpp",
37    "file_share/fileshare_n_exporter.cpp",
38    "file_share/grant_permissions.cpp",
39    "file_share/grant_uri_permission.cpp",
40  ]
41
42  external_deps = [
43    "ability_base:want",
44    "ability_base:zuri",
45    "ability_runtime:abilitykit_native",
46    "ability_runtime:extensionkit_native",
47    "ability_runtime:uri_permission_mgr",
48    "access_token:libaccesstoken_sdk",
49    "access_token:libtokenid_sdk",
50    "bundle_framework:appexecfwk_base",
51    "c_utils:utils",
52    "common_event_service:cesfwk_innerkits",
53    "data_share:datashare_common",
54    "data_share:datashare_consumer",
55    "file_api:filemgmt_libhilog",
56    "file_api:filemgmt_libn",
57    "file_api:remote_uri_native",
58    "hilog:libhilog",
59    "init:libbegetutil",
60    "ipc:ipc_core",
61    "napi:ace_napi",
62  ]
63  defines = []
64  if (sandbox_manarer) {
65    external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ]
66    defines += [
67      "SANDBOX_MANAGER",
68      "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER",
69    ]
70  }
71  relative_install_dir = "module"
72
73  part_name = "app_file_service"
74  subsystem_name = "filemanagement"
75}
76
77ohos_shared_library("fileuri") {
78  branch_protector_ret = "pac_ret"
79  sanitize = {
80    integer_overflow = true
81    cfi = true
82    cfi_cross_dso = true
83    debug = false
84  }
85
86  include_dirs = [
87    ".",
88    "../../common/include",
89    "${app_file_service_path}/interfaces/innerkits/native/file_uri/include",
90  ]
91
92  sources = [
93    "../../common/src/common_func.cpp",
94    "../../common/src/sandbox_helper.cpp",
95    "file_uri/file_uri_n_exporter.cpp",
96    "file_uri/get_uri_from_path.cpp",
97    "file_uri/module.cpp",
98    "file_uri/prop_n_exporter.cpp",
99  ]
100
101  deps =
102      [ "${app_file_service_path}/interfaces/innerkits/native:fileuri_native" ]
103
104  external_deps = [
105    "ability_base:zuri",
106    "ability_runtime:abilitykit_native",
107    "bundle_framework:appexecfwk_base",
108    "bundle_framework:appexecfwk_core",
109    "c_utils:utils",
110    "file_api:filemgmt_libhilog",
111    "file_api:filemgmt_libn",
112    "hilog:libhilog",
113    "ipc:ipc_core",
114    "napi:ace_napi",
115    "samgr:samgr_proxy",
116  ]
117
118  use_exceptions = true
119
120  relative_install_dir = "module/file"
121
122  part_name = "app_file_service"
123  subsystem_name = "filemanagement"
124}
125
126ohos_shared_library("backup") {
127  branch_protector_ret = "pac_ret"
128  sanitize = {
129    integer_overflow = true
130    cfi = true
131    cfi_cross_dso = true
132    debug = false
133  }
134
135  relative_install_dir = "module/file"
136  subsystem_name = "filemanagement"
137  part_name = "app_file_service"
138
139  include_dirs = [ "${path_napi}/interfaces/kits" ]
140
141  defines = [
142    "LOG_DOMAIN=0xD004306",
143    "LOG_TAG=\"BackupNAPI\"",
144  ]
145
146  sources = [
147    "${path_backup_js}/backup/general_callbacks.cpp",
148    "${path_backup_js}/backup/module.cpp",
149    "${path_backup_js}/backup/prop_n_exporter.cpp",
150    "${path_backup_js}/backup/prop_n_operation.cpp",
151    "${path_backup_js}/backup/session_backup_n_exporter.cpp",
152    "${path_backup_js}/backup/session_incremental_backup_n_exporter.cpp",
153    "${path_backup_js}/backup/session_restore_n_exporter.cpp",
154  ]
155
156  deps = [
157    "${path_backup}/interfaces/inner_api/native/backup_kit_inner:backup_kit_inner",
158    "${path_backup}/utils:backup_utils",
159    "${path_jsoncpp}:jsoncpp",
160  ]
161
162  external_deps = [
163    "access_token:libaccesstoken_sdk",
164    "access_token:libtokenid_sdk",
165    "c_utils:utils",
166    "file_api:filemgmt_libhilog",
167    "file_api:filemgmt_libn",
168    "hilog:libhilog",
169    "ipc:ipc_core",
170    "napi:ace_napi",
171  ]
172}
173