Flutter Engine
The Flutter Engine
create.py
Go to the documentation of this file.
1#!/usr/bin/env python
2#
3# Copyright 2017 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8
9"""Create the asset."""
10
11
12import argparse
13import os
14import subprocess
15import sys
16
17FILE_DIR = os.path.dirname(os.path.abspath(__file__))
18INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
19sys.path.insert(0, INFRA_BOTS_DIR)
20import utils
21
22
23# Copied from https://cs.chromium.org/chromium/src/tools/clang/scripts/update.py
24CLANG_REVISION = 'llvmorg-18-init-17730-gf670112a'
25CLANG_SUB_REVISION = 5
26
27PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
28
29# (End copying)
30
31GS_URL = ('https://commondatastorage.googleapis.com/chromium-browser-clang'
32 '/Win/clang-%s.tgz' % PACKAGE_VERSION)
33
34
35def create_asset(target_dir):
36 """Create the asset."""
37 with utils.chdir(target_dir):
38 tarball = 'clang.tgz'
39 subprocess.check_call(['wget', '-O', tarball, GS_URL])
40 subprocess.check_call(['tar', 'zxvf', tarball])
41 os.remove(tarball)
42
43
44def main():
45 parser = argparse.ArgumentParser()
46 parser.add_argument('--target_dir', '-t', required=True)
47 args = parser.parse_args()
48 create_asset(args.target_dir)
49
50
51if __name__ == '__main__':
52 main()
def main()
Definition: create.py:69
def create_asset(target_dir)
Definition: create.py:32
Definition: main.py:1