Add Visual Studio support for SCC Provider variables. (Dobes Vandermeer)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 5 Nov 2005 16:48:27 +0000 (16:48 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 5 Nov 2005 16:48:27 +0000 (16:48 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1377 fdb21ef1-2011-0410-befe-b5e4ea1792b1

doc/man/scons.1
src/engine/SCons/Tool/msvs.py
src/engine/SCons/Tool/msvs.xml
test/MSVS/vs-7.0-files.py
test/MSVS/vs-7.1-files.py

index aed9e05e64b3c44a5577206554bae09a5e7f48fb..ef6e8b8fd243a3d641144f6d8e832f55054ee531 100644 (file)
@@ -6523,6 +6523,81 @@ For VS7, it is:
 .IP
 Where '<VSDir>' is the installed location of Visual Studio.
 
+.IP MSVS_PROJECT_BASE_PATH
+The string
+placed in a generated Microsoft Visual Studio solution file
+as the value of the
+.B SccProjectFilePathRelativizedFromConnection0
+and 
+.B SccProjectFilePathRelativizedFromConnection1
+attributes of the
+.B GlobalSection(SourceCodeControl)
+section.
+There is no default value.
+
+.IP MSVS_PROJECT_GUID
+The string
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+.B ProjectGUID
+attribute.
+The string is also placed in the
+.B SolutionUniqueID
+attribute of the
+.B GlobalSection(SourceCodeControl)
+section of the Microsoft Visual Studio solution file.
+There is no default value.
+
+.IP MSVS_SCC_AUX_PATH
+The path name
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+.B SccAuxPath
+attribute
+if the
+.I MSVS_SCC_PROVIDER
+construction variable is also set.
+There is no default value.
+
+.IP MSVS_SCC_LOCAL_PATH
+The path name
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+.B SccLocalPath
+attribute
+if the
+.I MSVS_SCC_PROVIDER
+construction variable is also set.
+The path name is also placed in the
+.B SccLocalPath0
+and
+.B SccLocalPath1
+attributes of the
+.B GlobalSection(SourceCodeControl)
+section of the Microsoft Visual Studio solution file.
+There is no default value.
+
+.IP MSVS_SCC_PROJECT_NAME
+The project name
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+.B SccProjectName
+attribute.
+There is no default value.
+
+.IP MSVS_SCC_PROVIDER
+The string
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+.B SccProvider
+attribute.
+The string is also placed in the
+.B SccProvider1
+attribute of the
+.B GlobalSection(SourceCodeControl)
+section of the Microsoft Visual Studio solution file.
+There is no default value.
+
 .IP MSVS_USE_MFC_DIRS
 Tells the MS Visual Studio tool(s) to use
 the MFC directories in its default paths
index 38c6dcb3d8a472fd182b8069c7c10dc4f111f1b5..e3a28ec64ea185260c16e8bd29368e3bc46c6428 100644 (file)
@@ -470,8 +470,7 @@ V7DSPHeader = """\
 \tProjectType="Visual C++"
 \tVersion="%(versionstr)s"
 \tName="%(name)s"
-\tSccProjectName=""
-\tSccLocalPath=""
+%(scc_attrs)s
 \tKeyword="MakeFileProj">
 """
 
@@ -501,11 +500,28 @@ class _GenerateV7DSP(_DSPGenerator):
         self.versionstr = '7.00'
         if self.version >= 7.1:
             self.versionstr = '7.10'
+        self.file = None
 
     def PrintHeader(self):
+        env = self.env
         versionstr = self.versionstr
         name = self.name
         encoding = self.env.subst('$MSVSENCODING')
+        scc_provider = env.get('MSVS_SCC_PROVIDER', '')
+        scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
+        scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
+        scc_local_path = env.get('MSVS_SCC_LOCAL_PATH', '')
+        project_guid = env.get('MSVS_PROJECT_GUID', '')
+        if scc_provider != '':
+            scc_attrs = ('\tProjectGUID="%s"\n'
+                         '\tSccProjectName="%s"\n'
+                         '\tSccAuxPath="%s"\n'
+                         '\tSccLocalPath="%s"\n'
+                         '\tSccProvider="%s"' % (project_guid, scc_project_name, scc_aux_path, scc_local_path, scc_provider))
+        else:
+            scc_attrs = ('\tProjectGUID="%s"\n'
+                         '\tSccProjectName="%s"\n'
+                         '\tSccLocalPath="%s"' % (project_guid, scc_project_name, scc_local_path))
 
         self.file.write(V7DSPHeader % locals())
 
@@ -725,6 +741,7 @@ class _GenerateV7DSW(_DSWGenerator):
     def __init__(self, dswfile, source, env):
         _DSWGenerator.__init__(self, dswfile, source, env)
 
+        self.file = None
         self.version = float(self.env['MSVS_VERSION'])
         self.versionstr = '7.00'
         if self.version >= 7.1:
@@ -813,8 +830,34 @@ class _GenerateV7DSW(_DSWGenerator):
             self.file.write('\tProjectSection(ProjectDependencies) = postProject\n'
                             '\tEndProjectSection\n')
         self.file.write('EndProject\n'
-                        'Global\n'
-                        '\tGlobalSection(SolutionConfiguration) = preSolution\n')
+                        'Global\n')
+        env = self.env
+        if env.has_key('MSVS_SCC_PROVIDER'):
+            dspfile_base = os.path.basename(self.dspfile)
+            slnguid = self.slnguid
+            scc_provider = env.get('MSVS_SCC_PROVIDER', '')
+            scc_provider = string.replace(scc_provider, ' ', r'\u0020')
+            scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
+            # scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
+            scc_local_path = env.get('MSVS_SCC_LOCAL_PATH', '')
+            scc_project_base_path = env.get('MSVS_SCC_PROJECT_BASE_PATH', '')
+            # project_guid = env.get('MSVS_PROJECT_GUID', '')
+            
+            self.file.write('\tGlobalSection(SourceCodeControl) = preSolution\n'
+                            '\t\tSccNumberOfProjects = 2\n'
+                            '\t\tSccProjectUniqueName0 = %(dspfile_base)s\n'
+                            '\t\tSccLocalPath0 = %(scc_local_path)s\n'
+                            '\t\tCanCheckoutShared = true\n'
+                            '\t\tSccProjectFilePathRelativizedFromConnection0 = %(scc_project_base_path)s\n'
+                            '\t\tSccProjectName1 = %(scc_project_name)s\n'
+                            '\t\tSccLocalPath1 = %(scc_local_path)s\n'
+                            '\t\tSccProvider1 = %(scc_provider)s\n'
+                            '\t\tCanCheckoutShared = true\n'
+                            '\t\tSccProjectFilePathRelativizedFromConnection1 = %(scc_project_base_path)s\n'
+                            '\t\tSolutionUniqueID = %(slnguid)s\n'
+                            '\tEndGlobalSection\n' % locals())
+                        
+        self.file.write('\tGlobalSection(SolutionConfiguration) = preSolution\n')
         confkeys = self.configs.keys()
         confkeys.sort()
         cnt = 0
@@ -1012,7 +1055,7 @@ def get_visualstudio_versions():
                     vs = r'Microsoft Visual Studio\Common\MSDev98'
                 else:
                     vs = r'Microsoft Visual Studio .NET\Common7\IDE'
-                id = [ os.path.join(files_dir, vs) ]
+                id = [ os.path.join(files_dir, vs, 'devenv.exe') ]
             if os.path.exists(id[0]):
                 L.append(p)
     except SCons.Util.RegError:
index 647acd562d0334fe44c936f42f7070b12640c77e..c972ac2bba51bca006467be955872997214cb4fa 100644 (file)
@@ -254,6 +254,99 @@ Where 'VSDir' is the installed location of Visual Studio.
 </summary>
 </cvar>
 
+<cvar name="MSVS_PROJECT_BASE_PATH">
+<summary>
+The string
+placed in a generated Microsoft Visual Studio solution file
+as the value of the
+<literal>SccProjectFilePathRelativizedFromConnection0</literal>
+and 
+<literal>SccProjectFilePathRelativizedFromConnection1</literal>
+attributes of the
+<literal>GlobalSection(SourceCodeControl)</literal>
+section.
+There is no default value.
+</summary>
+</cvar>
+
+<cvar name="MSVS_PROJECT_GUID">
+<summary>
+The string
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+<literal>ProjectGUID</literal>
+attribute.
+The string is also placed in the
+<literal>SolutionUniqueID</literal>
+attribute of the
+<literal>GlobalSection(SourceCodeControl)</literal>
+section of the Microsoft Visual Studio solution file.
+There is no default value.
+</summary>
+</cvar>
+
+<cvar name="MSVS_SCC_AUX_PATH">
+<summary>
+The path name
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+<literal>SccAuxPath</literal>
+attribute
+if the
+<envar>MSVS_SCC_PROVIDER</envar>
+construction variable is also set.
+There is no default value.
+</summary>
+</cvar>
+
+<cvar name="MSVS_SCC_LOCAL_PATH">
+<summary>
+The path name
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+<literal>SccLocalPath</literal>
+attribute
+if the
+<envar>MSVS_SCC_PROVIDER</envar>
+construction variable is also set.
+The path name is also placed in the
+<literal>SccLocalPath0</literal>
+and
+<literal>SccLocalPath1</literal>
+attributes of the
+<literal>GlobalSection(SourceCodeControl)</literal>
+section of the Microsoft Visual Studio solution file.
+There is no default value.
+</summary>
+</cvar>
+
+<cvar name="MSVS_SCC_PROJECT_NAME">
+<summary>
+The project name
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+<literal>SccProjectName</literal>
+attribute.
+There is no default value.
+</summary>
+</cvar>
+
+<cvar name="MSVS_SCC_PROVIDER">
+<summary>
+The string
+placed in a generated Microsoft Visual Studio project file
+as the value of the
+<literal>SccProvider</literal>
+attribute.
+The string is also placed in the
+<literal>SccProvider1</literal>
+attribute of the
+<literal>GlobalSection(SourceCodeControl)</literal>
+section of the Microsoft Visual Studio solution file.
+There is no default value.
+</summary>
+</cvar>
+
 <cvar name="MSVS_USE_MFC_DIRS">
 <summary>
 Tells the MS Visual Studio tool(s) to use
index 260ee76cbfc1ec5eb9aa1322a7cb8259fdd91cb9..e6826076205f1fd8155057498d5b275a37b44c24 100644 (file)
@@ -69,6 +69,7 @@ expected_vcprojfile = """\
 \tProjectType="Visual C++"
 \tVersion="7.00"
 \tName="Test"
+\tProjectGUID=""
 \tSccProjectName=""
 \tSccLocalPath=""
 \tKeyword="MakeFileProj">
index 30de5166d88880d7eb5f05f3e78456191ed06125..131e4bd05f782b1979abdce0eb52cfc4cff50a03 100644 (file)
@@ -69,6 +69,7 @@ expected_vcprojfile = """\
 \tProjectType="Visual C++"
 \tVersion="7.10"
 \tName="Test"
+\tProjectGUID=""
 \tSccProjectName=""
 \tSccLocalPath=""
 \tKeyword="MakeFileProj">