def build_command(prefix, pkg, define, test, configure, clean, path, yes, target, generator): """ Build package """ pb = PackageBuild(pkg).merge_defines(define) with prefix.try_("Failed to build package {}".format(pb.to_name())): if configure: prefix.build_configure(pb) elif path: click.echo(prefix.build_path(pb)) elif clean: if not yes: yes = click.confirm( "Are you sure you want to delete the build directory?") if yes: prefix.build_clean(pb) else: prefix.build(pb, test=test, target=target, generator=generator)
def ignore_command(prefix, pkgs): """ Ignore packages """ pbs = [PackageBuild(pkg) for pkg in pkgs] for pb in pbs: with prefix.try_("Failed to ignore package {}".format(pb.to_name()), on_fail=lambda: prefix.remove(pb)): click.echo(prefix.ignore(pb))
def install_command(prefix, pkgs, define, file, test, test_all, update, generator, cmake, debug, release, insecure): """ Install packages """ if debug and release: click.echo("ERROR: debug and release are not supported together") sys.exit(1) variant = 'Release' if debug: variant = 'Debug' if not file and not pkgs: if os.path.exists('dev-requirements.txt'): file = 'dev-requirements.txt' else: file = 'requirements.txt' pbs = [PackageBuild(pkg, cmake=cmake, variant=variant) for pkg in pkgs] for pbu in util.flat([prefix.from_file(file), pbs]): pb = pbu.merge_defines(define) with prefix.try_("Failed to build package {}".format(pb.to_name()), on_fail=lambda: prefix.remove(pb)): click.echo( prefix.install(pb, test=test, test_all=test_all, update=update, generator=generator, insecure=insecure))
def build_command(prefix, pkg, define, test, configure, clean, path, yes, target, generator, debug, release): """ Build package """ pb = PackageBuild(pkg).merge_defines(define) if debug and release: click.echo("ERROR: debug and release are not supported together") sys.exit(1) pb.variant = 'Release' if debug: pb.variant = 'Debug' with prefix.try_("Failed to build package {}".format(pb.to_name())): if configure: prefix.build_configure(pb) elif path: click.echo(prefix.build_path(pb)) elif clean: if not yes: yes = click.confirm( "Are you sure you want to delete the build directory?") if yes: prefix.build_clean(pb) else: prefix.build(pb, test=test, target=target, generator=generator)
def install_command(prefix, pkgs, define, file, test, test_all, update, generator, cmake): """ Install packages """ pbs = [PackageBuild(pkg, define=define, cmake=cmake) for pkg in pkgs] for pb in list(prefix.from_file(file)) + pbs: with prefix.try_("Failed to build package {}".format(pb.to_name()), on_fail=lambda: prefix.remove(pb)): click.echo( prefix.install(pb, test=test, test_all=test_all, update=update, generator=generator))
def install_command(prefix, pkgs, define, file, test, test_all, update, generator): """ Install packages """ pbs = [PackageBuild(pkg) for pkg in pkgs] for pb in list(prefix.from_file(file)) + pbs: try: click.echo( prefix.install(pb.merge(define), test=test, test_all=test_all, update=update, generator=generator)) except: click.echo("Failed to build package {}".format(pb.to_name())) prefix.remove(pb) if prefix.verbose: raise
def install1_command(prefix, pkgs, define, file, test, test_all, update, generator, cmake, debug, release, insecure): """ Install packages """ if debug and release: click.echo("ERROR: debug and release are not supported together") sys.exit(1) variant = 'Release' if debug: variant = 'Debug' pbs = [ PackageBuild(pkg, define=define, cmake=cmake, variant=variant) for pkg in pkgs ] for pb in util.flat([prefix.from_file(file), pbs]): with prefix.try_("Failed to build package {}".format(pb.to_name()), on_fail=lambda: prefix.remove(pb)): click.echo( prefix.install(pb, test=test, test_all=test_all, update=update, generator=generator, insecure=insecure))