解决编译随机失败

Signed-off-by: Mupceet <laiguizhong@huawei.com>
This commit is contained in:
Mupceet 2022-06-30 17:42:27 +08:00
parent 3137109ceb
commit 9f8bad4bef
3 changed files with 29 additions and 63 deletions

View File

@ -130,36 +130,34 @@ def main():
description='A common change param.para file to h.')
parser.add_argument(
'--source',
action='append',
help='The source to change.',
required=True)
parser.add_argument(
'--dest_dir',
help='Path that the source should be changed to.',
required=True)
parser.add_argument(
'--priority',
help='If priority is 1, replace the parameter if it exist.',
required=True)
args = parser.parse_args()
out_dir = args.dest_dir
if not os.path.exists(out_dir):
os.makedirs(out_dir, exist_ok=True)
print(out_dir)
print("out_dir " + out_dir)
source = args.source
assert os.path.exists(source)
for source in args.source:
print("source " + source)
assert os.path.exists(source)
srcDict = GetParamFromCfg(source)
dst = out_dir + "param_cfg.h"
srcDict = GetParamFromCfg(source)
dst = out_dir + "param_cfg.h"
if os.path.exists(dst):
dstDict = GetParamFromCCode(dst)
else:
dstDict = {}
if os.path.exists(dst):
dstDict = GetParamFromCCode(dst)
else:
dstDict = {}
dstDict = AddToCodeDict(dstDict, srcDict, args.priority == "1")
WriteMapToCode(dst, dstDict)
dstDict = AddToCodeDict(dstDict, srcDict, False)
WriteMapToCode(dst, dstDict)
return 0

View File

@ -35,46 +35,20 @@ param_build_defines = [
"BUILD_ROOTHASH=\"${ohos_build_roothash}\"",
]
if (enable_ohos_startup_init_feature_begetctl_liteos) {
action("lite_const_param_to") {
script = "//base/startup/init_lite/scripts/param_cfg_to_code.py"
args = [
"--source",
rebase_path(
"//base/startup/init_lite/services/etc_lite/param/ohos_const/ohos.para"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
"--priority",
"0",
]
outputs = [ "$target_gen_dir/${target_name}_param_cfg_to_code.log" ]
}
action("lite_ohos_param_to") {
script = "//base/startup/init_lite/scripts/param_cfg_to_code.py"
args = [
"--source",
rebase_path("//base/startup/init_lite/services/etc/param/ohos.para"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
"--priority",
"0",
]
outputs = [ "$target_gen_dir/${target_name}_param_cfg_to_code.log" ]
}
action("vendor_param_to") {
script = "//base/startup/init_lite/scripts/param_cfg_to_code.py"
args = [
"--source",
rebase_path("$ohos_product_adapter_dir/utils/sys_param/vendor.para"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
"--priority",
"1",
]
outputs = [ "$target_gen_dir/${target_name}_param_cfg_to_code.log" ]
}
action("lite_ohos_param_to") {
script = "//base/startup/init_lite/scripts/param_cfg_to_code.py"
args = [
"--source",
rebase_path(
"//base/startup/init_lite/services/etc_lite/param/ohos_const/ohos.para"),
"--source",
rebase_path("$ohos_product_adapter_dir/utils/sys_param/vendor.para"),
"--source",
rebase_path("//base/startup/init_lite/services/etc/param/ohos.para"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
]
outputs = [ "$target_gen_dir/${target_name}_param_cfg_to_code.log" ]
}
config("exported_header_files") {
@ -162,11 +136,7 @@ static_library("param_client_lite") {
"DATA_PATH=\"${config_ohos_startup_init_lite_data_path}\"",
]
if (enable_ohos_startup_init_feature_begetctl_liteos) {
deps = [
":lite_const_param_to",
":lite_ohos_param_to",
":vendor_param_to",
]
deps = [ ":lite_ohos_param_to" ]
include_dirs += [ "$root_out_dir/gen/init_lite" ]
defines += [ "PARAM_LOAD_CFG_FROM_CODE" ]
}

View File

@ -139,7 +139,6 @@ if (defined(ohos_lite)) {
if (enable_ohos_startup_init_feature_begetctl_liteos) {
deps += [
"$ohos_product_adapter_dir/utils/sys_param:hal_sysparam",
"//base/startup/init_lite/services/param/liteos:lite_const_param_to",
"//base/startup/init_lite/services/param/liteos:lite_ohos_param_to",
]
include_dirs += [ "$root_out_dir/gen/init_lite" ]
@ -180,8 +179,7 @@ if (defined(ohos_lite)) {
# add cfg.h
if (enable_ohos_startup_init_feature_begetctl_liteos) {
deps += [
"//base/startup/init_lite/services/param:lite_const_param_to",
"//base/startup/init_lite/services/param:lite_ohos_param_to",
"//base/startup/init_lite/services/param/liteos:lite_ohos_param_to",
]
include_dirs += [ "$root_out_dir/gen/init_lite" ]
defines += [ "PARAM_LOAD_CFG_FROM_CODE" ]