OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import argparse | 6 import argparse |
7 import os | 7 import os |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 | 10 |
11 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) | 11 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) |
12 SRC_ROOT = os.path.dirname(os.path.dirname(SKY_TOOLS_DIR)) | 12 SRC_ROOT = os.path.dirname(os.path.dirname(SKY_TOOLS_DIR)) |
13 DART_SDK = os.path.join(SRC_ROOT, 'third_party', 'dart-sdk', 'dart-sdk', 'bin') | 13 DART_SDK = os.path.join(SRC_ROOT, 'third_party', 'dart-sdk', 'dart-sdk', 'bin') |
14 | 14 |
15 def main(): | 15 def main(): |
16 parser = argparse.ArgumentParser(description='Packaging tool for Sky apps') | 16 parser = argparse.ArgumentParser(description='Packaging tool for Sky apps') |
17 parser.add_argument('manifest', type=str) | 17 parser.add_argument('--manifest', type=str) |
18 parser.add_argument('--asset-base', type=str) | 18 parser.add_argument('--asset-base', type=str) |
19 parser.add_argument('--snapshot', type=str) | 19 parser.add_argument('--snapshot', type=str) |
20 parser.add_argument('-o', '--output-file', type=str) | 20 parser.add_argument('-o', '--output-file', type=str) |
21 args = parser.parse_args() | 21 args = parser.parse_args() |
22 | 22 |
23 subprocess.check_call([ | 23 command = [ |
24 os.path.join(DART_SDK, 'dart'), | 24 os.path.join(DART_SDK, 'dart'), |
25 os.path.join(SKY_TOOLS_DIR, 'skyx', 'bin', 'skyx.dart'), | 25 os.path.join(SKY_TOOLS_DIR, 'skyx', 'bin', 'skyx.dart'), |
26 '--asset-base', args.asset_base, | 26 '--asset-base', args.asset_base, |
27 '--snapshot', args.snapshot, | 27 '--snapshot', args.snapshot, |
28 '--output-file', args.output_file, | 28 '--output-file', args.output_file, |
29 args.manifest, | 29 ] |
30 ]) | 30 |
| 31 if args.manifest: |
| 32 command += ['--manifest', args.manifest] |
| 33 |
| 34 subprocess.check_call(command) |
31 | 35 |
32 if __name__ == '__main__': | 36 if __name__ == '__main__': |
33 sys.exit(main()) | 37 sys.exit(main()) |
OLD | NEW |