From d72e78a76dd3bdc629cb5fb4db0f6b3b28b337c5 Mon Sep 17 00:00:00 2001 From: heppen Date: Mon, 28 Aug 2023 16:34:11 +0800 Subject: [PATCH] remove useless dependencies --- 0001-remove-useless-dependencies.patch | 323 +++++++++++++++++++++++++ 1 file changed, 323 insertions(+) create mode 100644 0001-remove-useless-dependencies.patch diff --git a/0001-remove-useless-dependencies.patch b/0001-remove-useless-dependencies.patch new file mode 100644 index 0000000..2b5cfd2 --- /dev/null +++ b/0001-remove-useless-dependencies.patch @@ -0,0 +1,323 @@ +From feaa1b46fbd01dc2c0bfda5c6ef1e5a8d7f7158e Mon Sep 17 00:00:00 2001 +From: heppen +Date: Tue, 1 Aug 2023 16:52:49 +0800 +Subject: [PATCH] remove useless dependencies + +--- + bundle.json | 24 ++----------------- + frameworks/js/napi/dataability/BUILD.gn | 2 +- + frameworks/js/napi/rdb/BUILD.gn | 6 ++--- + frameworks/js/napi/relationalstore/BUILD.gn | 6 ++--- + frameworks/native/rdb/src/rdb_store_impl.cpp | 2 +- + frameworks/native/rdb/src/security_policy.cpp | 12 ++++++---- + .../native/rdb/src/sqlite_sql_builder.cpp | 4 ++-- + interfaces/inner_api/rdb/BUILD.gn | 4 ++-- + .../rdb/include/abs_shared_result_set.h | 2 +- + .../rdb_data_ability_adapter/BUILD.gn | 12 +++++----- + .../inner_api/rdb_data_share_adapter/BUILD.gn | 16 ++++++------- + test/native/rdb_data_share_adapter/BUILD.gn | 2 +- + 12 files changed, 38 insertions(+), 54 deletions(-) + +diff --git a/bundle.json b/bundle.json +index f6b926a..d837179 100644 +--- a/bundle.json ++++ b/bundle.json +@@ -73,16 +73,14 @@ + "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/appdatafwk:native_appdatafwk", + "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/dataability:native_dataability", + "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb_data_share_adapter:rdb_data_share_adapter", +- "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb:native_rdb", +- "//foundation/distributeddatamgr/relational_store/frameworks/js/napi/dataability:dataability", +- "//foundation/distributeddatamgr/relational_store/frameworks/js/napi/rdb:rdb", +- "//foundation/distributeddatamgr/relational_store/frameworks/js/napi/relationalstore:relationalstore" ++ "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb:native_rdb" + ], + "inner_kits": [ + { + "name": "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb:native_rdb", + "header": { + "header_files": [ ++ "abs_predicates.h", + "abs_rdb_predicates.h", + "abs_result_set.h", + "abs_shared_result_set.h", +@@ -119,24 +117,6 @@ + ], + "header_base": "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/dataability/include" + } +- }, +- { +- "name": "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb_data_share_adapter:rdb_data_share_adapter", +- "header": { +- "header_files": [ +- "rdb_utils.h" +- ], +- "header_base": "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb_data_share_adapter/include" +- } +- }, +- { +- "name": "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb_data_ability_adapter:rdb_data_ability_adapter", +- "header": { +- "header_files": [ +- "rdb_data_ability_utils.h" +- ], +- "header_base": "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb_data_ability_adapter/include" +- } + } + ], + "test": [ +diff --git a/frameworks/js/napi/dataability/BUILD.gn b/frameworks/js/napi/dataability/BUILD.gn +index 6e8d1bd..523f7df 100644 +--- a/frameworks/js/napi/dataability/BUILD.gn ++++ b/frameworks/js/napi/dataability/BUILD.gn +@@ -39,7 +39,7 @@ ohos_shared_library("dataability") { + + external_deps = [ + "hilog_native:libhilog", +- "napi:ace_napi", ++ # "napi:ace_napi", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] +diff --git a/frameworks/js/napi/rdb/BUILD.gn b/frameworks/js/napi/rdb/BUILD.gn +index 2145263..089d1f5 100644 +--- a/frameworks/js/napi/rdb/BUILD.gn ++++ b/frameworks/js/napi/rdb/BUILD.gn +@@ -12,7 +12,7 @@ + # limitations under the License. + import("//build/ohos.gni") + import("//build/ohos/ace/ace.gni") +-import("//foundation/distributeddatamgr/data_share/datashare.gni") ++# import("//foundation/distributeddatamgr/data_share/datashare.gni") + import("//foundation/distributeddatamgr/relational_store/relational_store.gni") + + ohos_copy("relational_store_declaration") { +@@ -79,8 +79,8 @@ ohos_shared_library("rdb") { + ] + + external_deps = [ +- "ability_runtime:abilitykit_native", +- "ability_runtime:napi_base_context", ++ # "ability_runtime:abilitykit_native", ++ # "ability_runtime:napi_base_context", + "c_utils:utils", + "hilog_native:libhilog", + "hitrace_native:hitrace_meter", +diff --git a/frameworks/js/napi/relationalstore/BUILD.gn b/frameworks/js/napi/relationalstore/BUILD.gn +index 0e99278..c15db9c 100644 +--- a/frameworks/js/napi/relationalstore/BUILD.gn ++++ b/frameworks/js/napi/relationalstore/BUILD.gn +@@ -12,7 +12,7 @@ + # limitations under the License. + import("//build/ohos.gni") + import("//build/ohos/ace/ace.gni") +-import("//foundation/distributeddatamgr/data_share/datashare.gni") ++# import("//foundation/distributeddatamgr/data_share/datashare.gni") + import("//foundation/distributeddatamgr/relational_store/relational_store.gni") + + ohos_copy("relational_store_declaration") { +@@ -78,8 +78,8 @@ ohos_shared_library("relationalstore") { + ] + + external_deps = [ +- "ability_runtime:abilitykit_native", +- "ability_runtime:napi_base_context", ++ # "ability_runtime:abilitykit_native", ++ # "ability_runtime:napi_base_context", + "c_utils:utils", + "hilog_native:libhilog", + "hitrace_native:hitrace_meter", +diff --git a/frameworks/native/rdb/src/rdb_store_impl.cpp b/frameworks/native/rdb/src/rdb_store_impl.cpp +index e414050..8093610 100644 +--- a/frameworks/native/rdb/src/rdb_store_impl.cpp ++++ b/frameworks/native/rdb/src/rdb_store_impl.cpp +@@ -934,7 +934,7 @@ int RdbStoreImpl::SetDistributedTables(const std::vector &tables) + RdbSecurityManager::KeyFileType::PUB_KEY_FILE, true); + } + +- LOG_ERROR("success"); ++ LOG_INFO("success"); + return E_OK; + } + +diff --git a/frameworks/native/rdb/src/security_policy.cpp b/frameworks/native/rdb/src/security_policy.cpp +index 910069f..1b513ce 100644 +--- a/frameworks/native/rdb/src/security_policy.cpp ++++ b/frameworks/native/rdb/src/security_policy.cpp +@@ -17,14 +17,16 @@ + + #include "logger.h" + #include "rdb_errno.h" +-#include "security_label.h" ++// #include "security_label.h" + + namespace OHOS { + namespace NativeRdb { + int SecurityPolicy::SetFileSecurityLevel(const std::string &filePath, const std::string &securityLevel) + { +- bool result = DistributedFS::ModuleSecurityLabel::SecurityLabel::SetSecurityLabel(filePath, securityLevel); +- return result ? E_OK : E_ERROR; ++ // bool result = DistributedFS::ModuleSecurityLabel::SecurityLabel::SetSecurityLabel(filePath, securityLevel); ++ (void)filePath; ++ (void)securityLevel; ++ return E_OK; + } + + std::string SecurityPolicy::GetSecurityLevelValue(SecurityLevel securityLevel) +@@ -45,7 +47,9 @@ std::string SecurityPolicy::GetSecurityLevelValue(SecurityLevel securityLevel) + + std::string SecurityPolicy::GetFileSecurityLevel(const std::string &filePath) + { +- return DistributedFS::ModuleSecurityLabel::SecurityLabel::GetSecurityLabel(filePath); ++ (void)filePath; ++ return ""; ++ // return DistributedFS::ModuleSecurityLabel::SecurityLabel::GetSecurityLabel(filePath); + } + + int SecurityPolicy::SetSecurityLabel(const RdbStoreConfig &config) +diff --git a/frameworks/native/rdb/src/sqlite_sql_builder.cpp b/frameworks/native/rdb/src/sqlite_sql_builder.cpp +index 2b0ddd1..d992755 100644 +--- a/frameworks/native/rdb/src/sqlite_sql_builder.cpp ++++ b/frameworks/native/rdb/src/sqlite_sql_builder.cpp +@@ -306,12 +306,12 @@ std::string SqliteSqlBuilder::PredicatesNormalize(const std::string &source, int + } + + auto index = source.rfind("(*"); +- if (index != -1) { ++ if (index != std::string::npos) { + return source; + } + + index = source.rfind("."); +- if (index == -1) { ++ if (index == std::string::npos) { + return StringUtils::SurroundWithQuote(source, "`"); + } + +diff --git a/interfaces/inner_api/rdb/BUILD.gn b/interfaces/inner_api/rdb/BUILD.gn +index 2c0f223..53dd9c6 100644 +--- a/interfaces/inner_api/rdb/BUILD.gn ++++ b/interfaces/inner_api/rdb/BUILD.gn +@@ -147,8 +147,8 @@ ohos_shared_library("native_rdb") { + external_deps = [ + "c_utils:utils", + "hilog_native:libhilog", +- "hitrace_native:hitrace_meter", +- "hitrace_native:libhitracechain", ++ # "hitrace_native:hitrace_meter", ++ # "hitrace_native:libhitracechain", + "huks:libhukssdk", + "ipc:ipc_core", + ] +diff --git a/interfaces/inner_api/rdb/include/abs_shared_result_set.h b/interfaces/inner_api/rdb/include/abs_shared_result_set.h +index 616f729..af9633f 100644 +--- a/interfaces/inner_api/rdb/include/abs_shared_result_set.h ++++ b/interfaces/inner_api/rdb/include/abs_shared_result_set.h +@@ -22,7 +22,7 @@ + #include + + #include "abs_result_set.h" +-#include "message_parcel.h" ++// #include "message_parcel.h" + #include "parcel.h" + #include "shared_block.h" + #include "shared_result_set.h" +diff --git a/interfaces/inner_api/rdb_data_ability_adapter/BUILD.gn b/interfaces/inner_api/rdb_data_ability_adapter/BUILD.gn +index c45f376..edfd798 100644 +--- a/interfaces/inner_api/rdb_data_ability_adapter/BUILD.gn ++++ b/interfaces/inner_api/rdb_data_ability_adapter/BUILD.gn +@@ -11,18 +11,18 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + import("//build/ohos.gni") +-import("//foundation/distributeddatamgr/data_share/datashare.gni") ++# import("//foundation/distributeddatamgr/data_share/datashare.gni") + import("//foundation/distributeddatamgr/relational_store/relational_store.gni") + + config("rdb_data_ability_adapter_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", +- "${datashare_base_path}/interfaces/inner_api/common/include", +- "${datashare_base_path}/interfaces/inner_api/consumer/include", +- "${datashare_base_path}/interfaces/inner_api/provider/include", ++ # "${datashare_base_path}/interfaces/inner_api/common/include", ++ # "${datashare_base_path}/interfaces/inner_api/consumer/include", ++ # "${datashare_base_path}/interfaces/inner_api/provider/include", + "${relational_store_innerapi_path}/rdb/include", +- "${datashare_common_native_path}/include", ++ # "${datashare_common_native_path}/include", + ] + } + +@@ -30,7 +30,7 @@ config("rdb_data_ability_adapter_public_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", +- "${datashare_base_path}/interfaces/inner_api/provider/include", ++ # "${datashare_base_path}/interfaces/inner_api/provider/include", + ] + } + +diff --git a/interfaces/inner_api/rdb_data_share_adapter/BUILD.gn b/interfaces/inner_api/rdb_data_share_adapter/BUILD.gn +index 8af6b42..6493c76 100644 +--- a/interfaces/inner_api/rdb_data_share_adapter/BUILD.gn ++++ b/interfaces/inner_api/rdb_data_share_adapter/BUILD.gn +@@ -11,18 +11,18 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + import("//build/ohos.gni") +-import("//foundation/distributeddatamgr/data_share/datashare.gni") ++# import("//foundation/distributeddatamgr/data_share/datashare.gni") + import("//foundation/distributeddatamgr/relational_store/relational_store.gni") + + config("rdb_data_share_adapter_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", +- "${datashare_base_path}/interfaces/inner_api/common/include", +- "${datashare_base_path}/interfaces/inner_api/consumer/include", +- "${datashare_base_path}/interfaces/inner_api/provider/include", ++ # "${datashare_base_path}/interfaces/inner_api/common/include", ++ # "${datashare_base_path}/interfaces/inner_api/consumer/include", ++ # "${datashare_base_path}/interfaces/inner_api/provider/include", + "${relational_store_innerapi_path}/rdb/include", +- "${datashare_common_native_path}/include", ++ # "${datashare_common_native_path}/include", + ] + } + +@@ -30,14 +30,14 @@ config("rdb_data_share_adapter_public_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", +- "${datashare_base_path}/interfaces/inner_api/provider/include", ++ # "${datashare_base_path}/interfaces/inner_api/provider/include", + ] + } + + ohos_shared_library("rdb_data_share_adapter") { + sources = [ +- "${relational_store_native_path}/rdb_data_share_adapter/src/rdb_result_set_bridge.cpp", +- "${relational_store_native_path}/rdb_data_share_adapter/src/rdb_utils.cpp", ++ # "${relational_store_native_path}/rdb_data_share_adapter/src/rdb_result_set_bridge.cpp", ++ # "${relational_store_native_path}/rdb_data_share_adapter/src/rdb_utils.cpp", + ] + + configs = [ ":rdb_data_share_adapter_config" ] +diff --git a/test/native/rdb_data_share_adapter/BUILD.gn b/test/native/rdb_data_share_adapter/BUILD.gn +index 9e4ad9b..de513b3 100644 +--- a/test/native/rdb_data_share_adapter/BUILD.gn ++++ b/test/native/rdb_data_share_adapter/BUILD.gn +@@ -11,7 +11,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + import("//build/test.gni") +-import("//foundation/distributeddatamgr/data_share/datashare.gni") ++# import("//foundation/distributeddatamgr/data_share/datashare.gni") + import("//foundation/distributeddatamgr/relational_store/relational_store.gni") + + module_output_path = "relational_store/rdb_data_share_adapter" +-- +2.33.0 + -- Gitee