diff --git a/compile.py b/compile.py index f180cca7842134082f1de91b01ec50f10384ff92..5a9f94154bbb3472d56c298abe58a4fc0b0d7c07 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'