From d10cd8075a8ab7fa7557d59d8bb5aa9ca7e21023 Mon Sep 17 00:00:00 2001 From: huangke11 Date: Thu, 27 Apr 2023 13:48:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangke11 --- BUILD.gn | 8 ++++---- bundle.json | 8 ++++---- config_policy.gni | 2 ++ frameworks/config_policy/BUILD.gn | 10 +++++----- .../inner_api/include/config_policy_utils.h | 4 ++-- interfaces/kits/js/BUILD.gn | 10 +++++----- test/unittest/BUILD.gn | 16 +++++++--------- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 408f3b2..0a8f478 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,15 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//base/customization/config_policy/config_policy.gni") +import("./config_policy.gni") group("config_policy_components") { if (os_level == "standard" && support_config_policy_napi && support_jsapi) { deps = [ - "//base/customization/config_policy/frameworks/config_policy:configpolicy_util", - "//base/customization/config_policy/interfaces/kits/js:configpolicy", + "./frameworks/config_policy:configpolicy_util", + "./interfaces/kits/js:configpolicy", ] } else { - deps = [ "//base/customization/config_policy/frameworks/config_policy:configpolicy_util" ] + deps = [ "./frameworks/config_policy:configpolicy_util" ] } } diff --git a/bundle.json b/bundle.json index 380e9d0..581a14b 100644 --- a/bundle.json +++ b/bundle.json @@ -1,7 +1,7 @@ { - "name": "@ohos/customization_config_policy", + "name": "@ohos/config_policy", "description": "The customization framework, namely, cust, provides APIs for each service module to obtain the configuration directories at different levels or the configuration file paths.", - "version": "3.1", + "version": "3.2", "license": "Apache License 2.0", "publishAs": "code-segment", "segment": { @@ -18,8 +18,8 @@ "hisysevent_config": [ "//base/customization/config_policy/frameworks/dfx/hisysevent.yaml" ], - "rom": "", - "ram": "", + "rom": "100KB", + "ram": "50KB", "deps": { "components": [ "common", diff --git a/config_policy.gni b/config_policy.gni index c4a6a69..f334972 100644 --- a/config_policy.gni +++ b/config_policy.gni @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +TEL_CORESERVICE_ROOT_DIR = "//base/telephony/core_service" +STARTUP_INIT_ROOT_DIR = "//base/startup/init" declare_args() { # if fs has prefix before OH path, set it here config_policy_fs_prefix = "" diff --git a/frameworks/config_policy/BUILD.gn b/frameworks/config_policy/BUILD.gn index 7d3cdf7..a3d0e09 100644 --- a/frameworks/config_policy/BUILD.gn +++ b/frameworks/config_policy/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//base/customization/config_policy/config_policy.gni") +import("../../config_policy.gni") if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") } else { @@ -21,10 +21,10 @@ if (defined(ohos_lite)) { config_policy_sources = [ "src/config_policy_utils.c" ] config("config_policy_config") { include_dirs = [ - "//base/customization/config_policy/interfaces/inner_api/include", + "../../interfaces/inner_api/include", "//third_party/bounds_checking_function/include", - "//base/startup/init/services/include/param", - "//base/telephony/core_service/utils/common/include", + "$STARTUP_INIT_ROOT_DIR/services/include/param", + "$TEL_CORESERVICE_ROOT_DIR/utils/common/include", ] } @@ -36,7 +36,7 @@ if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") { defines = [ "ROOT_PREFIX=\"${config_policy_fs_prefix}\"" ] } include_dirs = [ - "//base/customization/config_policy/interfaces/inner_api/include", + "../../interfaces/inner_api/include", "//third_party/bounds_checking_function/include", ] } diff --git a/interfaces/inner_api/include/config_policy_utils.h b/interfaces/inner_api/include/config_policy_utils.h index 705da9f..ec6fcb5 100644 --- a/interfaces/inner_api/include/config_policy_utils.h +++ b/interfaces/inner_api/include/config_policy_utils.h @@ -79,13 +79,13 @@ void FreeCfgDirList(CfgDir *res); // buf: recommended buffer length is MAX_PATH_LEN // followMode: 0/1/10/11/12/100, see FOLLOWX_MODE_* // extra: User defined follow rule, get follow_rule_add_path -// return: path of the highest priority config file, return '\0' when such a file is not found +// return: path of the highest priority config file, return NULL when such a file is not found char *GetOneCfgFileEx(const char *pathSuffix, char *buf, unsigned int bufLength, int followMode, const char *extra); // get the highest priority config file // pathSuffixStr: the relative path of the config file, e.g. "etc/xml/config.xml" // buf: recommended buffer length is MAX_PATH_LEN -// return: path of the highest priority config file, return '\0' when such a file is not found +// return: path of the highest priority config file, return NULL when such a file is not found char *GetOneCfgFile(const char *pathSuffix, char *buf, unsigned int bufLength); // get config files, ordered by priority from low to high diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 2640cea..84477bf 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -15,18 +15,18 @@ import("//build/ohos.gni") ohos_shared_library("configpolicy") { include_dirs = [ - "//base/customization/config_policy/interfaces/inner_api/include", + "include", + "../../../interfaces/inner_api/include", "//third_party/bounds_checking_function/include", - "//base/customization/config_policy/interfaces/kits/js/include", - "//base/customization/config_policy/frameworks/dfx/hisysevent_adapter", + "../../../frameworks/dfx/hisysevent_adapter", ] sources = [ - "//base/customization/config_policy/frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp", + "../../../frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp", "src/config_policy_napi.cpp", ] - deps = [ "//base/customization/config_policy/frameworks/config_policy:configpolicy_util" ] + deps = [ "../../../frameworks/config_policy:configpolicy_util" ] external_deps = [ "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index b487b76..8d02591 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("../../config_policy.gni") if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/test.gni") @@ -20,14 +21,11 @@ if (defined(ohos_lite)) { config_policy_sources = [ "config_policy_utils_test.cpp" ] config_policy_include_dirs = [ - "//base/customization/config_policy/interfaces/inner_api/include", - "//base/startup/init/services/include/param", - "//base/telephony/core_service/utils/common/include", -] -config_policy_deps = [ - "//base/customization/config_policy/frameworks/config_policy:configpolicy_util", - "//base/startup/init/interfaces/innerkits:libbegetutil", + "../../interfaces/inner_api/include", + "$STARTUP_INIT_ROOT_DIR/services/include/param", + "$TEL_CORESERVICE_ROOT_DIR/utils/common/include", ] +config_policy_deps = [ "../../frameworks/config_policy:configpolicy_util" ] if (defined(ohos_lite)) { unittest("ConfigPolicyUtilsTest") { @@ -45,7 +43,7 @@ if (defined(ohos_lite)) { sources = config_policy_sources include_dirs = config_policy_include_dirs deps = config_policy_deps - resource_config_file = - "//base/customization/config_policy/test/resource/ohos_test.xml" + external_deps = [ "init:libbegetutil" ] + resource_config_file = "../../test/resource/ohos_test.xml" } } -- Gitee From 5cf9e757165fc7d8d6489bbffafe14b5b50486fe Mon Sep 17 00:00:00 2001 From: huangke11 Date: Thu, 27 Apr 2023 14:23:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BC=96=E8=AF=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangke11 --- bundle.json | 2 +- test/unittest/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundle.json b/bundle.json index 581a14b..641d194 100644 --- a/bundle.json +++ b/bundle.json @@ -1,7 +1,7 @@ { "name": "@ohos/config_policy", "description": "The customization framework, namely, cust, provides APIs for each service module to obtain the configuration directories at different levels or the configuration file paths.", - "version": "3.2", + "version": 3.2, "license": "Apache License 2.0", "publishAs": "code-segment", "segment": { diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 8d02591..d5285a3 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -44,6 +44,6 @@ if (defined(ohos_lite)) { include_dirs = config_policy_include_dirs deps = config_policy_deps external_deps = [ "init:libbegetutil" ] - resource_config_file = "../../test/resource/ohos_test.xml" + resource_config_file = "../resource/ohos_test.xml" } } -- Gitee