How to use the lbuild.api.Builder function in lbuild

To help you get started, we’ve selected a few lbuild examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github modm-io / modm / tools / scripts / synchronize_docs.py View on Github external
def get_lbuild_in(path):
    builder = lbuild.api.Builder(cwd=path, config=join(path, "project.xml"))
    builder.load()
    return builder.parser
github modm-io / modm / tools / scripts / generate_module_docs.py View on Github external
"targets": target_diff(query.ids, compare=node.ids),
        }
        mprops["queries"].append(op)

    mprops["graph"] = render_dependency_graphs(mprops)
    modules[fullname].append(mprops)

    for child in [c for c in node.children if "filename" in c]:
        format_module(modules, child)



if __name__ == "__main__":
    # lbuild.logger.configure_logger(2)
    lbuild.format.PLAIN = True
    builder = lbuild.api.Builder()

    module_tree, mlens = get_modules(builder)
    all_targets = module_tree.ids

    print(f"Total: {sum(mlens[0])} modules and {sum(mlens[1])} options generated.\n"
          f"Between {min(mlens[0])} and {max(mlens[0])} modules per target.\n"
          f"Up to {max(mlens[1])} options per module.")

    modules = defaultdict(list)
    for c in module_tree.children:
        format_module(modules, c)

    env = Environment()
    env.line_statement_prefix = '%%'
    module_path = repopath("docs/src/reference/module/")
    shutil.rmtree(module_path, ignore_errors=True)
github modm-io / lbuild / lbuild / main.py View on Github external
def run(args):
    lbuild.logger.configure_logger(args.verbose)
    lbuild.facade.VERBOSE_DEPRECATION = args.verbose
    lbuild.format.PLAIN = args.plain

    try:
        command = args.execute_action
    except AttributeError:
        raise lbuild.exception.LbuildArgumentException("No command specified!")

    builder = Builder(config=args.config, options=args.options, collectors=args.collectors)
    return command(args, builder)