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