def source(args): conf = fetch_config(args) sconf = render_sconf(args.edition, 'html', args.language, conf) with BuildApp.context(conf) as app: with app.context(conf) as prep_app: source_tasks(conf, sconf, prep_app) build_content_generation_tasks(conf, app.add('app')) refresh_dependency_tasks(conf, app.add('app'))
def sphinx_publication(c, args, app): build_prep_tasks(c, app) # this loop will produce an app for each language/edition/builder combination build_source_copies = set() sphinx_app = BuildApp(c) sphinx_app.pool = app.pool jobs = itertools.product(args.editions_to_build, args.languages_to_build, args.builder) for edition, language, builder in jobs: args.language = language args.edition = edition args.builder = builder build_config = fetch_config(args) prep_app = app.add('app') prep_app.conf = build_config primer_app = prep_app.add('app') primer_migration_tasks(build_config, primer_app) sconf = render_sconf(edition, builder, language, build_config) if build_config.paths.branch_source not in build_source_copies: build_source_copies.add(build_config.paths.branch_source) source_tasks(build_config, sconf, prep_app) source_app = prep_app.add('app') build_content_generation_tasks(build_config, source_app) refresh_dependency_tasks(build_config, prep_app) sphinx_tasks(sconf, build_config, sphinx_app) logger.info("adding builder job for {0} ({1}, {2})".format(builder, language, edition)) app.add(sphinx_app) logger.info("sphinx build setup, running now.") app.run() logger.info("sphinx build complete.") logger.info('builds finalized. sphinx output and errors to follow') sphinx_output = '\n'.join([ o[1] for o in sphinx_app.results ]) ret_code = sum([ o[0] for o in sphinx_app.results ]) output_sphinx_stream(sphinx_output, c) ret_code = 0 return ret_code
def get_sphinx_build_configuration(edition, language, builder, args): """ Given an ``edition``, ``language`` and ``builder`` strings and the runtime arguments, return copies of the configuration (``conf``) and sphinx configuration (``sconf``) objects. """ args.language = language args.edition = edition args.builder = builder conf = fetch_config(args) sconf = render_sconf(edition, builder, language, conf) return conf, sconf
def get_sphinx_build_configuration(edition, language, builder, args): """ Given an ``edition``, ``language`` and ``builder`` strings and the runtime arguments, return copies of the configuration (``conf``) and sphinx configuration (``sconf``) objects. """ args._conf = None args = copy.deepcopy(args) args.language = language args.edition = edition args.builder = builder conf = fetch_config(args) args.conf = conf sconf = render_sconf(edition, builder, language, conf) return conf, sconf