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 """New implementation of Visual Studio project generation.""" | 5 """New implementation of Visual Studio project generation.""" |
6 | 6 |
7 import os | 7 import os |
8 import random | 8 import random |
9 | 9 |
10 import gyp.common | 10 import gyp.common |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 )) | 318 )) |
319 f.write('\tEndGlobalSection\r\n') | 319 f.write('\tEndGlobalSection\r\n') |
320 | 320 |
321 # TODO(rspangler): Should be able to configure this stuff too (though I've | 321 # TODO(rspangler): Should be able to configure this stuff too (though I've |
322 # never seen this be any different) | 322 # never seen this be any different) |
323 f.write('\tGlobalSection(SolutionProperties) = preSolution\r\n') | 323 f.write('\tGlobalSection(SolutionProperties) = preSolution\r\n') |
324 f.write('\t\tHideSolutionNode = FALSE\r\n') | 324 f.write('\t\tHideSolutionNode = FALSE\r\n') |
325 f.write('\tEndGlobalSection\r\n') | 325 f.write('\tEndGlobalSection\r\n') |
326 | 326 |
327 # Folder mappings | 327 # Folder mappings |
328 # TODO(rspangler): Should omit this section if there are no folders | 328 # Omit this section if there are no folders |
329 f.write('\tGlobalSection(NestedProjects) = preSolution\r\n') | 329 if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]): |
330 for e in all_entries: | 330 f.write('\tGlobalSection(NestedProjects) = preSolution\r\n') |
331 if not isinstance(e, MSVSFolder): | 331 for e in all_entries: |
332 continue # Does not apply to projects, only folders | 332 if not isinstance(e, MSVSFolder): |
333 for subentry in e.entries: | 333 continue # Does not apply to projects, only folders |
334 f.write('\t\t%s = %s\r\n' % (subentry.get_guid(), e.get_guid())) | 334 for subentry in e.entries: |
335 f.write('\tEndGlobalSection\r\n') | 335 f.write('\t\t%s = %s\r\n' % (subentry.get_guid(), e.get_guid())) |
| 336 f.write('\tEndGlobalSection\r\n') |
336 | 337 |
337 f.write('EndGlobal\r\n') | 338 f.write('EndGlobal\r\n') |
338 | 339 |
339 f.close() | 340 f.close() |
OLD | NEW |