| 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 subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 import os | 9 import os |
| 10 | 10 |
| 11 def main(): | 11 def main(): |
| 12 parser = argparse.ArgumentParser(description='Snapshots Mojo applications') | 12 parser = argparse.ArgumentParser(description='Snapshots Mojo applications') |
| 13 parser.add_argument('executable', type=str) | 13 parser.add_argument('executable', type=str) |
| 14 parser.add_argument('main', type=str) | 14 parser.add_argument('main', type=str) |
| 15 parser.add_argument('--package-root', type=str) | 15 parser.add_argument('--package-root', type=str) |
| 16 parser.add_argument('--snapshot', type=str) | 16 parser.add_argument('--snapshot', type=str) |
| 17 parser.add_argument('--depfile', type=str) |
| 18 parser.add_argument('--build-output', type=str) |
| 17 | 19 |
| 18 args = parser.parse_args() | 20 args = parser.parse_args() |
| 19 if not os.path.isfile(args.executable): | 21 if not os.path.isfile(args.executable): |
| 20 print "file not found: " + args.executable | 22 print "file not found: " + args.executable |
| 21 return subprocess.check_call([ | 23 return subprocess.check_call([ |
| 22 args.executable, | 24 args.executable, |
| 23 args.main, | 25 args.main, |
| 24 '--package-root=%s' % args.package_root, | 26 '--package-root=%s' % args.package_root, |
| 25 '--snapshot=%s' % args.snapshot, | 27 '--snapshot=%s' % args.snapshot, |
| 28 '--depfile=%s' % args.depfile, |
| 29 '--build-output=%s' % args.build_output, |
| 26 ]) | 30 ]) |
| 27 | 31 |
| 28 if __name__ == '__main__': | 32 if __name__ == '__main__': |
| 29 sys.exit(main()) | 33 sys.exit(main()) |
| OLD | NEW |