Flutter Engine
The Flutter Engine
Functions | Variables
skp.create_and_upload Namespace Reference

Functions

def main ()
 

Variables

 FILE_DIR = os.path.dirname(os.path.abspath(__file__))
 
 ASSET = os.path.basename(FILE_DIR)
 

Function Documentation

◆ main()

def skp.create_and_upload.main ( )

Definition at line 24 of file create_and_upload.py.

24def main():
25 parser = argparse.ArgumentParser()
26 parser.add_argument('--chrome_src_path', '-c', required=True)
27 parser.add_argument('--browser_executable', '-e', required=True)
28 parser.add_argument('--dm_path', '-d', required=True)
29 parser.add_argument('--upload_to_partner_bucket', action='store_true')
30 parser.add_argument('--dry_run', action='store_true')
31 parser.add_argument('--local', action='store_true')
32 args = parser.parse_args()
33 # Pass the flags to the creation script via environment variables, since
34 # we're calling the script via `sk` and not directly.
35 os.environ[create.BROWSER_EXECUTABLE_ENV_VAR] = args.browser_executable
36 os.environ[create.CHROME_SRC_PATH_ENV_VAR] = args.chrome_src_path
37 os.environ[create.UPLOAD_TO_PARTNER_BUCKET_ENV_VAR] = (
38 '1' if args.upload_to_partner_bucket else '0')
39 os.environ[create.DM_PATH_ENV_VAR] = args.dm_path
40
41 sk = os.path.realpath(os.path.join(
42 FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir, 'bin', 'sk'))
43 if os.name == 'nt':
44 sk += '.exe'
45 if not os.path.isfile(sk):
46 raise Exception('`sk` not found at %s; maybe you need to run bin/fetch-sk?')
47
48 # Find the Chromium revision and supply it as a tag.
49 chromium_revision = subprocess.check_output(
50 ['git', 'rev-parse', 'HEAD'], cwd=args.chrome_src_path).decode().rstrip()
51
52 # Upload the asset.
53 cmd = [
54 sk, 'asset', 'upload',
55 '--tags', 'chromium_revision:%s' % chromium_revision,
56 ]
57 if args.dry_run:
58 cmd.append('--dry-run')
59 if not args.local:
60 cmd.append('--ci')
61 cmd.append('skp')
62 subprocess.check_call(cmd, cwd=FILE_DIR)
63
64
static DecodeResult decode(std::string path)
Definition: png_codec.cpp:124

Variable Documentation

◆ ASSET

skp.create_and_upload.ASSET = os.path.basename(FILE_DIR)

Definition at line 21 of file create_and_upload.py.

◆ FILE_DIR

skp.create_and_upload.FILE_DIR = os.path.dirname(os.path.abspath(__file__))

Definition at line 20 of file create_and_upload.py.