| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 '''Tool to determine inputs and outputs of a grit file. | 6 '''Tool to determine inputs and outputs of a grit file. |
| 7 ''' | 7 ''' |
| 8 | 8 |
| 9 import optparse | 9 import optparse |
| 10 import os | 10 import os |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 # grit build also supports '-E KEY=VALUE', support that to share command | 117 # grit build also supports '-E KEY=VALUE', support that to share command |
| 118 # line flags. | 118 # line flags. |
| 119 parser.add_option("-E", action="append", dest="build_env", default=[]) | 119 parser.add_option("-E", action="append", dest="build_env", default=[]) |
| 120 parser.add_option("-w", action="append", dest="whitelist_files", default=[]) | 120 parser.add_option("-w", action="append", dest="whitelist_files", default=[]) |
| 121 parser.add_option("--output-all-resource-defines", action="store_true", | 121 parser.add_option("--output-all-resource-defines", action="store_true", |
| 122 dest="output_all_resource_defines", default=True, | 122 dest="output_all_resource_defines", default=True, |
| 123 help="Unused") | 123 help="Unused") |
| 124 parser.add_option("--no-output-all-resource-defines", action="store_false", | 124 parser.add_option("--no-output-all-resource-defines", action="store_false", |
| 125 dest="output_all_resource_defines", default=True, | 125 dest="output_all_resource_defines", default=True, |
| 126 help="Unused") | 126 help="Unused") |
| 127 parser.add_option("-f", dest="ids_file", | 127 parser.add_option("-f", dest="ids_file", default="") |
| 128 default="GRIT_DIR/../gritsettings/resource_ids") | |
| 129 parser.add_option("-t", dest="target_platform", default=None) | 128 parser.add_option("-t", dest="target_platform", default=None) |
| 130 | 129 |
| 131 options, args = parser.parse_args(argv) | 130 options, args = parser.parse_args(argv) |
| 132 | 131 |
| 133 defines = {} | 132 defines = {} |
| 134 for define in options.defines: | 133 for define in options.defines: |
| 135 name, val = util.ParseDefine(define) | 134 name, val = util.ParseDefine(define) |
| 136 defines[name] = val | 135 defines[name] = val |
| 137 | 136 |
| 138 for env_pair in options.build_env: | 137 for env_pair in options.build_env: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 except WrongNumberOfArguments, e: | 183 except WrongNumberOfArguments, e: |
| 185 PrintUsage() | 184 PrintUsage() |
| 186 print e | 185 print e |
| 187 return 1 | 186 return 1 |
| 188 print result | 187 print result |
| 189 return 0 | 188 return 0 |
| 190 | 189 |
| 191 | 190 |
| 192 if __name__ == '__main__': | 191 if __name__ == '__main__': |
| 193 sys.exit(main(sys.argv)) | 192 sys.exit(main(sys.argv)) |
| OLD | NEW |