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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 parser.add_option('--configuration-name', | 43 parser.add_option('--configuration-name', |
44 help='The build CONFIGURATION_NAME.') | 44 help='The build CONFIGURATION_NAME.') |
45 parser.add_option('--proguard-enabled', | 45 parser.add_option('--proguard-enabled', |
46 help='"true" if proguard is enabled.') | 46 help='"true" if proguard is enabled.') |
47 parser.add_option('--proguard-enabled-input-path', | 47 parser.add_option('--proguard-enabled-input-path', |
48 help=('Path to dex in Release mode when proguard ' | 48 help=('Path to dex in Release mode when proguard ' |
49 'is enabled.')) | 49 'is enabled.')) |
50 parser.add_option('--no-locals', | 50 parser.add_option('--no-locals', |
51 help='Exclude locals list from the dex file.') | 51 help='Exclude locals list from the dex file.') |
52 parser.add_option('--inputs', help='A list of additional input paths.') | 52 parser.add_option('--inputs', help='A list of additional input paths.') |
53 parser.add_option('--excluded-paths-file', | 53 parser.add_option('--excluded-paths', |
54 help='Path to a file containing a list of paths to exclude ' | 54 help='A list of paths to exclude from the dex file.') |
55 'from the dex file.') | |
56 | 55 |
57 options, paths = parser.parse_args(args) | 56 options, paths = parser.parse_args(args) |
58 | 57 |
59 required_options = ('android_sdk_tools',) | 58 required_options = ('android_sdk_tools',) |
60 build_utils.CheckOptions(options, parser, required=required_options) | 59 build_utils.CheckOptions(options, parser, required=required_options) |
61 | 60 |
62 if (options.proguard_enabled == 'true' | 61 if (options.proguard_enabled == 'true' |
63 and options.configuration_name == 'Release'): | 62 and options.configuration_name == 'Release'): |
64 paths = [options.proguard_enabled_input_path] | 63 paths = [options.proguard_enabled_input_path] |
65 | 64 |
66 if options.excluded_paths_file: | |
67 exclude_paths = build_utils.ReadJson(options.excluded_paths_file) | |
68 paths = [p for p in paths if not p in exclude_paths] | |
69 | |
70 if options.inputs: | 65 if options.inputs: |
71 paths += build_utils.ParseGypList(options.inputs) | 66 paths += build_utils.ParseGypList(options.inputs) |
72 | 67 |
| 68 if options.excluded_paths: |
| 69 exclude_paths = build_utils.ParseGypList(options.excluded_paths) |
| 70 paths = [p for p in paths if not p in exclude_paths] |
| 71 |
73 DoDex(options, paths) | 72 DoDex(options, paths) |
74 | 73 |
75 if options.depfile: | 74 if options.depfile: |
76 build_utils.WriteDepfile( | 75 build_utils.WriteDepfile( |
77 options.depfile, | 76 options.depfile, |
78 paths + build_utils.GetPythonDependencies()) | 77 paths + build_utils.GetPythonDependencies()) |
79 | 78 |
80 | 79 |
81 | 80 |
82 if __name__ == '__main__': | 81 if __name__ == '__main__': |
83 sys.exit(main()) | 82 sys.exit(main()) |
OLD | NEW |