Working in teams with Visual Studio and Clearcase
This article talks about how you can use Visual Studio and Clearcase in combination in order to provide more effective team integration and operation.
Visual Studio has 2 important features that facilitate this:
- Grouping project configuration with the project.
- The ability to split the configuration of the IDE between team settings and personal settings.
IncludePath=c:\include;$(SUPLIB)\include AdditionalLibraries=c:\lib;$(SUPLIB)\libIf you have a set of variables that map to the latest versions of a supporting package you would expect those variables to change as the code base moves forward. If you looked at a version from last year you would like those variables to point to what they pointed to a year ago. I currently work for a company that uses normal environment variables in order to get around this problem. As far as I can work out there are no advantages of doing this and several disadvantages:
- Every user needs to set up all the variables on their PC, or their new PC, or the dedicated PC they are using as a build machine.
- Every user has to keep track of when these variables are modified or new ones are created.
- Once an environment variable is set up you can’t have a different definition, for that environment variable, per project.
- You need a master document to hold all these configuration options, so that when you are trying to use a new machine you don’t miss anything out.
- Don’t know about you, but I use ten’s of supporting libraries, and so the more you have the longer it takes to configure a machine and the more error prone this process can be.
SUPLIB_1_2=z:\lib1.2 SUPLIB_2_0=z:\lib2.0So when someone updates the support library:
- They must get every developer to add a new environment variable
SUPLIB_3_0=z:\lib3.0
to their machine. - They must also update a master document containing all the configuration items that must be configured to do a build.
- All the projects that use this supporting library must have their project files changed to use this new location to pick up the latest libraries.
- Firstly navigate to the location of the solution file ending
.sln
. - Create a file called
SolutionProperties.vsprops
in your favourite editor. - Enter the following definitions. You can see that ZDRIVE is defined as the first macro and it is used in subsequent macros. Under Clearcase (and every other source controller) everything is relative to the root. It’s just that the root can change its location.
<?xml version="1.0" encoding="Windows-1252"?> <VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00" Name="ClearCaseDrive" > <UserMacro Name="ZDRIVE" Value="z:" PerformEnvironmentSet="true" /> <UserMacro Name="CUDA" Value="$(ZDRIVE)\CUDA\cuda-4.0" PerformEnvironmentSet="true" /> <UserMacro Name="INTEL_IPP" Value="$(ZDRIVE)\Intel_IPP" PerformEnvironmentSet="true" /> </VisualStudioPropertySheet>
- Check in the
SolutionProperties.vsprops
- For each project file:
- Load the solution/project into Visual Studio.
- Right click on the project and select Properties.
- Under Configuration Properties, click General.
- In the right hand configuration panel change Inherited Project Property Sheets to:
$(SolutionDir)\SolutionProperties.vsprops
- Save project configuration file.
- Check the project files into the source controller.
$(SolutionDir)\SolutionProperties.vsprops
’s location is defined using a standard Visual Studio macro and so it becomes independent of file system paths.
There is a precedence order to the configuration files, newer variables overwrite predefined variables. Now instead of having a multitude of variables defining all the versions of a supporting library, you just need one to be defined in the SolutionProperties.vsprops
. The project needs to be updated to change the SUPLIB_3_0
to SUPLIB
, but once that is done there shouldn’t be any other need to update the project file again.
When you need to update the supporting library the person in charge of doing it can update their local copy of SolutionProperties.vsprops
, build and test the new library. When they are happy they check in their local copy of SolutionProperties.vsprops
. The change to the new library is reflected in all the other developers views without them needing to know or care. They have been decoupled.
Team configuration in the IDE
There are many options that should be set up in a team configuration file. These settings should apply to everything and everyone. The best example of this is TABs or spaces. If you checkout a file with spaces making up the indentation and your IDE is set to use TABs then when you check it in, every line (or the line you have edited (depending on the preference)) will be different to the last version which makes spotting differences between files that bit more difficult. You may have a code formatter that needs to be allied to code before it’s checked-in, or want extra warning flagged switched on (warning free code - is good code!).
Unlike library and header locations there will be a lot of personal preferences that will have to be contended with. You will have to arbitrate between what you consider team settings and personal preferences. The easiest thing to do is:
- Set up a Visual Studio installation the way you want.
- From the menu bar select Tools -> Options
- From the Options panel, select Environment -> Import and Export Settings
- The Automatically save my settings to this file option will point to your current settings file.
- Copy the current settings file to the solution directory of the source controller and call it
TeamSettings.vssettings
- Edit it, only keep the settings that apply to the team and remove everything else.
- Check in the team file.
- Send notification to your developers. Each developer must:
- Inside Visual Studio, click the Tools -> Options
- From the Options panel, select Environment -> Import and Export Settings
- Check the Use team settings file
- Unfortunately macros are not supported here, although they maybe in the future. Edit the location box to point to the team settings file.
- Click OK
No feedback yet
Form is loading...