Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)