OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
| 3 # Copyright (c) 2009 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
3 """gypd output module | 7 """gypd output module |
4 | 8 |
5 This module produces gyp input as its output. Output files are given the | 9 This module produces gyp input as its output. Output files are given the |
6 .gypd extension to avoid overwriting the .gyp files that they are generated | 10 .gypd extension to avoid overwriting the .gyp files that they are generated |
7 from. Internal references to .gyp files (such as those found in | 11 from. Internal references to .gyp files (such as those found in |
8 "dependencies" sections) are not adjusted to point to .gypd files instead; | 12 "dependencies" sections) are not adjusted to point to .gypd files instead; |
9 unlike other paths, which are relative to the .gyp or .gypd file, such paths | 13 unlike other paths, which are relative to the .gyp or .gypd file, such paths |
10 are relative to the directory from which gyp was run to create the .gypd file. | 14 are relative to the directory from which gyp was run to create the .gypd file. |
11 | 15 |
12 This generator module is intended to be a sample and a debugging aid, hence | 16 This generator module is intended to be a sample and a debugging aid, hence |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 input_file_stem = input_file[:-4] | 79 input_file_stem = input_file[:-4] |
76 output_file = input_file_stem + params['options'].suffix + '.gypd' | 80 output_file = input_file_stem + params['options'].suffix + '.gypd' |
77 | 81 |
78 if not output_file in output_files: | 82 if not output_file in output_files: |
79 output_files[output_file] = input_file | 83 output_files[output_file] = input_file |
80 | 84 |
81 for output_file, input_file in output_files.iteritems(): | 85 for output_file, input_file in output_files.iteritems(): |
82 output = open(output_file, 'w') | 86 output = open(output_file, 'w') |
83 pprint.pprint(data[input_file], output) | 87 pprint.pprint(data[input_file], output) |
84 output.close() | 88 output.close() |
OLD | NEW |