OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2016 The Chromium Authors. All rights reserved. | 3 # Copyright 2016 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """This script creates a "jumbo" file which merges all incoming files | 7 """This script creates a "jumbo" file which merges all incoming files |
8 for compiling. | 8 for compiling. |
9 | 9 |
10 """ | 10 """ |
(...skipping 26 matching lines...) Expand all Loading... |
37 written_inputs = 0 | 37 written_inputs = 0 |
38 for output_index, output_file in enumerate(args.outputs): | 38 for output_index, output_file in enumerate(args.outputs): |
39 # TODO: Check if the file is right already and then do not update it. | 39 # TODO: Check if the file is right already and then do not update it. |
40 with open(output_file, "w") as out: | 40 with open(output_file, "w") as out: |
41 out.write("/* This is a Jumbo file. Don't edit. */\n\n") | 41 out.write("/* This is a Jumbo file. Don't edit. */\n\n") |
42 out.write("/* Generated with jumbo.py. */\n\n") | 42 out.write("/* Generated with jumbo.py. */\n\n") |
43 input_limit = (output_index + 1) * input_count / output_count | 43 input_limit = (output_index + 1) * input_count / output_count |
44 while written_inputs < input_limit: | 44 while written_inputs < input_limit: |
45 filename = inputs[written_inputs] | 45 filename = inputs[written_inputs] |
46 written_inputs += 1 | 46 written_inputs += 1 |
47 if filename.endswith(".h"): | 47 if filename.endswith(".h") or filename.endswith(".mm"): |
48 continue | 48 continue |
49 | 49 |
50 out.write("#include \"%s\"\n" % filename) | 50 out.write("#include \"%s\"\n" % filename) |
51 | 51 |
52 if args.verbose: | 52 if args.verbose: |
53 print("Generated %s (%d files) based on %s" % (str(args.outputs), | 53 print("Generated %s (%d files) based on %s" % (str(args.outputs), |
54 written_inputs, | 54 written_inputs, |
55 args.file_list)) | 55 args.file_list)) |
56 | 56 |
57 if __name__ == "__main__": | 57 if __name__ == "__main__": |
58 main() | 58 main() |
OLD | NEW |