| OLD | NEW |
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 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 """GYP backend that generates Eclipse CDT settings files. | 5 """GYP backend that generates Eclipse CDT settings files. |
| 6 | 6 |
| 7 This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML | 7 This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML |
| 8 files that can be imported into an Eclipse CDT project. The XML file contains a | 8 files that can be imported into an Eclipse CDT project. The XML file contains a |
| 9 list of include paths and symbols (i.e. defines). | 9 list of include paths and symbols (i.e. defines). |
| 10 | 10 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 WriteMacros(out, eclipse_langs, defines) | 313 WriteMacros(out, eclipse_langs, defines) |
| 314 | 314 |
| 315 out.write('</cdtprojectproperties>\n') | 315 out.write('</cdtprojectproperties>\n') |
| 316 out.close() | 316 out.close() |
| 317 | 317 |
| 318 | 318 |
| 319 def GenerateOutput(target_list, target_dicts, data, params): | 319 def GenerateOutput(target_list, target_dicts, data, params): |
| 320 """Generate an XML settings file that can be imported into a CDT project.""" | 320 """Generate an XML settings file that can be imported into a CDT project.""" |
| 321 | 321 |
| 322 if params['options'].generator_output: | 322 if params['options'].generator_output: |
| 323 raise NotImplementedError, "--generator_output not implemented for eclipse" | 323 raise NotImplementedError("--generator_output not implemented for eclipse") |
| 324 | 324 |
| 325 user_config = params.get('generator_flags', {}).get('config', None) | 325 user_config = params.get('generator_flags', {}).get('config', None) |
| 326 if user_config: | 326 if user_config: |
| 327 GenerateOutputForConfig(target_list, target_dicts, data, params, | 327 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 328 user_config) | 328 user_config) |
| 329 else: | 329 else: |
| 330 config_names = target_dicts[target_list[0]]['configurations'].keys() | 330 config_names = target_dicts[target_list[0]]['configurations'].keys() |
| 331 for config_name in config_names: | 331 for config_name in config_names: |
| 332 GenerateOutputForConfig(target_list, target_dicts, data, params, | 332 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 333 config_name) | 333 config_name) |
| 334 | 334 |
| OLD | NEW |