| 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 sys | |
| 11 | |
| 12 from pylib import build_utils | |
| 13 | |
| 14 | |
| 15 def DoDex(options, paths): | |
| 16 dx_binary = os.path.join(options.android_sdk_root, 'platform-tools', 'dx') | |
| 17 dex_cmd = [dx_binary, '--dex', '--output', options.dex_path] + paths | |
| 18 build_utils.CheckCallDie(dex_cmd) | |
| 19 | |
| 20 | |
| 21 def main(argv): | |
| 22 parser = optparse.OptionParser() | |
| 23 parser.add_option('--android-sdk-root', help='Android sdk root directory.') | |
| 24 parser.add_option('--dex-path', help='Dex output path.') | |
| 25 parser.add_option('--stamp', help='Path to touch on success.') | |
| 26 | |
| 27 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. | |
| 28 parser.add_option('--ignore', help='Ignored.') | |
| 29 | |
| 30 options, paths = parser.parse_args() | |
| 31 | |
| 32 DoDex(options, paths) | |
| 33 | |
| 34 if options.stamp: | |
| 35 build_utils.Touch(options.stamp) | |
| 36 | |
| 37 | |
| 38 if __name__ == '__main__': | |
| 39 sys.exit(main(sys.argv)) | |
| 40 | |
| OLD | NEW |