Look at Joel Spolsky's "Software Development Success 12 Specification" and "Daily Builds Are Your Friend", which are deeply in touch with the necessity and practicality of daily build. So add a script to your project to achieve a fast daily construction, and describe the entire process of this attempt, which is convenient for reference.
The so-called daily construction is a re-creation of the entire project at least once a day. The daily construction itself can only be considered a means of protecting code validity and quickly modifying the quick-selling means, but it is necessary to quickly build the project results from code to build a final product form ( Such as installation programs, CD mirroring, etc.) requires a set of tools to support the corresponding scripts, and the work that needs to be done daily is to implement this process.
There are many links in the daily construction process, the basic process is to remove the latest version of the source code from the source code management system, then compile by the compiler, and finally package it using the installer. I first started from the source code from the source management system.
It is the process of Visual SourceSafe.
The VSS itself has a Command Line mode. Follow the help documentation, command line commands all the features of the VSS interface program. And I only need his GET now (get the most recent version), the command line is as follows:
SS Get $ / vss_code -i-y -r -glc: / daily_build_code -o@mycode.log
SS
Launch program name for VSS Command Line mode
Get
Get the most recent version of the command name
$ / VSS_CODE
The program path that wants to get, the path can be obtained by the right click Properties function functionality through the VSS form program
-I-y
Answer Y, if this parameter is not allowed, the command will wait for the user to enter when you ask. Answer N, is -i-n
-R
Recursive acquisition, will take all subdirectories in this directory
-Glc: / daily_build_code
Used to specify the path to obtain the source code, if it is not set, use the default work directory of VSS
-O@mycode.log
Specify all information to output to log files
Note 1: The work path is specified here. Generally, it is best to re-establish the path each time for the construction of the original environment. If it is possible to provide a machine to be used to do daily build.
Note 2: If you do not specify the absolute path of the log file, the log file will be established to the current path. If you frequently use the CD, the MD command is likely to make this location uncertain, so it is recommended to use the absolute path to specify the log file. s position.
Although the above command is used to get the most recent version, it also needs to set the current environment variable in reality.
If your VSS server is not in this machine, you need to specify the service path as follows:
SET SSDIR = // my_vss_server / vss_code
You also need to specify the username and password, as follows:
Set SSUSER = SNAIL
Set sspwd = chinaos.com
Also, if you don't add the VSS path to the system settings, you need to specify the VSS path:
SET PATH = C: / Program Files / Microsoft Visual Studio / Common / VSS / Win32 /
Finally, pay attention is that because the new work path is specified, you need to ensure the validity of the directory.
These work have been completed, and the obtained script is expressed as the sample:
// vss.bat
SET SSDIR = // my_vss_server / vss_code
Set SSUSER = SNAIL
Set sspwd = chinaos.com
SET PATH = C: / Program Files / Microsoft Visual Studio / COMMON / VSS / WIN32 / C:
CD /
MD daily_build_code
SS Get $ / vss_code -i-y -r -glc: / daily_build_code -o@mycode.log
Other commands and parameters provided by VSS Common Line, please see the help document for VSS