def _set_deps(self, rule_url, func): da = self.rule_list.setdefault(Rule(rule_url), [None, None]) if da[0] is not None: logger.error('load.dup_rule', rule=rule_url) raise DuplicatedRule(rule_url) da[0] = func logger.info('load.read_deps', rule=rule_url, func=func.__name__)
def _set_action(self, rule_url, func, is_task): da = self.rule_list.setdefault(Rule(rule_url), [None, None]) if da[1] is not None: logger.error('load.dup_rule', rule=rule_url) raise DuplicatedRule(rule_url) da[1] = Action(func, is_task=is_task) logger.info('load.read_action', rule=rule_url, func=func.__name__, is_task=is_task)
def main(): option = parse_args() config_logger(verbose=option.verbose, logfile=option.logfile) logger.info('app.start') rule_list, env = load_file(option.file, create_init_env()) for target in option.targets: logger.info('app.start_target', target=target) result = resolve(target, rule_list, env) if option.resolve: print_deps(target, result) elif option.jobs is not None: execute_parallel(target, result, option.jobs, always_make=option.always_make) else: execute(target, result, always_make=option.always_make) logger.info('app.finish_target', target=target) logger.info('app.finish')
def run_with_output(*args): logger.info('run_cmd', msg=' '.join(args), args=args) return subprocess.check_output(args)
def run(*args): logger.info('run_cmd', msg=' '.join(args), args=args) return subprocess.check_call(args)