| OLD | NEW |
| 1 """SCons.Tool.msvs | 1 """SCons.Tool.msvs |
| 2 | 2 |
| 3 Tool-specific initialization for Microsoft Visual Studio project files. | 3 Tool-specific initialization for Microsoft Visual Studio project files. |
| 4 | 4 |
| 5 There normally shouldn't be any need to import this module directly. | 5 There normally shouldn't be any need to import this module directly. |
| 6 It will usually be imported through the generic SCons.Tool.Tool() | 6 It will usually be imported through the generic SCons.Tool.Tool() |
| 7 selection method. | 7 selection method. |
| 8 | 8 |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 # | 24 # |
| 25 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | 25 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
| 26 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | 26 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
| 27 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 27 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 28 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | 28 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| 29 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | 29 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 30 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | 30 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 31 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 31 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 32 # | 32 # |
| 33 | 33 |
| 34 __revision__ = "src/engine/SCons/Tool/msvs.py 3603 2008/10/10 05:46:45 scons" | 34 __revision__ = "src/engine/SCons/Tool/msvs.py 3842 2008/12/20 22:59:52 scons" |
| 35 | 35 |
| 36 import base64 | 36 import base64 |
| 37 import md5 | 37 import hashlib |
| 38 import os.path | 38 import os.path |
| 39 import pickle | 39 import pickle |
| 40 import re | 40 import re |
| 41 import string | 41 import string |
| 42 import sys | 42 import sys |
| 43 | 43 |
| 44 import SCons.Builder | 44 import SCons.Builder |
| 45 import SCons.Node.FS | 45 import SCons.Node.FS |
| 46 import SCons.Platform.win32 | 46 import SCons.Platform.win32 |
| 47 import SCons.Script.SConscript | 47 import SCons.Script.SConscript |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 s = string.replace(s, '"', """) | 72 s = string.replace(s, '"', """) |
| 73 return s | 73 return s |
| 74 | 74 |
| 75 external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' | 75 external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' |
| 76 | 76 |
| 77 def _generateGUID(slnfile, name): | 77 def _generateGUID(slnfile, name): |
| 78 """This generates a dummy GUID for the sln file to use. It is | 78 """This generates a dummy GUID for the sln file to use. It is |
| 79 based on the MD5 signatures of the sln filename plus the name of | 79 based on the MD5 signatures of the sln filename plus the name of |
| 80 the project. It basically just needs to be unique, and not | 80 the project. It basically just needs to be unique, and not |
| 81 change with each invocation.""" | 81 change with each invocation.""" |
| 82 m = hashlib.md5() |
| 83 m.update(str(slnfile) + str(name)) |
| 82 # TODO(1.5) | 84 # TODO(1.5) |
| 83 #solution = _hexdigest(md5.new(str(slnfile)+str(name)).digest()).upper() | 85 #solution = m.hexdigest().upper() |
| 84 solution = string.upper(_hexdigest(md5.new(str(slnfile)+str(name)).digest())
) | 86 solution = string.upper(_hexdigest(m.digest())) |
| 85 # convert most of the signature to GUID form (discard the rest) | 87 # convert most of the signature to GUID form (discard the rest) |
| 86 solution = "{" + solution[:8] + "-" + solution[8:12] + "-" + solution[12:16]
+ "-" + solution[16:20] + "-" + solution[20:32] + "}" | 88 solution = "{" + solution[:8] + "-" + solution[8:12] + "-" + solution[12:16]
+ "-" + solution[16:20] + "-" + solution[20:32] + "}" |
| 87 return solution | 89 return solution |
| 88 | 90 |
| 89 version_re = re.compile(r'(\d+\.\d+)(.*)') | 91 version_re = re.compile(r'(\d+\.\d+)(.*)') |
| 90 | 92 |
| 91 def msvs_parse_version(s): | 93 def msvs_parse_version(s): |
| 92 """ | 94 """ |
| 93 Split a Visual Studio version, which may in fact be something like | 95 Split a Visual Studio version, which may in fact be something like |
| 94 '7.0Exp', into is version number (returned as a float) and trailing | 96 '7.0Exp', into is version number (returned as a float) and trailing |
| (...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 # The executable is 'devenv' in Visual Studio Pro, | 1806 # The executable is 'devenv' in Visual Studio Pro, |
| 1805 # Team System and others. Express Editions have different | 1807 # Team System and others. Express Editions have different |
| 1806 # executable names. Right now we're only going to worry | 1808 # executable names. Right now we're only going to worry |
| 1807 # about Visual C++ 2005 Express Edition. | 1809 # about Visual C++ 2005 Express Edition. |
| 1808 return env.Detect('devenv') or env.Detect('vcexpress') | 1810 return env.Detect('devenv') or env.Detect('vcexpress') |
| 1809 else: | 1811 else: |
| 1810 return env.Detect('msdev') | 1812 return env.Detect('msdev') |
| 1811 else: | 1813 else: |
| 1812 # there's at least one version of MSVS installed. | 1814 # there's at least one version of MSVS installed. |
| 1813 return 1 | 1815 return 1 |
| OLD | NEW |