From 7f3e970bd0689044aea74c2fa2a9a420f649cc00 Mon Sep 17 00:00:00 2001 From: huangjie Date: Thu, 2 Feb 2023 14:12:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90napi=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangjie --- frameworks/resmgr/BUILD.gn | 40 ------------------- frameworks/resmgr/libresmgr.versionscript | 13 +----- frameworks/resmgr/test/BUILD.gn | 2 +- interfaces/js/innerkits/core/BUILD.gn | 2 + .../core/libresmgr_napi_core.versionscript | 21 ++++++++++ test/fuzztest/resmgr_fuzzer/BUILD.gn | 2 +- 6 files changed, 26 insertions(+), 54 deletions(-) create mode 100644 interfaces/js/innerkits/core/libresmgr_napi_core.versionscript diff --git a/frameworks/resmgr/BUILD.gn b/frameworks/resmgr/BUILD.gn index 526e6d4..c335f30 100644 --- a/frameworks/resmgr/BUILD.gn +++ b/frameworks/resmgr/BUILD.gn @@ -259,43 +259,3 @@ ohos_shared_library("librawfile") { subsystem_name = "global" part_name = "resource_management" } - -ohos_static_library("global_resmgr_static") { - sources = manager_sources - - sources += - [ "${resmgr_base_path}/dfx/hisysevent_adapter/hisysevent_adapter.cpp" ] - - defines = [ "CONFIG_HILOG" ] - - configs = [ ":resmgr_config" ] - - include_dirs = [ "${resmgr_base_path}/dfx/hisysevent_adapter" ] - - public_configs = [ ":resmgr_public_config" ] - - all_dependent_configs = [ ":global_resmgr_all_deps_config" ] - - deps = [ - "//third_party/bounds_checking_function:libsec_shared", - "//third_party/zlib:shared_libz", - ] - - if (resource_management_support_icu) { - deps += [ - "//third_party/icu/icu4c:shared_icui18n", - "//third_party/icu/icu4c:shared_icuuc", - ] - defines += [ "SUPPORT_GRAPHICS" ] - } - - external_deps = [ - "ability_base:extractortool", - "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", - "hiviewdfx_hilog_native:libhilog", - ] - - subsystem_name = "global" - part_name = "resource_management" -} diff --git a/frameworks/resmgr/libresmgr.versionscript b/frameworks/resmgr/libresmgr.versionscript index b998d5e..225f1db 100644 --- a/frameworks/resmgr/libresmgr.versionscript +++ b/frameworks/resmgr/libresmgr.versionscript @@ -14,18 +14,7 @@ 1.0 { global: extern "C++" { - "OHOS::Global::Resource::CreateResConfig()"; - "OHOS::Global::Resource::CreateResourceManager()"; - "OHOS::Global::Resource::ResourceManager::~ResourceManager()"; - "OHOS::Global::Resource::ResourceManagerImpl::~ResourceManagerImpl()"; - "OHOS::Global::Resource::ResourceManagerImpl::GetResourcePaths()"; - "OHOS::Global::Resource::Utils::LoadResourceFile(std::__h::basic_string, std::__h::allocator > const&, unsigned int&)"; - "OHOS::Global::Resource::GetSysDefault()"; - "OHOS::Global::Resource::UpdateSysDefault(icu_69::Locale const&, bool)"; - "OHOS::Global::Resource::BuildFromString(char const*, char, OHOS::Global::Resource::RState&)"; - "OHOS::Global::Resource::BuildFromParts(char const*, char const*, char const*, OHOS::Global::Resource::RState&)"; - "OHOS::Global::Resource::HapResource::LoadFromIndex(char const*, OHOS::Global::Resource::ResConfigImpl const*, bool)"; - "OHOS::Global::Resource::HapResource::GetQualifiers() const"; + *OHOS::Global::Resource*; }; local: *; diff --git a/frameworks/resmgr/test/BUILD.gn b/frameworks/resmgr/test/BUILD.gn index eb7e183..dcab62f 100644 --- a/frameworks/resmgr/test/BUILD.gn +++ b/frameworks/resmgr/test/BUILD.gn @@ -50,7 +50,7 @@ ohos_unittest("resmgr_test") { } deps = [ - "${resmgr_base_path}/frameworks/resmgr:global_resmgr_static", + "${resmgr_base_path}/frameworks/resmgr:global_resmgr", "//third_party/googletest:gtest_main", "//third_party/zlib:libz", ] diff --git a/interfaces/js/innerkits/core/BUILD.gn b/interfaces/js/innerkits/core/BUILD.gn index 3806819..106843d 100644 --- a/interfaces/js/innerkits/core/BUILD.gn +++ b/interfaces/js/innerkits/core/BUILD.gn @@ -28,6 +28,8 @@ ohos_shared_library("resmgr_napi_core") { "src/resource_manager_addon.cpp", ] + version_script = "libresmgr_napi_core.versionscript" + configs = [ ":resmgr_napi_core_public_config" ] public_configs = [ ":resmgr_napi_core_public_config" ] diff --git a/interfaces/js/innerkits/core/libresmgr_napi_core.versionscript b/interfaces/js/innerkits/core/libresmgr_napi_core.versionscript new file mode 100644 index 0000000..225f1db --- /dev/null +++ b/interfaces/js/innerkits/core/libresmgr_napi_core.versionscript @@ -0,0 +1,21 @@ +# Copyright (c) 2023 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. + +1.0 { + global: + extern "C++" { + *OHOS::Global::Resource*; + }; + local: + *; +}; \ No newline at end of file diff --git a/test/fuzztest/resmgr_fuzzer/BUILD.gn b/test/fuzztest/resmgr_fuzzer/BUILD.gn index 6427c10..210aa0d 100644 --- a/test/fuzztest/resmgr_fuzzer/BUILD.gn +++ b/test/fuzztest/resmgr_fuzzer/BUILD.gn @@ -35,7 +35,7 @@ ohos_fuzztest("ResmgrFuzzTest") { sources = [ "resmgr_fuzzer.cpp" ] deps = [ - "${resmgr_base_path}/frameworks/resmgr:global_resmgr_static", + "${resmgr_base_path}/frameworks/resmgr:global_resmgr", "//third_party/bounds_checking_function:libsec_shared", ] }