OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2016 Google Inc. | 3 # Copyright 2016 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 | 8 |
9 """Create the asset and upload it.""" | 9 """Create the asset and upload it.""" |
10 | 10 |
11 | 11 |
12 import argparse | 12 import argparse |
13 import common | 13 import common |
14 import os | 14 import os |
15 import subprocess | 15 import subprocess |
16 import sys | 16 import sys |
17 import utils | 17 import utils |
18 | 18 |
19 | 19 |
20 def main(): | 20 def main(): |
| 21 if sys.platform != 'win32': |
| 22 print >> sys.stderr, 'This script only runs on Windows.' |
| 23 sys.exit(1) |
21 parser = argparse.ArgumentParser() | 24 parser = argparse.ArgumentParser() |
22 parser.add_argument('--gsutil') | 25 parser.add_argument('--gsutil') |
23 parser.add_argument('--chrome_path') | 26 parser.add_argument('--sdk_path', '-s', required=True) |
24 parser.add_argument('--msvs_version', required=True) | 27 parser.add_argument('--runtime_path', '-r', |
| 28 default=os.path.join("C:","System32","vulkan-1.dll"), |
| 29 required=True) |
25 args = parser.parse_args() | 30 args = parser.parse_args() |
26 | 31 |
27 with utils.tmp_dir(): | 32 with utils.tmp_dir(): |
28 cwd = os.getcwd() | 33 cwd = os.getcwd() |
29 create_script = os.path.join(common.FILE_DIR, 'create.py') | 34 create_script = os.path.join(common.FILE_DIR, 'create.py') |
30 upload_script = os.path.join(common.FILE_DIR, 'upload.py') | 35 upload_script = os.path.join(common.FILE_DIR, 'upload.py') |
31 | 36 |
32 try: | 37 try: |
33 cmd = ['python', create_script, | 38 cmd = ['python', create_script, |
34 '-t', cwd, | 39 '-t', cwd, |
35 '--msvs_version', args.msvs_version] | 40 '--sdk_path', args.sdk_path, |
36 if args.chrome_path: | 41 '--runtime_path', args.runtime_path] |
37 cmd.extend(['--chrome_path', args.chrome_path]) | |
38 subprocess.check_call(cmd) | 42 subprocess.check_call(cmd) |
39 cmd = ['python', upload_script, '-t', cwd] | 43 cmd = ['python', upload_script, '-t', cwd] |
40 if args.gsutil: | 44 if args.gsutil: |
41 cmd.extend(['--gsutil', args.gsutil]) | 45 cmd.extend(['--gsutil', args.gsutil]) |
42 subprocess.check_call(cmd) | 46 subprocess.check_call(cmd) |
43 except subprocess.CalledProcessError: | 47 except subprocess.CalledProcessError: |
44 # Trap exceptions to avoid printing two stacktraces. | 48 # Trap exceptions to avoid printing two stacktraces. |
45 sys.exit(1) | 49 sys.exit(1) |
46 | 50 |
47 | 51 |
48 if __name__ == '__main__': | 52 if __name__ == '__main__': |
49 main() | 53 main() |
OLD | NEW |