本文整理汇总了Python中src.build.build_options.OPTIONS.configure_jobs方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.configure_jobs方法的具体用法?Python OPTIONS.configure_jobs怎么用?Python OPTIONS.configure_jobs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.build.build_options.OPTIONS
的用法示例。
在下文中一共展示了OPTIONS.configure_jobs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _generate_shared_lib_depending_ninjas
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import configure_jobs [as 别名]
def _generate_shared_lib_depending_ninjas(ninja_list):
timer = build_common.SimpleTimer()
timer.start('Generating plugin and packaging ninjas', OPTIONS.verbose())
# We must generate plugin/nexe ninjas after make->ninja lazy generation
# so that we have the full list of production shared libraries to
# pass to the load test.
# These modules depend on shared libraries generated in the previous phase.
production_shared_libs = (
ninja_generator.NinjaGenerator.get_production_shared_libs(ninja_list[:]))
generator_list = list(_list_ninja_generators(
_config_loader, 'generate_shared_lib_depending_ninjas'))
if OPTIONS.run_tests():
generator_list.extend(_list_ninja_generators(
_config_loader, 'generate_shared_lib_depending_test_ninjas'))
result_list = ninja_generator_runner.run_in_parallel(
[ninja_generator_runner.GeneratorTask(
config_context,
(generator, production_shared_libs))
for config_context, generator in generator_list],
OPTIONS.configure_jobs())
ninja_list = []
for config_result in result_list:
ninja_list.extend(config_result.generated_ninjas)
ninja_list.sort(key=lambda ninja: ninja.get_module_name())
timer.done()
return ninja_list
示例2: _generate_dependent_ninjas
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import configure_jobs [as 别名]
def _generate_dependent_ninjas(ninja_list):
"""Generate the stage of ninjas coming after all executables."""
timer = build_common.SimpleTimer()
timer.start('Generating dependent ninjas', OPTIONS.verbose())
root_dir_install_all_targets = []
for n in ninja_list:
root_dir_install_all_targets.extend(build_common.get_android_fs_path(p) for
p in n._root_dir_install_targets)
generator_list = _list_ninja_generators(_config_loader,
'generate_binaries_depending_ninjas')
result_list = ninja_generator_runner.run_in_parallel(
[ninja_generator_runner.GeneratorTask(
config_context,
(generator, root_dir_install_all_targets))
for config_context, generator in generator_list],
OPTIONS.configure_jobs())
dependent_ninjas = []
for config_result in result_list:
dependent_ninjas.extend(config_result.generated_ninjas)
notice_ninja = ninja_generator.NoticeNinjaGenerator('notices')
notice_ninja.build_notices(ninja_list + dependent_ninjas)
dependent_ninjas.append(notice_ninja)
all_test_lists_ninja = ninja_generator.NinjaGenerator('all_test_lists')
all_test_lists_ninja.build_all_test_lists(ninja_list)
dependent_ninjas.append(all_test_lists_ninja)
all_unittest_info_ninja = ninja_generator.NinjaGenerator('all_unittest_info')
all_unittest_info_ninja.build_all_unittest_info(ninja_list)
dependent_ninjas.append(all_unittest_info_ninja)
timer.done()
return dependent_ninjas
示例3: _generate_independent_ninjas
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import configure_jobs [as 别名]
def _generate_independent_ninjas(needs_clobbering):
timer = build_common.SimpleTimer()
# Invoke an unordered set of ninja-generators distributed across config
# modules by name, and if that generator is marked for it.
timer.start('Generating independent generate_ninjas', True)
generator_list = list(_list_ninja_generators(
_config_loader, 'generate_ninjas'))
if OPTIONS.run_tests():
generator_list.extend(_list_ninja_generators(
_config_loader, 'generate_test_ninjas'))
task_list = []
cached_result_list = []
cache_miss = {}
for config_context, generator in generator_list:
cache_path = _get_cache_file_path(config_context.config_name,
config_context.entry_point)
config_cache = None
if OPTIONS.enable_config_cache() and not needs_clobbering:
config_cache = _load_config_cache_from_file(cache_path)
if config_cache is not None and config_cache.check_cache_freshness():
cached_result = config_cache.to_config_result()
if cached_result is not None:
cached_result_list.append(cached_result)
continue
task_list.append(ninja_generator_runner.GeneratorTask(
config_context, generator))
cache_miss[cache_path] = config_cache
result_list = ninja_generator_runner.run_in_parallel(
task_list, OPTIONS.configure_jobs())
aggregated_result = {}
ninja_list = []
for config_result in result_list:
cache_path = _get_cache_file_path(config_result.config_name,
config_result.entry_point)
ninja_list.extend(config_result.generated_ninjas)
if cache_path in aggregated_result:
aggregated_result[cache_path].merge(config_result)
else:
aggregated_result[cache_path] = config_result
for cached_result in cached_result_list:
ninja_list.extend(cached_result.generated_ninjas)
cache_to_save = []
if OPTIONS.enable_config_cache():
for cache_path, config_result in aggregated_result.iteritems():
config_cache = cache_miss[cache_path]
if config_cache is None:
config_cache = _config_cache_from_config_result(config_result)
else:
config_cache.refresh_with_config_result(config_result)
cache_to_save.append((config_cache, cache_path))
ninja_list.sort(key=lambda ninja: ninja.get_module_name())
timer.done()
return ninja_list, cache_to_save