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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 parser.add_option('--stamp', help='Path to touch on success.') | 42 parser.add_option('--stamp', help='Path to touch on success.') |
43 parser.add_option('--enable-dangerous-optimizations', action='store_true', | 43 parser.add_option('--enable-dangerous-optimizations', action='store_true', |
44 help='Enable optimizations which are known to have issues.') | 44 help='Enable optimizations which are known to have issues.') |
45 parser.add_option('--verbose', '-v', action='store_true', | 45 parser.add_option('--verbose', '-v', action='store_true', |
46 help='Print all proguard output') | 46 help='Print all proguard output') |
47 | 47 |
48 options, _ = parser.parse_args(args) | 48 options, _ = parser.parse_args(args) |
49 | 49 |
50 classpath = [] | 50 classpath = [] |
51 for arg in options.classpath: | 51 for arg in options.classpath: |
52 classpath += build_utils.ParseGypList(arg) | 52 classpath += build_utils.ParseGnList(arg) |
53 options.classpath = classpath | 53 options.classpath = classpath |
54 | 54 |
55 return options | 55 return options |
56 | 56 |
57 | 57 |
58 def main(args): | 58 def main(args): |
59 args = build_utils.ExpandFileArgs(args) | 59 args = build_utils.ExpandFileArgs(args) |
60 options = _ParseOptions(args) | 60 options = _ParseOptions(args) |
61 | 61 |
62 proguard = proguard_util.ProguardCmdBuilder(options.proguard_path) | 62 proguard = proguard_util.ProguardCmdBuilder(options.proguard_path) |
63 proguard.injars(build_utils.ParseGypList(options.input_paths)) | 63 proguard.injars(build_utils.ParseGnList(options.input_paths)) |
64 proguard.configs(build_utils.ParseGypList(options.proguard_configs)) | 64 proguard.configs(build_utils.ParseGnList(options.proguard_configs)) |
65 proguard.outjar(options.output_path) | 65 proguard.outjar(options.output_path) |
66 | 66 |
67 if options.mapping: | 67 if options.mapping: |
68 proguard.mapping(options.mapping) | 68 proguard.mapping(options.mapping) |
69 | 69 |
70 if options.tested_apk_info: | 70 if options.tested_apk_info: |
71 proguard.tested_apk_info(options.tested_apk_info) | 71 proguard.tested_apk_info(options.tested_apk_info) |
72 | 72 |
73 classpath = list(set(options.classpath)) | 73 classpath = list(set(options.classpath)) |
74 proguard.libraryjars(classpath) | 74 proguard.libraryjars(classpath) |
75 proguard.verbose(options.verbose) | 75 proguard.verbose(options.verbose) |
76 if not options.enable_dangerous_optimizations: | 76 if not options.enable_dangerous_optimizations: |
77 proguard.disable_optimizations(_DANGEROUS_OPTIMIZATIONS) | 77 proguard.disable_optimizations(_DANGEROUS_OPTIMIZATIONS) |
78 | 78 |
79 input_paths = proguard.GetInputs() | 79 input_paths = proguard.GetInputs() |
80 | 80 |
81 build_utils.CallAndWriteDepfileIfStale( | 81 build_utils.CallAndWriteDepfileIfStale( |
82 proguard.CheckOutput, | 82 proguard.CheckOutput, |
83 options, | 83 options, |
84 input_paths=input_paths, | 84 input_paths=input_paths, |
85 input_strings=proguard.build(), | 85 input_strings=proguard.build(), |
86 output_paths=[options.output_path]) | 86 output_paths=[options.output_path]) |
87 | 87 |
88 | 88 |
89 if __name__ == '__main__': | 89 if __name__ == '__main__': |
90 sys.exit(main(sys.argv[1:])) | 90 sys.exit(main(sys.argv[1:])) |
OLD | NEW |