OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 import fnmatch |
| 8 import optparse |
| 9 import os |
| 10 import subprocess |
| 11 import sys |
| 12 |
| 13 from pylib import build_utils |
| 14 |
| 15 |
| 16 def DoDex(options, paths): |
| 17 dx_binary = os.path.join(options.android_sdk_root, 'platform-tools', 'dx') |
| 18 dex_cmd = [dx_binary, '--dex', '--output', options.dex_path] + paths |
| 19 subprocess.check_call(dex_cmd) |
| 20 |
| 21 |
| 22 def main(argv): |
| 23 parser = optparse.OptionParser() |
| 24 parser.add_option('--android-sdk-root', help='Android sdk root directory.') |
| 25 parser.add_option('--dex-path', help='Dex output path.') |
| 26 parser.add_option('--stamp', help='Path to touch on success.') |
| 27 |
| 28 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
| 29 parser.add_option('--ignore', help='Ignored.') |
| 30 |
| 31 options, paths = parser.parse_args() |
| 32 |
| 33 DoDex(options, paths) |
| 34 |
| 35 if options.stamp: |
| 36 build_utils.Touch(options.stamp) |
| 37 |
| 38 |
| 39 if __name__ == '__main__': |
| 40 sys.exit(main(sys.argv)) |
| 41 |
OLD | NEW |