Setting Up a Developer or Tester Machine


Now you have a one-click developer environment. Next, let's dig a little deeper into the three env files and examine what they look like. See the comment lines of each file for an explanation of what the files does.

Here's the devenv.cmd file:

REM This command file is the first in three that gets called to set the proper REM Build environment. Only Generic build defines should be in this command. if "%USERNAME%" == "" goto fail REM Username must be set SET HOST=NT REM REM If no drive has been specified for the development tree, assume REM X:. To override this, place a SET _DEVDRIVE=X: REM if "%_DEVDRIVE%" == "" set _DEVDRIVE=e: REM REM If no directory has been specified for the development tree, assume REM \project name. REM if "%_DEVROOT%" == "" set _DEVROOT=\project name set _DEVBINDIR=%_DEVDRIVE%%_DEVROOT% REM REM This command file assumes that the developer has already defined REM the USERNAME environment variable to match their email name (e.g. REM vincem). REM REM We want to remember some environment variables so we can restore later REM if necessary REM set _DEVUSER=%USERNAME% REM REM Assume that the developer has already included \%_ DEVBINDIR%\PUBLIC\TOOLS REM in their path. REM path %PATH%;%_DEVBINDIR%\PUBLIC\BIN REM REM No hidden semantics of where to get libraries and include files. All REM information is included in the command lines that invoke the compilers REM and linkers. REM set LIB= set INCLUDE= REM REM Set up default build parameters. REM set BUILD_DEFAULT=-e -i -nmake -i set BUILD_DEFAULT_TARGETS=X86 set BUILD_MAKE_PROGRAM=nmake.exe REM REM Set up default nmake parameters ??? REM if "%DEVMAKEENV%" == "" set DEVMAKEENV=%_DEVBINDIR%\PUBLIC\BIN REM REM Set up the user specific environment information REM call %_DEVBINDIR%\PUBLIC\TOOLS\developer.cmd REM REM Optional parameters to this script are command line to execute REM %1 %2 %3 %4 %5 %6 %7 %8 %9 goto end :FAIL echo Username must be set! :end 

The following is the developer.cmd file:

@echo off REM @@ Put COPY_RIGHT_HERE REM @@ The environment unique to this user's machine and project REM REM Users should make a copy of this file and modify it to match REM their build environment. REM REM REM This is a sample file that should be modified to match a project's REM specific build needs. REM REM Set type of host platform. Default is NT REM if "%HOST%" == "" set HOST=NT :hostok REM This is where to find the projects REM REM The next lines provide default values for the root of your REM enlistment. To override, set these values before calling this REM batch file. REM IF .%DEFDRIVE%==. SET DEFDRIVE=E: IF .%DEFDIR%==. SET DEFDIR=\<project name> REM REM The next lines provide default values for the build type. REM Currently, the default is DEBUG. To override this, set REM BUILDTYPE before calling this batch file. REM IF .%BUILDTYPE%==. SET BUILDTYPE=DEBUG REM SET PLATFORM=X86 goto done :fail echo Build environment is not completely configured. goto eof :done REM Set <Project name> Variables SET <PROJECT NAME>_BUILD=E:\<PROJECT NAME>\BIN SET <PROJECT NAME>_LIBS=E:\<PROJECT NAME>\BIN\DBGLIB SET <PROJECT NAME>_DOC=E:\<PROJECT NAME>\BIN\DOC call %INIT%\vsvars32.bat [only if using Visual Studio] CD /d %_DEVBINDIR% echo Current user is now %USERNAME% :eof @echo off REM if "%default_echo_off%" == "" echo on 

Here's the setenv.cmd file:

REM This command file is used to set a specific developer's settings REM such as a dev team or test team. REM REM If no drive has been specified for the development tree, assume REM e:. To override this, place a SET _DEVDRIVE=e: REM if "%_DEVDRIVE%" == "" set _DEVDRIVE=E: if NOT "%USERNAME%" == "" goto skip1 echo !!! Error USERNAME environment variable not set goto done :skip1 REM REM This command file is either invoked by DEVENV.CMD during the startup of REM a screen group, or it is invoked directly by a developer to REM switch developer environment variables on the fly. If the file is invoked with REM no argument, then it restores the original developer's environment (as REM remembered by the DEVENV.CMD command file). Otherwise, the argument is REM a developer's e-mail name, and that developer's environment is established. REM This cmd file is also used to make sure everyone has the same alias set. REM REM if NOT "%1" == "" set USERNAME=%1 REM if "%_DEVUSER%" == "" goto skip2 REM FOR NOW if "%1" == "" if "%USERNAME%" == "%_DEVUSER%" alias src /d REM FOR NOW if "%1" == "" set USERNAME=%_DEVUSER% :skip2 REM REM Some tools look for .INI files in the INIT environment variable, so set REM it. REM set INIT=%_DEVBINDIR%\private\developer\%USERNAME% REM REM Load CUE with the standard public aliases and the developer's private ones REM You will need to create a CUE file that contains the alias you want REM if "%_DEVUSER%" == "" goto skip3 REM REM Initialize user settable DEV nmake environment variables REM set DEVPROJECTS= set DEVx86FLAGS= set BUILD_OPTIONS= set _OPTIMIZATION= set _WARNING_LEVEL= REM alias src > nul REM if NOT errorlevel 1 goto skip4 REM alias -p remote.exe -f %_DEVBINDIR%\private\developer\cue. pub -f %_DEVBINDIR%\private\developer\DEVcue.pub -f %INIT%\cue. pri REM alias -f %_DEVBINDIR%\private\developer\cue.pub -f %_DEVBINDIR%\private\developer\DEVcue.pub -f %INIT%\cue.pri goto skip4 REM :skip3 REM alias src > nul REM if errorlevel 1 goto skip4 REM alias -f %_DEVBINDIR%\private\developer\cue.pub -f %INIT%\ cue.pri :skip4 



The Build Master(c) Microsoft's Software Configuration Management Best Practices
The Build Master: Microsofts Software Configuration Management Best Practices
ISBN: 0321332059
EAN: 2147483647
Year: 2006
Pages: 186

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net