From dd26f1f7c92a0a15960d48980ffc847374da7a4a Mon Sep 17 00:00:00 2001 From: sj_x <399033946@qq.com> Date: Wed, 27 Aug 2025 19:16:06 -0700 Subject: [PATCH] =?UTF-8?q?filemanagement=E9=94=99=E8=AF=AF=E7=A0=81?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=BE=9D=E8=B5=96=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sj_x <399033946@qq.com> --- filemanagement/common/BUILD.gn | 22 +++++++++++++++++++ .../{fileio => common}/include/error_code.h | 0 filemanagement/environment/BUILD.gn | 1 - .../environment/include/oh_environment.h | 2 +- filemanagement/file_uri/BUILD.gn | 1 - filemanagement/file_uri/include/oh_file_uri.h | 2 +- filemanagement/fileio/BUILD.gn | 2 -- filemanagement/fileio/include/oh_fileio.h | 2 +- filemanagement/fileshare/BUILD.gn | 1 - .../fileshare/include/oh_file_share.h | 2 +- ndk_targets.gni | 1 + 11 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 filemanagement/common/BUILD.gn rename filemanagement/{fileio => common}/include/error_code.h (100%) diff --git a/filemanagement/common/BUILD.gn b/filemanagement/common/BUILD.gn new file mode 100644 index 00000000000..171a58e3007 --- /dev/null +++ b/filemanagement/common/BUILD.gn @@ -0,0 +1,22 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("oh_filemanagement_common_header") { + dest_dir = "$ndk_headers_out_dir/filemanagement/common/" + sources = [ + "./include/error_code.h", + ] +} diff --git a/filemanagement/fileio/include/error_code.h b/filemanagement/common/include/error_code.h similarity index 100% rename from filemanagement/fileio/include/error_code.h rename to filemanagement/common/include/error_code.h diff --git a/filemanagement/environment/BUILD.gn b/filemanagement/environment/BUILD.gn index 55538d9d5c4..d35e59bf8a8 100644 --- a/filemanagement/environment/BUILD.gn +++ b/filemanagement/environment/BUILD.gn @@ -27,7 +27,6 @@ ohos_ndk_library("libohenvironment") { ohos_ndk_headers("oh_environment_header") { dest_dir = "$ndk_headers_out_dir/filemanagement/environment/" sources = [ - "../fileio/include/error_code.h", "./include/oh_environment.h", ] } diff --git a/filemanagement/environment/include/oh_environment.h b/filemanagement/environment/include/oh_environment.h index 299e1272b67..995e3cc9e1b 100644 --- a/filemanagement/environment/include/oh_environment.h +++ b/filemanagement/environment/include/oh_environment.h @@ -35,7 +35,7 @@ #ifndef FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H #define FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H -#include "error_code.h" +#include "../common/error_code.h" #ifdef __cplusplus extern "C" { diff --git a/filemanagement/file_uri/BUILD.gn b/filemanagement/file_uri/BUILD.gn index b2c218f77ab..a6ad950f831 100644 --- a/filemanagement/file_uri/BUILD.gn +++ b/filemanagement/file_uri/BUILD.gn @@ -16,7 +16,6 @@ import("//build/ohos/ndk/ndk.gni") ohos_ndk_headers("oh_file_uri_header") { dest_dir = "$ndk_headers_out_dir/filemanagement/file_uri/" sources = [ - "../fileio/include/error_code.h", "./include/oh_file_uri.h", ] } diff --git a/filemanagement/file_uri/include/oh_file_uri.h b/filemanagement/file_uri/include/oh_file_uri.h index dde24336d1a..2bbc6927686 100644 --- a/filemanagement/file_uri/include/oh_file_uri.h +++ b/filemanagement/file_uri/include/oh_file_uri.h @@ -40,7 +40,7 @@ #ifndef FILE_MANAGEMENT_OH_FILE_URI_H #define FILE_MANAGEMENT_OH_FILE_URI_H -#include "error_code.h" +#include "../common/error_code.h" #include #include #include diff --git a/filemanagement/fileio/BUILD.gn b/filemanagement/fileio/BUILD.gn index 3d7e7d10880..185234c8a02 100644 --- a/filemanagement/fileio/BUILD.gn +++ b/filemanagement/fileio/BUILD.gn @@ -22,14 +22,12 @@ ohos_ndk_library("libohfileio") { system_capability = "SystemCapability.FileManagement.File.FileIO" system_capability_headers = [ "filemanagement/fileio/oh_fileio.h", - "filemanagement/fileio/error_code.h", ] } ohos_ndk_headers("oh_fileio_header") { dest_dir = "$ndk_headers_out_dir/filemanagement/fileio/" sources = [ - "./include/error_code.h", "./include/oh_fileio.h", ] } diff --git a/filemanagement/fileio/include/oh_fileio.h b/filemanagement/fileio/include/oh_fileio.h index b318d4f84ad..9c32dc844ab 100644 --- a/filemanagement/fileio/include/oh_fileio.h +++ b/filemanagement/fileio/include/oh_fileio.h @@ -34,7 +34,7 @@ #ifndef FILE_MANAGEMENT_FILEIO_OH_FILEIO_H #define FILE_MANAGEMENT_FILEIO_OH_FILEIO_H -#include "error_code.h" +#include "../common/error_code.h" #ifdef __cplusplus extern "C" { diff --git a/filemanagement/fileshare/BUILD.gn b/filemanagement/fileshare/BUILD.gn index 3027c40e5dd..22f7c597154 100644 --- a/filemanagement/fileshare/BUILD.gn +++ b/filemanagement/fileshare/BUILD.gn @@ -27,7 +27,6 @@ ohos_ndk_library("libohfileshare") { ohos_ndk_headers("oh_file_share_header") { dest_dir = "$ndk_headers_out_dir/filemanagement/fileshare/" sources = [ - "../fileio/include/error_code.h", "./include/oh_file_share.h", ] } diff --git a/filemanagement/fileshare/include/oh_file_share.h b/filemanagement/fileshare/include/oh_file_share.h index fc89f08edd9..2846fa25e3b 100644 --- a/filemanagement/fileshare/include/oh_file_share.h +++ b/filemanagement/fileshare/include/oh_file_share.h @@ -36,7 +36,7 @@ #ifndef FILE_MANAGEMENT_OH_FILE_SHARE_H #define FILE_MANAGEMENT_OH_FILE_SHARE_H -#include "error_code.h" +#include "../common/error_code.h" #include #ifdef __cplusplus diff --git a/ndk_targets.gni b/ndk_targets.gni index 987a50607c2..5d6af1c88b5 100644 --- a/ndk_targets.gni +++ b/ndk_targets.gni @@ -226,6 +226,7 @@ _ndk_library_targets = [ "//interface/sdk_c/resourceschedule/qos_manager:qos_header", "//interface/sdk_c/resourceschedule/background_process_manager:libbackground_process_manager_ndk", "//interface/sdk_c/resourceschedule/background_process_manager:background_process_manager_header", + "//interface/sdk_c/filemanagement/common:oh_filemanagement_common_header", "//interface/sdk_c/filemanagement/fileio:libohfileio", "//interface/sdk_c/filemanagement/fileio:oh_fileio_header", "//interface/sdk_c/filemanagement/environment:libohenvironment", -- Gitee