• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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")
16
17config("file_share_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "file_share/include",
21    "//third_party/json/include",
22    "../../common/include",
23  ]
24}
25
26config("file_uri_config") {
27  visibility = [ ":*" ]
28  include_dirs = [
29    "file_uri/include",
30    "//third_party/json/include",
31    "../../common/include",
32  ]
33}
34
35ohos_shared_library("fileshare_native") {
36  stack_protector_ret = true
37  sanitize = {
38    integer_overflow = true
39    ubsan = true
40    boundary_sanitize = true
41    cfi = true
42    cfi_cross_dso = true
43    debug = false
44  }
45
46  sources = [
47    "../../common/src/json_utils.cpp",
48    "../../common/src/sandbox_helper.cpp",
49    "file_share/src/file_permission.cpp",
50    "file_share/src/file_share.cpp",
51  ]
52
53  public_configs = [ ":file_share_config" ]
54
55  external_deps = [
56    "ability_base:base",
57    "ability_base:want",
58    "ability_base:zuri",
59    "access_token:libaccesstoken_sdk",
60    "bundle_framework:appexecfwk_base",
61    "c_utils:utils",
62    "file_api:filemgmt_libn",
63    "hilog:libhilog",
64    "ipc:ipc_core",
65    "napi:ace_napi",
66  ]
67  defines = []
68  if (sandbox_manarer) {
69    external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ]
70    defines += [ "SANDBOX_MANAGER" ]
71  }
72  part_name = "app_file_service"
73  subsystem_name = "filemanagement"
74}
75
76ohos_shared_library("fileuri_native") {
77  sources = [
78    "../../common/src/common_func.cpp",
79    "../../common/src/json_utils.cpp",
80    "../../common/src/sandbox_helper.cpp",
81    "file_uri/src/file_uri.cpp",
82  ]
83
84  public_configs = [ ":file_uri_config" ]
85
86  external_deps = [
87    "ability_base:zuri",
88    "bundle_framework:appexecfwk_base",
89    "bundle_framework:appexecfwk_core",
90    "c_utils:utils",
91    "hilog:libhilog",
92    "ipc:ipc_core",
93    "samgr:samgr_proxy",
94  ]
95
96  part_name = "app_file_service"
97  subsystem_name = "filemanagement"
98}
99
100ohos_prebuilt_etc("file_share_sandbox.json") {
101  source = "../../common/file_share_sandbox.json"
102  part_name = "app_file_service"
103  subsystem_name = "filemanagement"
104  module_install_dir = "etc/app_file_service"
105}
106
107config("remote_file_share_config") {
108  visibility = [ ":*" ]
109  include_dirs = [
110    "include",
111    "${utils_system_safwk_path}/native/include",
112    "remote_file_share/include",
113    "//third_party/json/include",
114    "${path_base}/include",
115    "../../common/include",
116    ".",
117  ]
118}
119
120ohos_shared_library("remote_file_share_native") {
121  sources = [
122    "../../common/src/json_utils.cpp",
123    "../../common/src/sandbox_helper.cpp",
124    "remote_file_share/src/remote_file_share.cpp",
125  ]
126
127  public_configs = [ ":remote_file_share_config" ]
128
129  external_deps = [
130    "ability_base:zuri",
131    "c_utils:utils",
132    "hilog:libhilog",
133  ]
134
135  if (defined(global_parts_info) &&
136      defined(global_parts_info.distributedhardware_device_manager)) {
137    external_deps += [ "device_manager:devicemanagersdk" ]
138    defines = [ "ENABLE_DEVICE_MANAGER" ]
139  }
140
141  innerapi_tags = [ "platformsdk_indirect" ]
142  part_name = "app_file_service"
143  subsystem_name = "filemanagement"
144}
145
146config("sandbox_helper_config") {
147  visibility = [ ":*" ]
148  include_dirs = [
149    "include",
150    "${utils_system_safwk_path}/native/include",
151    "//third_party/json/include",
152    "${path_base}/include",
153    "../../common/include",
154    ".",
155  ]
156}
157
158ohos_shared_library("sandbox_helper_native") {
159  sources = [
160    "../../common/src/json_utils.cpp",
161    "../../common/src/sandbox_helper.cpp",
162  ]
163
164  public_configs = [ ":sandbox_helper_config" ]
165
166  external_deps = [
167    "ability_base:zuri",
168    "c_utils:utils",
169    "hilog:libhilog",
170  ]
171
172  innerapi_tags = [ "platformsdk_indirect" ]
173  part_name = "app_file_service"
174  subsystem_name = "filemanagement"
175}
176
177group("app_file_service_native") {
178  deps = [
179    ":fileshare_native",
180    ":fileuri_native",
181    ":remote_file_share_native",
182    ":sandbox_helper_native",
183  ]
184}
185
186group("etc_files") {
187  deps = [ ":file_share_sandbox.json" ]
188}
189