OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 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 """The frontend for the Mojo bindings system.""" | 6 """The frontend for the Mojo bindings system.""" |
7 | 7 |
8 | 8 |
9 import argparse | 9 import argparse |
10 import imp | 10 import imp |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 parser = argparse.ArgumentParser( | 188 parser = argparse.ArgumentParser( |
189 description="Generate bindings from mojom files.") | 189 description="Generate bindings from mojom files.") |
190 parser.add_argument("filename", nargs="+", | 190 parser.add_argument("filename", nargs="+", |
191 help="mojom input file") | 191 help="mojom input file") |
192 parser.add_argument("-d", "--depth", dest="depth", default=".", | 192 parser.add_argument("-d", "--depth", dest="depth", default=".", |
193 help="depth from source root") | 193 help="depth from source root") |
194 parser.add_argument("-o", "--output_dir", dest="output_dir", default=".", | 194 parser.add_argument("-o", "--output_dir", dest="output_dir", default=".", |
195 help="output directory for generated files") | 195 help="output directory for generated files") |
196 parser.add_argument("-g", "--generators", dest="generators_string", | 196 parser.add_argument("-g", "--generators", dest="generators_string", |
197 metavar="GENERATORS", | 197 metavar="GENERATORS", |
198 default="c++,dart,go,javascript,java,python", | 198 default="c++,java", |
azani
2015/05/19 21:13:23
That shouldn't be necessary anymore given your las
qsr
2015/05/20 09:22:37
Right. Sorry, this was not intended to be here. Th
| |
199 help="comma-separated list of generators") | 199 help="comma-separated list of generators") |
200 parser.add_argument("--debug_print_intermediate", action="store_true", | 200 parser.add_argument("--debug_print_intermediate", action="store_true", |
201 help="print the intermediate representation") | 201 help="print the intermediate representation") |
202 parser.add_argument("-I", dest="import_directories", action="append", | 202 parser.add_argument("-I", dest="import_directories", action="append", |
203 metavar="directory", default=[], | 203 metavar="directory", default=[], |
204 help="add a directory to be searched for import files") | 204 help="add a directory to be searched for import files") |
205 parser.add_argument("--use_bundled_pylibs", action="store_true", | 205 parser.add_argument("--use_bundled_pylibs", action="store_true", |
206 help="use Python modules bundled in the SDK") | 206 help="use Python modules bundled in the SDK") |
207 (args, remaining_args) = parser.parse_known_args() | 207 (args, remaining_args) = parser.parse_known_args() |
208 | 208 |
209 generator_modules = LoadGenerators(args.generators_string) | 209 generator_modules = LoadGenerators(args.generators_string) |
210 | 210 |
211 fileutil.EnsureDirectoryExists(args.output_dir) | 211 fileutil.EnsureDirectoryExists(args.output_dir) |
212 | 212 |
213 processor = MojomProcessor(lambda filename: filename in args.filename) | 213 processor = MojomProcessor(lambda filename: filename in args.filename) |
214 for filename in args.filename: | 214 for filename in args.filename: |
215 processor.ProcessFile(args, remaining_args, generator_modules, filename) | 215 processor.ProcessFile(args, remaining_args, generator_modules, filename) |
216 | 216 |
217 return 0 | 217 return 0 |
218 | 218 |
219 | 219 |
220 if __name__ == "__main__": | 220 if __name__ == "__main__": |
221 sys.exit(main()) | 221 sys.exit(main()) |
OLD | NEW |