Пример #1
0
def main():
    args = common.parse_args(use_isolate_server=True, use_swarming=False)
    tempdir = unicode(tempfile.mkdtemp(prefix=u'hello_world'))
    try:
        isolated_sha1 = common.archive(tempdir, args.isolate_server,
                                       args.verbose, args.which)

        common.note(
            'Downloading from %s and running in a temporary directory' %
            args.isolate_server)
        cachei = os.path.join(tempdir, u'cachei')
        cachen = os.path.join(tempdir, u'cachen')
        common.run([
            'run_isolated.py',
            '--cache',
            cachei.encode('utf-8'),
            '--named-cache-root',
            cachen.encode('utf-8'),
            '--isolate-server',
            args.isolate_server,
            '--isolated',
            isolated_sha1,
            '--no-log',
            '--',
            args.which + u'.py',
            'Dear 💩',
            '${ISOLATED_OUTDIR}',
        ], args.verbose)
        return 0
    except subprocess.CalledProcessError as e:
        return e.returncode
    finally:
        shutil.rmtree(tempdir)
Пример #2
0
qtc_dir = os.path.abspath('qtcreator')
os.environ['QTC_SOURCE'] = qtc_dir
os.environ['QTC_BUILD'] = qtc_dir

build_dir = 'build'
shutil.rmtree(build_dir, ignore_errors=True)
os.mkdir(build_dir)

env_cmd = '"{}"'.format(env_script)
qmake_cmd = 'qmake "{}"'.format(pro_file)

os.chdir(build_dir)
c.run('{} && {} && {}'.format(env_cmd, qmake_cmd, make_cmd))
os.chdir('..')

translation_cmd = 'lrelease "{}"'.format(pro_file)
c.run('{} && {}'.format(env_cmd, translation_cmd))

os.chdir('qtcreator')
translations = []
with os.scandir(ts_files_dir) as it:
    for entry in it:
        if not entry.name.endswith('.qm'):
            continue
        in_file = ts_files_dir + '/' + entry.name
        out_file = qm_files_dir + '/' + entry.name
        shutil.copy(in_file, out_file)
        translations.append(out_file)

c.archive(translations + [plugin_bin], '../' + archive_name)
Пример #3
0
vcredist_for_ssl_url = ''
vcredist_for_ssl_file = ''
if bitness == '32':
    vcredist_for_ssl_url = 'https://download.microsoft.com/download/C/6/D/C6D0FD4E-9E53-4897-9B91-836EBA2AACD3/vcredist_x86.exe'
    vcredist_for_ssl_file = 'vc_redist.x86.2010.exe'
else:
    vcredist_for_ssl_url = 'https://download.microsoft.com/download/A/8/0/A80747C3-41BD-45DF-B505-E9710D2744E0/vcredist_x64.exe'
    vcredist_for_ssl_file = 'vc_redist.x64.2010.exe'

c.download(vcredist_for_ssl_url,
           os.path.join(install_dir, vcredist_for_ssl_file))

libs_dir = os.path.join(dependencies_dir, 'bin')
for file in os.scandir(libs_dir):
    if file.is_file(follow_symlinks=False) and file.name.endswith('.dll'):
        full_name = os.path.join(libs_dir, file.name)
        c.print('>> Copying {} to {}'.format(full_name, install_dir))
        shutil.copy(full_name, install_dir)

for f in glob(ssl_dir + '/bin/*.dll'):
    c.print('>> Copying {} to {}'.format(f, install_dir))
    shutil.copy(f, install_dir)

open(os.path.join(install_dir, 'qt.conf'),
     'a').close()  # fix for non-latin paths

c.archive(c.get_folder_files(os.path.relpath(install_dir)), artifact_path)

bin_path = install_dir + '\\' + bin_name + '.exe'
c.print('>> Md5 {} {}'.format(bin_path, c.md5sum(bin_path)))
Пример #4
0
def main():
    args = common.parse_args(use_isolate_server=True, use_swarming=True)
    try:
        tempdir = tempfile.mkdtemp(prefix=u'hello_world')
        try:
            isolated_hash = common.archive(tempdir, args.isolate_server,
                                           args.verbose, args.which)

            json_file = os.path.join(tempdir, 'task.json').encode('utf-8')
            common.note('Running on %s' % args.swarming)
            cmd = [
                'swarming.py',
                'trigger',
                '--swarming',
                args.swarming,
                '--isolate-server',
                args.isolate_server,
                '--task-name',
                args.task_name,
                '--dump-json',
                json_file,
                '--isolated',
                isolated_hash,
                '--raw-cmd',
            ]
            for k, v in args.dimensions:
                cmd.extend(('--dimension', k, v))
            if args.idempotent:
                cmd.append('--idempotent')
            if args.priority is not None:
                cmd.extend(('--priority', str(args.priority)))
            if args.service_account:
                cmd.extend(('--service-account', args.service_account))

            cmd.extend(
                ('--', args.which + u'.py', 'Dear 💩', '${ISOLATED_OUTDIR}'))
            common.run(cmd, args.verbose)

            common.note('Getting results from %s' % args.swarming)
            resdir = os.path.join(tempdir, 'results').encode('utf-8')
            common.run([
                'swarming.py',
                'collect',
                '--swarming',
                args.swarming,
                '--json',
                json_file,
                '--task-output-dir',
                resdir,
            ], args.verbose)
            for root, _, files in os.walk(resdir):
                for name in files:
                    p = os.path.join(root, name)
                    with open(p, 'rb') as f:
                        print('%s content:' % p)
                        print(f.read())
            return 0
        finally:
            shutil.rmtree(tempdir)
    except subprocess.CalledProcessError as e:
        return e.returncode