diff --git a/filemanagement/common/BUILD.gn b/filemanagement/common/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..171a58e30076b445cff4bd0bbffc5dda22f62343 --- /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 55538d9d5c4103e3ef10eef106f9104b74a24d36..d35e59bf8a8aeab74932242ebe98766708ae9719 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 299e1272b679dfaa396b93d878196a31bad5ecc8..995e3cc9e1b025fcd236382f3890f771404bc40f 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 b2c218f77abb80bf7610d7215689d33eab480a4f..a6ad950f831c4648839c9a97f40703db1894484e 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 dde24336d1afa1b68ff5d630c6daa2dac80ff1f2..2bbc6927686a6fabf79645298671739c409e53fe 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 3d7e7d10880d10b7276ec4bba60a6f53c1621135..185234c8a02c0e29b4004bb4a51b2cb24825d9db 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 b318d4f84ade1251f90c834974bb196fdf8e1bde..9c32dc844abc9e6c9695f4730c9b9a1aefe3c80b 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 3027c40e5dd4f88dbda371842a57237cc17332bd..22f7c597154120c25c6a52e521ecb54572661e0d 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 fc89f08edd9afabcc857ff04d60957f4fbb25a3a..2846fa25e3bbf248da696d134ad40f9241b1a14e 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 987a50607c26300ef3478c548085d61cf4fbbfc4..5d6af1c88b5f637e09844b6007f1788fc253770d 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",