回退 'Pull Request !85 : 【定制框架】独立编译优化'

This commit is contained in:
openharmony_ci
2024-03-11 07:36:41 +00:00
committed by Gitee
parent b878abf537
commit 1b09e2ce6a
7 changed files with 22 additions and 39 deletions
+4 -13
View File
@@ -25,10 +25,11 @@
"hisysevent",
"hilog",
"napi",
"init",
"bounds_checking_function"
"init"
],
"third_party": []
"third_party": [
"bounds_checking_function"
]
},
"build": {
"sub_component": [
@@ -43,16 +44,6 @@
]
},
"name": "//base/customization/config_policy/frameworks/config_policy:configpolicy_util"
},
{
"header": {
"header_base": "//base/customization/config_policy/interfaces/inner_api/include",
"header_files": [
"config_policy_utils.h"
]
},
"name": "//base/customization/config_policy/frameworks/config_policy:configpolicy_util_for_init_static",
"visibility": ["init"]
}
],
"test": [
+15 -14
View File
@@ -20,7 +20,12 @@ if (defined(ohos_lite)) {
config_policy_sources = [ "src/config_policy_utils.c" ]
config("config_policy_config") {
include_dirs = [ "../../interfaces/inner_api/include" ]
include_dirs = [
"../../interfaces/inner_api/include",
"//third_party/bounds_checking_function/include",
"$STARTUP_INIT_ROOT_DIR/interfaces/innerkits/include/param",
"$TEL_CORESERVICE_ROOT_DIR/utils/common/include",
]
}
if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") {
@@ -30,25 +35,26 @@ if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") {
print("cust config_policy_fs_prefix: ${config_policy_fs_prefix}")
defines = [ "ROOT_PREFIX=\"${config_policy_fs_prefix}\"" ]
}
public_configs = [ ":config_policy_config" ]
external_deps = [ "bounds_checking_function:libsec_shared" ]
include_dirs = [
"../../interfaces/inner_api/include",
"//third_party/bounds_checking_function/include",
]
}
} else if (defined(ohos_lite)) {
shared_library("configpolicy_util") {
sources = config_policy_sources
public_configs = [ ":config_policy_config" ]
external_deps = [ "bounds_checking_function:libsec_shared" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
} else {
ohos_shared_library("configpolicy_util") {
sources = config_policy_sources
public_configs = [ ":config_policy_config" ]
include_dirs = [ "$TEL_CORESERVICE_ROOT_DIR/utils/common/include" ]
deps = [ "etc:customization_etc" ]
external_deps = [
"bounds_checking_function:libsec_shared",
"init:libbegetutil",
deps = [
"etc:customization_etc",
"//third_party/bounds_checking_function:libsec_shared",
]
external_deps = [ "init:libbegetutil" ]
install_images = [
"system",
"updater",
@@ -64,11 +70,6 @@ if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") {
ohos_static_library("configpolicy_util_for_init_static") {
sources = config_policy_sources
public_configs = [ ":config_policy_config" ]
include_dirs = [ "$TEL_CORESERVICE_ROOT_DIR/utils/common/include" ]
external_deps = [
"bounds_checking_function:libsec_shared",
"init:export_headers_lib",
]
subsystem_name = "customization"
part_name = "config_policy"
}
@@ -27,10 +27,8 @@
#endif
static const size_t MIN_APPEND_LEN = 32;
#ifndef __LITEOS__
// set min opkey length
static const unsigned int MIN_OPKEY_LEN = 3;
#endif
// ':' split different x rules, example:":relPath,mode[,extra][:]"
// ',' split different param for x rules
// ":-" split for key:-value
+1
View File
@@ -17,6 +17,7 @@ ohos_shared_library("configpolicy") {
include_dirs = [
"include",
"../../../interfaces/inner_api/include",
"//third_party/bounds_checking_function/include",
"../../../frameworks/dfx/hisysevent_adapter",
]
+2 -1
View File
@@ -22,6 +22,7 @@ if (defined(ohos_lite)) {
config_policy_sources = [ "config_policy_utils_test.cpp" ]
config_policy_include_dirs = [
"../../interfaces/inner_api/include",
"$STARTUP_INIT_ROOT_DIR/interfaces/innerkits/include/param",
"$TEL_CORESERVICE_ROOT_DIR/utils/common/include",
]
config_policy_deps = [ "../../frameworks/config_policy:configpolicy_util" ]
@@ -30,7 +31,7 @@ if (defined(ohos_lite)) {
unittest("ConfigPolicyUtilsTest") {
output_extension = "bin"
sources = config_policy_sources
include_dirs = [ "../../interfaces/inner_api/include" ]
include_dirs = config_policy_include_dirs
deps = config_policy_deps
}
group("unittest") {
@@ -19,10 +19,8 @@
#include "config_policy_utils.h"
#include "config_policy_impl.h"
#ifndef __LITEOS__
#include "init_param.h"
#include "telephony_config_c.h"
#endif
using namespace testing::ext;
@@ -32,7 +30,6 @@ class ConfigPolicyUtilsTest : public testing::Test {
static void SetUpTestCase(void);
};
#ifndef __LITEOS__
void ConfigPolicyUtilsTest::SetUpTestCase(void)
{
SystemSetParameter(CUST_OPKEY0, "46060");
@@ -40,7 +37,6 @@ void ConfigPolicyUtilsTest::SetUpTestCase(void)
SystemSetParameter(CUST_FOLLOW_X_RULES,
":etc/custxmltest/user.xml,10:etc/custxmltest/both.xml,100,etc/carrier/${test:-46061}");
}
#endif
bool TestGetCfgFile(const char *testPathSuffix, int type, const char *extra)
{
@@ -135,7 +131,6 @@ HWTEST_F(ConfigPolicyUtilsTest, CfgPolicyUtilsFuncTest005, TestSize.Level1)
EXPECT_TRUE(flag);
}
#ifndef __LITEOS__
/**
* @tc.name: CfgPolicyUtilsFuncTest006
* @tc.desc: Test GetOneCfgFile & GetCfgFiles function, follow default sim rule.
@@ -199,5 +194,4 @@ HWTEST_F(ConfigPolicyUtilsTest, CfgPolicyUtilsFuncTest010, TestSize.Level1)
EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/user.xml", FOLLOWX_MODE_USER_DEFINED, extraString.c_str()));
EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/both.xml", FOLLOWX_MODE_USER_DEFINED, extraString.c_str()));
}
#endif // __LITEOS__
} // namespace OHOS
-3
View File
@@ -21,13 +21,10 @@ int CfgPolicyUtilsFuncTest002(void);
int CfgPolicyUtilsFuncTest003(void);
int CfgPolicyUtilsFuncTest004(void);
int CfgPolicyUtilsFuncTest005(void);
#ifndef __LITEOS__
int CfgPolicyUtilsFuncTest006(void);
int CfgPolicyUtilsFuncTest007(void);
int CfgPolicyUtilsFuncTest008(void);
int CfgPolicyUtilsFuncTest009(void);
int CfgPolicyUtilsFuncTest010(void);
#endif // __LITEOS__
#endif