10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-26 15:12:14 +02:00

Simplify qp_create_ninja and beter debug in module_handler

This commit is contained in:
Thomas Applencourt 2015-06-30 10:34:28 +02:00
parent 22c5bea198
commit 9a1f83d1b8
2 changed files with 17 additions and 11 deletions

View File

@ -333,7 +333,7 @@ def ninja_gitignore_rule():
" description = Create gitignore for $module_rel", ""]
def ninja_gitignore_build(path_module, l_symlink, d_binaries):
def ninja_gitignore_build(path_module, d_binaries):
"""
"""
@ -342,9 +342,9 @@ def ninja_gitignore_build(path_module, l_symlink, d_binaries):
l_b = [i.abs for i in d_binaries[path_module]]
l_sym = [i.destination for i in l_symlink]
l_string = ["build {0}: build_gitignore {1} || {2}".format(path_gitignore,
" ".join(l_b),
" ".join(l_sym)),
l_string = ["build {0}: build_gitignore {1} || l_symlink_{2}".format(path_gitignore,
" ".join(l_b),
path_module.rel),
" module_rel = {0}".format(path_module.rel),
""]
@ -519,10 +519,12 @@ def ninja_readme_build(path_module, d_irp, dict_root_path):
path_readme = join(path_module.abs, "README.rst")
root_module = dict_root_path[module]
l_depend = d_irp[path_module]["l_depend"] + [join(root_module.abs, "tags")]
tags = join(root_module.abs, "tags")
tree = join(root_module.abs, "tree_dependency.png")
l_string = ["build {0}: build_readme {1}".format(path_readme,
" ".join(l_depend)),
l_string = ["build {0}: build_readme {1} {2}".format(path_readme,
tags,
tree),
" module_root = {0}".format(root_module.abs),
" module_abs = {0}".format(path_module.abs),
" module_rel = {0}".format(path_module.rel), ""]
@ -903,7 +905,7 @@ if __name__ == "__main__":
l_string += ninja_binaries_build(module_to_compile, l_children,
d_binaries)
l_string += ninja_gitignore_build(module_to_compile, l_symlink, d_binaries)
l_string += ninja_gitignore_build(module_to_compile, d_binaries)
with open(join(QP_ROOT, "config", "build.ninja"), "w+") as f:
f.write(header)

View File

@ -85,7 +85,7 @@ def get_l_module_descendant(d_child, l_module):
except KeyError:
print >> sys.stderr, "`{0}` not submodule".format(module)
print >> sys.stderr, "Check the corresponding NEEDED_CHILDREN_MODULES"
sys.exit(1)
raise
return list(set(l))
@ -123,8 +123,12 @@ class ModuleHandler():
d_child = self.dict_child
for module_name in d_child:
d[module_name] = get_l_module_descendant(d_child,
d_child[module_name])
try :
d[module_name] = get_l_module_descendant(d_child,
d_child[module_name])
except KeyError:
print "Check NEEDED_CHILDREN_MODULES for {0}".format(module_name)
sys.exit(1)
return d