def __init__(self, command=None, jobs=None):
"""
:param command: ``cargo`` command; defaults to the context's ``rust.cargo_command``
:type command: basestring or ~types.FunctionType
:param jobs: number of jobs; defaults to CPU count + 1
:type jobs: int
"""
super(CargoBuild, self).__init__()
self.command = lambda ctx: which(ctx.fallback(command, 'rust.cargo_command',
DEFAULT_CARGO_COMMAND))
self.add_argument('build')
self.add_argument_unfiltered('--manifest-path', '$in')
if jobs is None:
jobs = cpu_count() + 1
self.jobs(jobs)
self.hooks.append(_cargo_output_path_hook)
self.hooks.append(_cargo_debug_hook)
评论列表
文章目录