示例#1
0
def main():
    rootdir = os.path.realpath(
        os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
    basedir = os.path.join(rootdir, 'static-build')

    os.chdir(os.path.join(rootdir, 'qt'))
    build.shell('git clean -fdx')
    build.shell('git reset --hard HEAD')
    os.chdir(rootdir)
    build.shell('git clean -fdx')
    build.shell('git reset --hard HEAD')
    build.shell('git submodule update')

    status = {}
    for target in get_targets():
        if not build_target(basedir, target):
            status[target] = 'failed'
            continue
        status[target] = 'success'
        build.rmdir(os.path.join(basedir, target))

    build.message('\n\n\nSTATUS\n======\n')
    width = max([len(target) for target in status])
    for target in sorted(status.keys()):
        build.message('%s: %s\n' % (target.ljust(width), status[target]))
示例#2
0
def main():
    rootdir = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
    basedir = os.path.join(rootdir, 'static-build')

    os.chdir(os.path.join(rootdir, 'qt'))
    build.shell('git clean -fdx')
    build.shell('git reset --hard HEAD')
    os.chdir(rootdir)
    build.shell('git clean -fdx')
    build.shell('git reset --hard HEAD')
    build.shell('git submodule update')
    build.mkdir_p(basedir)

    status = {}
    for target in get_targets():
        if not build_target(basedir, target):
            status[target] = 'failed'
            continue
        status[target] = 'success'
        build.rmdir(os.path.join(basedir, target))

    build.message('\n\n\nSTATUS\n======\n')
    width = max([len(target) for target in status])
    for target in sorted(status.keys()):
        build.message('%s: %s\n' % (target.ljust(width), status[target]))
示例#3
0
def build_target(basedir, target):
    build.message('*************** building: %s\n\n' % target)
    log  = open(os.path.join(basedir, '%s.log' % target), 'w')
    proc = subprocess.Popen([sys.executable, 'scripts/build.py', target],
        stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
        bufsize=1, cwd=os.path.join(basedir, '..'))

    proc.stdin.close()
    for line in iter(proc.stdout.readline, ''):
        line = line.rstrip()+'\n'
        if '\r' in line:
            line = line[1+line.rindex('\r'):]
        build.message(line)
        log.write(line)
        log.flush()
    proc.stdout.close()
    return proc.wait() == 0
示例#4
0
def build_target(basedir, target):
    build.message('*************** building: %s\n\n' % target)
    log = open(os.path.join(basedir, '%s.log' % target), 'w')
    proc = subprocess.Popen([sys.executable, 'scripts/build.py', target],
                            stdin=subprocess.PIPE,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.STDOUT,
                            bufsize=1,
                            cwd=os.path.join(basedir, '..'))

    proc.stdin.close()
    for line in iter(proc.stdout.readline, ''):
        line = line.rstrip() + '\n'
        if '\r' in line:
            line = line[1 + line.rindex('\r'):]
        build.message(line)
        log.write(line)
        log.flush()
    proc.stdout.close()
    return proc.wait() == 0
示例#5
0
def build_target(basedir, target):
    build.message("*************** building: %s\n\n" % target)
    build.mkdir_p(basedir)
    log = open(os.path.join(basedir, "%s.log" % target), "w")
    proc = subprocess.Popen(
        [sys.executable, "scripts/build.py", target],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT,
        bufsize=1,
        cwd=os.path.join(basedir, ".."),
    )

    proc.stdin.close()
    for line in iter(proc.stdout.readline, ""):
        line = line.rstrip() + "\n"
        if "\r" in line:
            line = line[1 + line.rindex("\r") :]
        build.message(line)
        log.write(line)
        log.flush()
    proc.stdout.close()
    return proc.wait() == 0
示例#6
0
def main():
    rootdir = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
    basedir = os.path.join(rootdir, "static-build")

    os.chdir(os.path.join(rootdir, "qt"))
    build.shell("git clean -fdx")
    build.shell("git reset --hard HEAD")
    os.chdir(rootdir)
    build.shell("git clean -fdx")
    build.shell("git reset --hard HEAD")
    build.shell("git submodule update")

    status = {}
    for target in PLATFORM_TARGETS.get(platform.system(), []):
        if not build_target(basedir, target):
            status[target] = "failed"
            continue
        status[target] = "success"
        build.rmdir(os.path.join(basedir, target))

    build.message("\n\n\nSTATUS\n======\n")
    width = max([len(target) for target in status])
    for target in sorted(status.keys()):
        build.message("%s: %s\n" % (target.ljust(width), status[target]))