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-file', |
cjhopman
2015/02/24 21:23:04
You could change this to instead just take a gn/gy
| |
54 help='Path to a file containing a list of paths to exclude ' | 54 help='Path to a file containing a list of paths to exclude ' |
55 'from the dex file.') | 55 'from the dex file.') |
56 | 56 |
57 options, paths = parser.parse_args(args) | 57 options, paths = parser.parse_args(args) |
58 | 58 |
59 required_options = ('android_sdk_tools',) | 59 required_options = ('android_sdk_tools',) |
60 build_utils.CheckOptions(options, parser, required=required_options) | 60 build_utils.CheckOptions(options, parser, required=required_options) |
61 | 61 |
62 if (options.proguard_enabled == 'true' | 62 if (options.proguard_enabled == 'true' |
63 and options.configuration_name == 'Release'): | 63 and options.configuration_name == 'Release'): |
64 paths = [options.proguard_enabled_input_path] | 64 paths = [options.proguard_enabled_input_path] |
65 | 65 |
66 if options.inputs: | |
67 paths += build_utils.ParseGypList(options.inputs) | |
68 | |
66 if options.excluded_paths_file: | 69 if options.excluded_paths_file: |
67 exclude_paths = build_utils.ReadJson(options.excluded_paths_file) | 70 exclude_paths = build_utils.ReadJson(options.excluded_paths_file) |
68 paths = [p for p in paths if not p in exclude_paths] | 71 paths = [p for p in paths if not p in exclude_paths] |
69 | 72 |
70 if options.inputs: | |
71 paths += build_utils.ParseGypList(options.inputs) | |
72 | |
73 DoDex(options, paths) | 73 DoDex(options, paths) |
74 | 74 |
75 if options.depfile: | 75 if options.depfile: |
76 build_utils.WriteDepfile( | 76 build_utils.WriteDepfile( |
77 options.depfile, | 77 options.depfile, |
78 paths + build_utils.GetPythonDependencies()) | 78 paths + build_utils.GetPythonDependencies()) |
79 | 79 |
80 | 80 |
81 | 81 |
82 if __name__ == '__main__': | 82 if __name__ == '__main__': |
83 sys.exit(main()) | 83 sys.exit(main()) |
OLD | NEW |