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('--package-root', type=str) |
17 parser.add_argument('--manifest', type=str) | 18 parser.add_argument('--manifest', type=str) |
18 parser.add_argument('--asset-base', type=str) | 19 parser.add_argument('--asset-base', type=str) |
19 parser.add_argument('--snapshot', type=str) | 20 parser.add_argument('--snapshot', type=str) |
20 parser.add_argument('-o', '--output-file', type=str) | 21 parser.add_argument('-o', '--output-file', type=str) |
21 args = parser.parse_args() | 22 args = parser.parse_args() |
22 | 23 |
23 command = [ | 24 command = [ |
24 os.path.join(DART_SDK, 'dart'), | 25 os.path.join(DART_SDK, 'dart'), |
| 26 '--package-root=%s' % args.package_root, |
25 os.path.join(SKY_TOOLS_DIR, 'skyx', 'bin', 'skyx.dart'), | 27 os.path.join(SKY_TOOLS_DIR, 'skyx', 'bin', 'skyx.dart'), |
26 '--asset-base', args.asset_base, | 28 '--asset-base', args.asset_base, |
27 '--snapshot', args.snapshot, | 29 '--snapshot', args.snapshot, |
28 '--output-file', args.output_file, | 30 '--output-file', args.output_file, |
29 ] | 31 ] |
30 | 32 |
31 if args.manifest: | 33 if args.manifest: |
32 command += ['--manifest', args.manifest] | 34 command += ['--manifest', args.manifest] |
33 | 35 |
34 subprocess.check_call(command) | 36 subprocess.check_call(command) |
35 | 37 |
36 if __name__ == '__main__': | 38 if __name__ == '__main__': |
37 sys.exit(main()) | 39 sys.exit(main()) |
OLD | NEW |