def main(): import command_line parse_source_tree() configuration = configurations.get_selected_configuration() if configuration.name != "__default": ui.bigstep("configuration", str(configurations.get_selected_configuration())) if command_line.args.target: for target in command_line.args.target: targets.build(target) elif command_line.args.all: targets.build_all() else: ui.info("no target selected\n") ui.info(ui.BOLD + "targets:" + ui.RESET) for target in targets.targets.values(): ui.info(" " + str(target)) ui.info(ui.BOLD + "\nconfigurations:" + ui.RESET) for configuration in configurations.configurations: ui.info(" " + str(configuration)) ui.info("\nsee --help for more\n")
def build(name): configuration = configurations.get_selected_configuration() fsutils.make_build_dir(configuration.name) ui.debug("building {} with configuration {!s}".format(name, configuration)) with ui.ident: if name in _built_targets: ui.debug("{} already build, skipping".format(name)) return else: _built_targets.append(name) if name not in targets: ui.fatal("target {} not found".format(name)) target = targets[name] if not target.is_visible(configuration): ui.fatal("target {} is not visible in {!s}".format( name, configuration)) for dependency in target.common_parameters.depends_on.eval(): ui.debug("{} depends on {}".format(name, dependency)) build(dependency) toolchain = compiler.Gnu() target.before() target.build(toolchain) target.after() target.copy_resources(toolchain)
def main(): parse_source_tree() configuration = configurations.get_selected_configuration() if configuration.name != "__default": ui.bigstep("configuration", str(configurations.get_selected_configuration())) if not _build_some_targets_if_requested(): ui.info("no target selected\n") ui.info(ui.BOLD + "targets:" + ui.RESET) for target in targets.targets.values(): ui.info(" " + str(target)) ui.info(ui.BOLD + "\nconfigurations:" + ui.RESET) for configuration in configurations.configurations: ui.info(" " + str(configuration)) ui.info("\nsee --help for more\n")
def build_all(): ui.bigstep("building all targets", " ".join(targets)) configuration = configurations.get_selected_configuration() for name, target in targets.items(): if target.is_visible(configuration): build(name) else: ui.bigstep("skip", name)
def build_all(): ui.bigstep("building all targets", " ".join(targets)) configuration = configurations.get_selected_configuration() for name, target in targets.items(): if target.is_visible(configuration): _build_and_track_single_target(name) else: ui.bigstep("skip", name) _clear_tracked_targets()
def _build_and_track_single_target(name): """ tracking means putting it to special container, when this function is called with the same target, it will be skipped """ configuration = configurations.get_selected_configuration() fsutils.make_build_dir(configuration.name) ui.debug("building {} with configuration {!s}".format(name, configuration)) with ui.ident: if name in _built_targets: ui.debug("{} already build, skipping".format(name)) return else: _built_targets.append(name) if name not in targets: ui.fatal("target {} not found".format(name)) target = targets[name] if not target.is_visible(configuration): ui.fatal("target {} is not visible in {!s}" .format(name, configuration)) for dependency in target.common_parameters.depends_on.eval(): ui.debug("{} depends on {}".format(name, dependency)) build(dependency) toolchain = compiler.Gnu() target.before() target.build(toolchain) target.after() target.copy_resources(toolchain)
def parse_source_tree(): for filename in fsutils.pake_files: pake.parser.parse(filename) configuration = configurations.get_selected_configuration() variables.export_special_variables(configuration)