Chromium Code Reviews| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 | 105 |
| 106 def DoMain(argv): | 106 def DoMain(argv): |
| 107 parser = optparse.OptionParser() | 107 parser = optparse.OptionParser() |
| 108 parser.add_option("--inputs", action="store_true", dest="inputs") | 108 parser.add_option("--inputs", action="store_true", dest="inputs") |
| 109 parser.add_option("--outputs", action="store_true", dest="outputs") | 109 parser.add_option("--outputs", action="store_true", dest="outputs") |
| 110 parser.add_option("-D", action="append", dest="defines", default=[]) | 110 parser.add_option("-D", action="append", dest="defines", default=[]) |
| 111 # grit build also supports '-E KEY=VALUE', support that to share command | 111 # grit build also supports '-E KEY=VALUE', support that to share command |
| 112 # line flags. | 112 # line flags. |
| 113 parser.add_option("-E", action="append", dest="build_env", default=[]) | 113 parser.add_option("-E", action="append", dest="build_env", default=[]) |
| 114 parser.add_option("-w", action="append", dest="whitelist_files", default=[]) | 114 parser.add_option("-w", action="append", dest="whitelist_files", default=[]) |
| 115 parser.add_option("--output-all-resource-defines", action="store_true", | |
|
newt (away)
2014/11/03 19:00:46
These arguments don't seem necessary in this file,
lliabraa
2014/11/03 20:10:18
Correct...they're unused. However, the gyp/gn file
| |
| 116 dest="output_all_resource_defines", default=True, | |
| 117 help="Unused") | |
|
newt (away)
2014/11/03 19:00:46
why help="Unused"?
lliabraa
2014/11/03 20:10:18
because the values of these parameters are not use
| |
| 118 parser.add_option("--no-output-all-resource-defines", action="store_false", | |
| 119 dest="output_all_resource_defines", default=True, | |
| 120 help="Unused") | |
| 115 parser.add_option("-f", dest="ids_file", | 121 parser.add_option("-f", dest="ids_file", |
| 116 default="GRIT_DIR/../gritsettings/resource_ids") | 122 default="GRIT_DIR/../gritsettings/resource_ids") |
| 117 parser.add_option("-t", dest="target_platform", default=None) | 123 parser.add_option("-t", dest="target_platform", default=None) |
| 118 | 124 |
| 119 options, args = parser.parse_args(argv) | 125 options, args = parser.parse_args(argv) |
| 120 | 126 |
| 121 defines = {} | 127 defines = {} |
| 122 for define in options.defines: | 128 for define in options.defines: |
| 123 name, val = util.ParseDefine(define) | 129 name, val = util.ParseDefine(define) |
| 124 defines[name] = val | 130 defines[name] = val |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 except WrongNumberOfArguments, e: | 178 except WrongNumberOfArguments, e: |
| 173 PrintUsage() | 179 PrintUsage() |
| 174 print e | 180 print e |
| 175 return 1 | 181 return 1 |
| 176 print result | 182 print result |
| 177 return 0 | 183 return 0 |
| 178 | 184 |
| 179 | 185 |
| 180 if __name__ == '__main__': | 186 if __name__ == '__main__': |
| 181 sys.exit(main(sys.argv)) | 187 sys.exit(main(sys.argv)) |
| OLD | NEW |