OLD | NEW |
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 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 """Handle version information related to Visual Stuio.""" | 5 """Handle version information related to Visual Stuio.""" |
6 | 6 |
7 import errno | 7 import errno |
8 import os | 8 import os |
9 import re | 9 import re |
10 import subprocess | 10 import subprocess |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 '2010': ('10.0',), | 384 '2010': ('10.0',), |
385 '2010e': ('10.0',), | 385 '2010e': ('10.0',), |
386 '2012': ('11.0',), | 386 '2012': ('11.0',), |
387 '2012e': ('11.0',), | 387 '2012e': ('11.0',), |
388 '2013': ('12.0',), | 388 '2013': ('12.0',), |
389 '2013e': ('12.0',), | 389 '2013e': ('12.0',), |
390 } | 390 } |
391 override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH') | 391 override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH') |
392 if override_path: | 392 if override_path: |
393 msvs_version = os.environ.get('GYP_MSVS_VERSION') | 393 msvs_version = os.environ.get('GYP_MSVS_VERSION') |
394 if not msvs_version or 'e' not in msvs_version: | 394 if not msvs_version: |
395 raise ValueError('GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be ' | 395 raise ValueError('GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be ' |
396 'set to an "e" version (e.g. 2010e)') | 396 'set to a particular version (e.g. 2010e).') |
397 return _CreateVersion(msvs_version, override_path, sdk_based=True) | 397 return _CreateVersion(msvs_version, override_path, sdk_based=True) |
398 version = str(version) | 398 version = str(version) |
399 versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) | 399 versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) |
400 if not versions: | 400 if not versions: |
401 if version == 'auto': | 401 if version == 'auto': |
402 # Default to 2005 if we couldn't find anything | 402 # Default to 2005 if we couldn't find anything |
403 return _CreateVersion('2005', None) | 403 return _CreateVersion('2005', None) |
404 else: | 404 else: |
405 return _CreateVersion(version, None) | 405 return _CreateVersion(version, None) |
406 return versions[0] | 406 return versions[0] |
OLD | NEW |