| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import optparse | 7 import optparse |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 help='Paths to proguard configuration files.') | 24 help='Paths to proguard configuration files.') |
| 25 parser.add_option('--mapping', help='Path to proguard mapping to apply.') | 25 parser.add_option('--mapping', help='Path to proguard mapping to apply.') |
| 26 parser.add_option('--is-test', action='store_true', | 26 parser.add_option('--is-test', action='store_true', |
| 27 help='If true, extra proguard options for instrumentation tests will be ' | 27 help='If true, extra proguard options for instrumentation tests will be ' |
| 28 'added.') | 28 'added.') |
| 29 parser.add_option('--tested-apk-info', help='Path to the proguard .info file ' | 29 parser.add_option('--tested-apk-info', help='Path to the proguard .info file ' |
| 30 'for the tested apk') | 30 'for the tested apk') |
| 31 parser.add_option('--classpath', action='append', | 31 parser.add_option('--classpath', action='append', |
| 32 help='Classpath for proguard.') | 32 help='Classpath for proguard.') |
| 33 parser.add_option('--stamp', help='Path to touch on success.') | 33 parser.add_option('--stamp', help='Path to touch on success.') |
| 34 parser.add_option('--verbose', '-v', action='store_true', |
| 35 help='Print all proguard output') |
| 34 | 36 |
| 35 options, _ = parser.parse_args(args) | 37 options, _ = parser.parse_args(args) |
| 36 | 38 |
| 37 classpath = [] | 39 classpath = [] |
| 38 for arg in options.classpath: | 40 for arg in options.classpath: |
| 39 classpath += build_utils.ParseGypList(arg) | 41 classpath += build_utils.ParseGypList(arg) |
| 40 options.classpath = classpath | 42 options.classpath = classpath |
| 41 | 43 |
| 42 return options | 44 return options |
| 43 | 45 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 56 | 58 |
| 57 if options.tested_apk_info: | 59 if options.tested_apk_info: |
| 58 proguard.tested_apk_info(options.tested_apk_info) | 60 proguard.tested_apk_info(options.tested_apk_info) |
| 59 | 61 |
| 60 classpath = list(set(options.classpath)) | 62 classpath = list(set(options.classpath)) |
| 61 proguard.libraryjars(classpath) | 63 proguard.libraryjars(classpath) |
| 62 | 64 |
| 63 input_paths = proguard.GetInputs() | 65 input_paths = proguard.GetInputs() |
| 64 | 66 |
| 65 build_utils.CallAndWriteDepfileIfStale( | 67 build_utils.CallAndWriteDepfileIfStale( |
| 66 proguard.CheckOutput, | 68 lambda: proguard.CheckOutput(options.verbose), |
| 67 options, | 69 options, |
| 68 input_paths=input_paths, | 70 input_paths=input_paths, |
| 69 input_strings=proguard.build(), | 71 input_strings=proguard.build(), |
| 70 output_paths=[options.output_path]) | 72 output_paths=[options.output_path]) |
| 71 | 73 |
| 72 | 74 |
| 73 if __name__ == '__main__': | 75 if __name__ == '__main__': |
| 74 sys.exit(main(sys.argv[1:])) | 76 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |