OLD | NEW |
1 # Copyright (c) 2011 Google Inc. All rights reserved. | 1 # Copyright (c) 2011 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """gypd output module | 5 """gypd output module |
6 | 6 |
7 This module produces gyp input as its output. Output files are given the | 7 This module produces gyp input as its output. Output files are given the |
8 .gypd extension to avoid overwriting the .gyp files that they are generated | 8 .gypd extension to avoid overwriting the .gyp files that they are generated |
9 from. Internal references to .gyp files (such as those found in | 9 from. Internal references to .gyp files (such as those found in |
10 "dependencies" sections) are not adjusted to point to .gypd files instead; | 10 "dependencies" sections) are not adjusted to point to .gypd files instead; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 gyp.common.ParseQualifiedTarget(qualified_target)[0:2] | 81 gyp.common.ParseQualifiedTarget(qualified_target)[0:2] |
82 | 82 |
83 if input_file[-4:] != '.gyp': | 83 if input_file[-4:] != '.gyp': |
84 continue | 84 continue |
85 input_file_stem = input_file[:-4] | 85 input_file_stem = input_file[:-4] |
86 output_file = input_file_stem + params['options'].suffix + '.gypd' | 86 output_file = input_file_stem + params['options'].suffix + '.gypd' |
87 | 87 |
88 if not output_file in output_files: | 88 if not output_file in output_files: |
89 output_files[output_file] = input_file | 89 output_files[output_file] = input_file |
90 | 90 |
91 for output_file, input_file in output_files.iteritems(): | 91 for output_file, input_file in output_files.items(): |
92 output = open(output_file, 'w') | 92 output = open(output_file, 'w') |
93 pprint.pprint(data[input_file], output) | 93 pprint.pprint(data[input_file], output) |
94 output.close() | 94 output.close() |
OLD | NEW |