From 20d347a09261975aeab4a9f8fb6c2678de085826 Mon Sep 17 00:00:00 2001 From: chenchi Date: Wed, 13 Oct 2021 10:03:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=84=9A=E6=9C=AC=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=9A=201.=20=E7=BC=96=E8=AF=91=E6=97=B6=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=9A=84=E5=A4=B4=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=85=88=E6=90=9C=E7=B4=A2=E6=9C=AC=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E7=9A=84=E8=B7=AF=E5=BE=84=202.=20=E9=81=8D?= =?UTF-8?q?=E5=8E=86=E7=BB=84=E4=BB=B6=E4=B9=8B=E9=97=B4=E7=9A=84=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=85=B3=E7=B3=BB=E6=97=B6=E7=9A=84=E7=AD=89=E5=BE=85?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E8=B0=83=E6=95=B4=E4=B8=BA=E7=B1=BB=E4=BC=BC?= =?UTF-8?q?=E6=97=B6=E9=92=9F=E6=97=8B=E8=BD=AC=E7=9A=84=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compile.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/compile.py b/compile.py index f180cca..5a9f941 100644 --- a/compile.py +++ b/compile.py @@ -25,8 +25,17 @@ def path_optimizer(comp_path): app_path_split = comp_path.replace('\\', '/').split('/') return '/'.join(list(filter(not_empty, app_path_split))) +animation_idx = 0 +def wait_animation(): + global animation_idx + animation = "|/-\\" + if(animation_idx >= 4): + animation_idx = 0 + print('\b\b' + animation[animation_idx] + ' ', end='', flush=True) + animation_idx += 1 + def search_for_deps(comp_path): - print('.', end='', flush=True) + wait_animation() global dep_dict comp_path = path_optimizer(comp_path) if comp_path in dep_dict: @@ -106,7 +115,7 @@ def search_for_deps(comp_path): def dependency_proc(component, last = None): global dep_dict - print('.', end='', flush=True) + wait_animation() if 'COMP_DEPS' in dep_dict[component]: if last: last_dep = dep_dict[last]['COMP_DEPS'] @@ -117,8 +126,15 @@ def dependency_proc(component, last = None): dependency_proc(comp, component) def compile_option_proc(component, last = []): - print('.', end='', flush=True) + wait_animation() global dep_dict + if 'LOCAL_INCS' in dep_dict[component]: + for inc in dep_dict[component]['LOCAL_INCS']: + if 'INC_COLLECT' not in dep_dict[component]: + dep_dict[component]['INC_COLLECT'] = [] + inc = component + '/' + inc + if inc not in dep_dict[component]['INC_COLLECT']: + dep_dict[component]['INC_COLLECT'].append(inc) if 'GLOBAL_INCS' in dep_dict[component]: for inc in dep_dict[component]['GLOBAL_INCS']: if 'INC_COLLECT' not in dep_dict[component]: @@ -132,13 +148,6 @@ def compile_option_proc(component, last = []): if 'INC_COLLECT' in dep_dict[lst] and inc not in dep_dict[lst]['INC_COLLECT']: if 'COMP_DEPS' in dep_dict[lst] and component in dep_dict[lst]['COMP_DEPS']: dep_dict[lst]['INC_COLLECT'].append(inc) - if 'LOCAL_INCS' in dep_dict[component]: - for inc in dep_dict[component]['LOCAL_INCS']: - if 'INC_COLLECT' not in dep_dict[component]: - dep_dict[component]['INC_COLLECT'] = [] - inc = component + '/' + inc - if inc not in dep_dict[component]['INC_COLLECT']: - dep_dict[component]['INC_COLLECT'].append(inc) if 'GLOBAL_DEFINE' in dep_dict[component]: for define in dep_dict[component]['GLOBAL_DEFINE']: if 'DEF_COLLECT' not in dep_dict[component]: @@ -194,15 +203,15 @@ def compile_proc(): raise RuntimeError('cmd [%s] execution error' % cmd) def build_proc(app): - print('\n[searching for all components ...]', flush=True) + print('\n[searching for all components ...] ', end = '', flush=True) search_for_deps(app) print('') for k in dep_dict: print('-', k, flush=True) - print('\n[finding dependency among components ...]', flush=True) + print('\n[finding dependency among components ...] ', end = '', flush=True) dependency_proc(app) print('') - print('\n[generating compile options for per component ...]', flush=True) + print('\n[generating compile options for per component ...] ', end = '', flush=True) compile_option_proc(app) print('') dependency_json = os.environ['OUTPUT_TMP_PATH'] + '/' + 'dependency.json' -- Gitee