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

Side by Side Diff: sky/engine/bindings/scripts/compiler.py

Issue 981733009: Fix all dartanalyzer errors in dart:sky except the Native ones. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « sky/engine/bindings/BUILD.gn ('k') | sky/engine/bindings/scripts/dart_types.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (C) 2014 Google Inc. All rights reserved. 2 # Copyright (C) 2014 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 idl_file_list = sorted([line.rstrip('\n') 107 idl_file_list = sorted([line.rstrip('\n')
108 for line in input_file]) 108 for line in input_file])
109 expanded_global_entries.append((directory, idl_file_list)) 109 expanded_global_entries.append((directory, idl_file_list))
110 global_header_filename = os.path.join(self.output_directory, 'DartGlobal .h') 110 global_header_filename = os.path.join(self.output_directory, 'DartGlobal .h')
111 global_cpp_filename = os.path.join(self.output_directory, 'DartGlobal.cp p') 111 global_cpp_filename = os.path.join(self.output_directory, 'DartGlobal.cp p')
112 self.generate_global_and_write(expanded_global_entries, 112 self.generate_global_and_write(expanded_global_entries,
113 (global_header_filename, global_cpp_filen ame)) 113 (global_header_filename, global_cpp_filen ame))
114 114
115 def generate_dart_blink(self, global_entries): 115 def generate_dart_blink(self, global_entries):
116 global_dart_blink_filename = os.path.join(self.output_directory, 116 global_dart_blink_filename = os.path.join(self.output_directory,
117 'sky_core.dart') 117 'dart_sky.dart')
118 expanded_global_entries = [] 118 expanded_global_entries = []
119 for (directory, file_list_file) in global_entries: 119 for (directory, file_list_file) in global_entries:
120 with open(file_list_file) as input_file: 120 with open(file_list_file) as input_file:
121 idl_file_list = sorted([line.rstrip('\n') 121 idl_file_list = sorted([line.rstrip('\n')
122 for line in input_file]) 122 for line in input_file])
123 expanded_global_entries.append((directory, idl_file_list)) 123 expanded_global_entries.append((directory, idl_file_list))
124 self.generate_dart_blink_and_write(expanded_global_entries, 124 self.generate_dart_blink_and_write(expanded_global_entries,
125 global_dart_blink_filename) 125 global_dart_blink_filename)
126 126
127 127
128 def main(): 128 def main():
129 options, filename = parse_options() 129 options, filename = parse_options()
130 idl_compiler = IdlCompilerDart(options.output_directory, 130 idl_compiler = IdlCompilerDart(options.output_directory,
131 interfaces_info_filename=options.interfaces_i nfo_file, 131 interfaces_info_filename=options.interfaces_i nfo_file,
132 only_if_changed=options.write_file_only_if_ch anged) 132 only_if_changed=options.write_file_only_if_ch anged)
133 if bool(options.global_entries): 133 if bool(options.global_entries):
134 idl_compiler.generate_global(options.global_entries) 134 idl_compiler.generate_global(options.global_entries)
135 elif bool(options.blink_global_entries): 135 elif bool(options.blink_global_entries):
136 idl_compiler.generate_dart_blink(options.blink_global_entries) 136 idl_compiler.generate_dart_blink(options.blink_global_entries)
137 else: 137 else:
138 idl_compiler.compile_file(filename) 138 idl_compiler.compile_file(filename)
139 139
140 140
141 if __name__ == '__main__': 141 if __name__ == '__main__':
142 sys.exit(main()) 142 sys.exit(main())
OLDNEW
« no previous file with comments | « sky/engine/bindings/BUILD.gn ('k') | sky/engine/bindings/scripts/dart_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698