Chromium Code Reviews| Index: build/android/dex.py |
| diff --git a/build/android/dex.py b/build/android/dex.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a447a993b637dbdcb3c6495da500832829f03475 |
| --- /dev/null |
| +++ b/build/android/dex.py |
| @@ -0,0 +1,41 @@ |
| +#!/usr/bin/env python |
| +# |
| +# Copyright 2013 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import fnmatch |
| +import optparse |
| +import os |
| +import subprocess |
| +import sys |
| + |
| +from pylib import build_utils |
| + |
| + |
| +def DoDex(options, paths): |
| + dx_binary = os.path.join(options.android_sdk_root, 'platform-tools', 'dx') |
| + dex_cmd = [dx_binary, '--dex', '--output', options.dex_path] + paths |
|
shashi
2013/03/23 01:00:19
maybe a verbose option, so that if one wants to de
|
| + subprocess.check_call(dex_cmd) |
|
shashi
2013/03/23 01:00:19
Perhaps, later we can have a nice utility method t
cjhopman
2013/03/25 18:00:03
I think that both of these are things that we may
|
| + |
| + |
| +def main(argv): |
| + parser = optparse.OptionParser() |
| + parser.add_option('--android-sdk-root', help='Android sdk root directory.') |
| + parser.add_option('--dex-path', help='Dex output path.') |
| + parser.add_option('--stamp', help='Path to touch on success.') |
| + |
| + # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
| + parser.add_option('--ignore', help='Ignored.') |
| + |
| + options, paths = parser.parse_args() |
| + |
| + DoDex(options, paths) |
| + |
| + if options.stamp: |
| + build_utils.Touch(options.stamp) |
| + |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main(sys.argv)) |
| + |