From 021ae0b1af3d265851f2188050f9af8ff78f4b41 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 18 Jun 2019 11:24:17 +0200 Subject: [PATCH] [DEV] add a basic check of all dependency are present --- qworktree/__init__.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/qworktree/__init__.py b/qworktree/__init__.py index 38ec099..3ddcb88 100755 --- a/qworktree/__init__.py +++ b/qworktree/__init__.py @@ -198,7 +198,9 @@ def get_element_depend(_path): return the_element.depend_on return [] -#create object for every elements: +debug.info("======================================================") +debug.info("== Create project element") +debug.info("======================================================") project_elements = [] for elem in tmp_out: @@ -214,6 +216,31 @@ for elem in tmp_out: debug.info("Element: '" + name + "' in path='" + elem + "'") debug.info(" depends: " + str(dependency)) +debug.info("======================================================") +debug.info("== Check if all dependency are availlable") +debug.info("======================================================") +list_of_library = [] +missing_dependency = [] +for elem in tmp_out: + name = get_element_name(elem) + if name not in list_of_library: + list_of_library.append(name) +for elem in tmp_out: + dependency = get_element_depend(elem) + name = get_element_name(elem) + for dep in dependency: + if dep not in list_of_library: + if dep not in missing_dependency: + missing_dependency.append(dep) + debug.info("Element: '" + name + "'") + debug.warning(" depends: " + str(dependency)) + debug.warning(" missing: " + str(dep)) +if len(missing_dependency) != 0: + debug.error("missing dependency: " + str(missing_dependency)) + +debug.info("======================================================") +debug.info("== Ordering elements") +debug.info("======================================================") project_elements_ordered = [] max_loop = len(project_elements) * 10 @@ -307,3 +334,8 @@ tools.file_write_data(os.path.join(tools.get_run_path(), "defines.prf"), out, on debug.info("Create basic qmake project") + +debug.info("======================================================") +debug.info("== ALL is GOOD ==") +debug.info("======================================================") +