From a46122c55bee51cc1e9baafbc3c9ba927639c62b Mon Sep 17 00:00:00 2001 From: lixianjing Date: Wed, 1 Nov 2023 17:56:40 +0800 Subject: [PATCH] improve build scripts --- docs/changes.md | 5 +++++ scripts/update_res_common.py | 14 +++++++++----- tools/str_gen/main.cc | 8 +++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/changes.md b/docs/changes.md index c4af6d332..377f3502e 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,4 +1,9 @@ # 最新动态 + +2023/11/1 + * font\_gen修复会同时打包origin默认字体时的报错信息(感谢高源提供补丁) + * str\_gen修复字体内容为空时的报错(感谢高源提供补丁) + 2023/10/30 * 修复conf\_doc\_dup\_node复制数组的问题(感谢俊杰提供补丁)。 * 增加debugger\_get\_curr\_frame\_index函数(感谢智明提供补丁) diff --git a/scripts/update_res_common.py b/scripts/update_res_common.py index 236d92d70..ad37a603a 100755 --- a/scripts/update_res_common.py +++ b/scripts/update_res_common.py @@ -300,7 +300,7 @@ def get_appint_folder(path, regex = '/', include_self = True): for reg in regex_list: folder_list += get_appint_folder_ex(path, reg, [], '') - + if include_self == True: folder_list.append(tuple((path, ''))) return folder_list @@ -652,6 +652,8 @@ def gen_res_all_font(): for f in get_appint_folder(in_files, '.ttf', False): out_files = f[0].replace(INPUT_DIR, join_path(OUTPUT_DIR, 'raw')) out_foler = os.path.dirname(out_files) + if 'origin' in out_foler: + continue if not os.path.exists(out_foler): make_dirs(out_foler) copy_file(f[0], out_files) @@ -699,6 +701,8 @@ def gen_res_all_font(): raw = f[0] filename = filename.replace(INPUT_DIR, join_path(OUTPUT_DIR, 'inc')) inc = filename + '.res' + if "origin" in inc: + continue resgen(raw, inc, THEME, '.res') emit_generate_res_after('font') @@ -1212,12 +1216,12 @@ def get_args(args) : def get_opts(args) : import getopt - longsots = ['awtk_root=', 'AWTK_ROOT=', + longsots = ['awtk_root=', 'AWTK_ROOT=', 'action=', 'ACTION=', 'help', 'HELP', - 'dpi=', 'DPI=', - 'image_options=', 'IMAGE_OPTIONS=', - 'lcd_orientation=', 'LCD_ORIENTATION=', + 'dpi=', 'DPI=', + 'image_options=', 'IMAGE_OPTIONS=', + 'lcd_orientation=', 'LCD_ORIENTATION=', 'lcd_enable_fast_rotation=', 'LCD_ENABLE_FAST_ROTATION=', 'res_config_file=', 'RES_CONFIG_FILE=', 'res_config_script=', 'RES_CONFIG_SCRIPT=', diff --git a/tools/str_gen/main.cc b/tools/str_gen/main.cc index 8b9a8f902..9872a802f 100644 --- a/tools/str_gen/main.cc +++ b/tools/str_gen/main.cc @@ -29,9 +29,11 @@ ret_t gen_one(const char* input_file, const char* output_file, const char* theme, bool_t output_bin) { ret_t ret = RET_OK; - if (!xml_to_str_gen(input_file, output_file, theme, output_bin)) { - ret = RET_FAIL; - GEN_ERROR(input_file); + if (!exit_if_need_not_update(input_file, output_file)) { + if (!xml_to_str_gen(input_file, output_file, theme, output_bin)) { + ret = RET_FAIL; + GEN_ERROR(input_file); + } } return ret; }