Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: mojo/public/tools/bindings/run_code_generators.py

Issue 2091493002: Switch to the new go generator in the mojo tree. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix more things. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 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 # This script accepts the output of the mojom parser and uses that 6 # This script accepts the output of the mojom parser and uses that
7 # data to invoke the code generators. 7 # data to invoke the code generators.
8 8
9 import argparse 9 import argparse
10 import imp 10 import imp
(...skipping 14 matching lines...) Expand all
25 parser.add_argument('filenames', nargs='*', 25 parser.add_argument('filenames', nargs='*',
26 help='Filter on the set of .mojom files for which code ' 26 help='Filter on the set of .mojom files for which code '
27 'will be generated.') 27 'will be generated.')
28 parser.add_argument('-f', '--file-graph', dest='file_graph', 28 parser.add_argument('-f', '--file-graph', dest='file_graph',
29 help='Location of the parser output. "-" for stdin. ' 29 help='Location of the parser output. "-" for stdin. '
30 '(default "-")', default='-') 30 '(default "-")', default='-')
31 parser.add_argument("-o", "--output-dir", dest="output_dir", default=".", 31 parser.add_argument("-o", "--output-dir", dest="output_dir", default=".",
32 help="output directory for generated files") 32 help="output directory for generated files")
33 parser.add_argument("-g", "--generators", dest="generators_string", 33 parser.add_argument("-g", "--generators", dest="generators_string",
34 metavar="GENERATORS", 34 metavar="GENERATORS",
35 default="c++,dart,go,javascript,java,python", 35 default="c++,dart,javascript,java,python",
36 help="comma-separated list of generators") 36 help="comma-separated list of generators")
37 parser.add_argument("-s", "--src-root-path", dest="src_root_path", 37 parser.add_argument("-s", "--src-root-path", dest="src_root_path",
38 default=".", 38 default=".",
39 help="relative path to the root of the source tree.") 39 help="relative path to the root of the source tree.")
40 parser.add_argument("--no-gen-imports", action="store_true", 40 parser.add_argument("--no-gen-imports", action="store_true",
41 help="Generate code only for the files that are " 41 help="Generate code only for the files that are "
42 "specified on the command line. By default, code " 42 "specified on the command line. By default, code "
43 "is generated for all specified files and their " 43 "is generated for all specified files and their "
44 "transitive imports.") 44 "transitive imports.")
45 parser.add_argument("--generate-type-info", dest="generate_type_info", 45 parser.add_argument("--generate-type-info", dest="generate_type_info",
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 filtered_args = [arg for arg in remaining_args 176 filtered_args = [arg for arg in remaining_args
177 if arg.startswith(prefix)] 177 if arg.startswith(prefix)]
178 if args.generate_type_info: 178 if args.generate_type_info:
179 filtered_args.append("--generate_type_info") 179 filtered_args.append("--generate_type_info")
180 180
181 generator.GenerateFiles(filtered_args) 181 generator.GenerateFiles(filtered_args)
182 182
183 183
184 if __name__ == "__main__": 184 if __name__ == "__main__":
185 sys.exit(main()) 185 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698