2
Licensed to the Apache Software Foundation (ASF) under one or more
3
contributor license agreements. See the NOTICE file distributed with
4
this work for additional information regarding copyright ownership.
5
The ASF licenses this file to You under the Apache License, Version 2.0
6
(the "License"); you may not use this file except in compliance with
7
the License. You may obtain a copy of the License at
9
http://www.apache.org/licenses/LICENSE-2.0
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
19
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
20
<title>Microsoft Visual SourceSafe(VSS) Tasks</title>
23
<h1>Microsoft Visual SourceSafe Tasks User Manual</h1>
26
<li>Craig Cottingham</li>
27
<li>Andrew Everitt</li>
28
<li>Balazs Fejes 2</li>
29
<li><a href="mailto:Glenn_Twiggs@bmc.com">Glenn_Twiggs@bmc.com</a></li>
30
<li>Martin Poeschl (<a href="mailto:mpoeschl@marmot.at">mpoeschl@marmot.at</a>)</li>
31
<li>Phillip Wells</li>
32
<li>Jon Skeet (<a href="mailto:jon.skeet@peramon.com">jon.skeet@peramon.com</a>)</li>
33
<li>Nigel Magnay (<a href="mailto:nigel.magnay@parsec.co.uk">nigel.magnay@parsec.co.uk</a>)</li>
34
<li>Gary S. Weaver</li>
35
<li>Jesse Stockall</li>
40
<li><a href="#intro">Introduction</a></li>
41
<li><a href="#tasks">The Tasks</a></li>
44
<h2><a name="intro">Introduction</a></h2>
45
<p>These tasks provide an interface to the
46
<a href="http://msdn.microsoft.com/ssafe/default.asp" target="_top">Microsoft Visual SourceSafe</a> SCM.
47
The <code>org.apache.tools.ant.taskdefs.optional.vss</code> package consists of a simple framework to support
48
vss functionality as well as some Apache Ant tasks encapsulating frequently used vss commands.
49
Although it is possible to use these commands on the desktop,
50
they were primarily intended to be used by automated build systems.</p>
52
If you get a CreateProcess IOError=2 when running these, it means
53
that ss.exe was not found. Check to see if you can run it from the
54
command line -you may need to alter your path, or set the <tt>ssdir</tt>
56
<h2><a name="tasks">The Tasks</a></h2>
58
<table border="0" cellspacing="0" cellpadding="3">
60
<td><a href="#vssget">vssget</a></td>
61
<td>Retrieves a copy of the specified VSS file(s).</td>
64
<td><a href="#vsslabel">vsslabel</a></td>
65
<td>Assigns a label to the specified version or current version of a file or project.</td>
68
<td><a href="#vsshistory">vsshistory</a></td>
69
<td>Shows the history of a file or project in VSS.</td>
72
<td><a href="#vsscheckin">vsscheckin</a></td>
73
<td>Updates VSS with changes made to a checked out file, and unlocks the VSS master copy.</td>
76
<td><a href="#vsscheckout">vsscheckout</a></td>
77
<td>Copies a file from the current project to the current folder, for the purpose of editing.</td>
80
<td><a href="#vssadd">vssadd</a></td>
81
<td>Adds a new file into the VSS Archive</td>
84
<td><a href="#vsscp">vsscp</a></td>
85
<td>Change the current project being used in VSS</td>
88
<td><a href="#vsscreate">vsscreate</a></td>
89
<td>Creates a project in VSS.</td>
94
<h2>Task Descriptions</h2>
98
<h2><a name="vssget">VssGet</a></h2>
100
Task to perform GET commands to Microsoft Visual SourceSafe.
101
<p>If you specify two or more attributes from version, date and
102
label only one will be used in the order version, date, label.</p>
104
<table border="1" cellpadding="2" cellspacing="0">
112
<td>SourceSafe path which specifies the project/file(s) you wish to
113
perform the action on.</td>
118
<td>username[,password] - The username and password needed to get access
119
to VSS. Note that you may need to specify both (if you have a password) -
120
Ant/VSS will hang if you leave the password out and VSS does not accept
121
login without a password. </td>
126
<td>Override the working directory and get to the specified path</td>
131
<td>directory where <code>ss.exe</code> resides. By default the
132
task expects it to be in the PATH.</td>
137
<td>directory where <code>srcsafe.ini</code> resides.</td>
142
<td>true or false; default false</td>
147
<td>true or false; default false. Note however that in the SourceSafe UI
148
, there is a setting accessed via Tools/Options/GeneralTab called
149
"Act on projects recursively". If this setting is checked,
150
then the recursive attribute is effectively ignored, and the get
151
will always be done recursively
157
<td>a version number to get</td>
158
<td rowspan="3">No, only one of these allowed</td>
162
<td>a date stamp to get at</td>
166
<td>a label to get for</td>
170
<td>suppress output (off by default)</td>
174
<td>autoresponse</td>
175
<td>What to respond with (sets the -I option). By default, -I- is
176
used; values of Y or N will be appended to this.</td>
180
<td>writablefiles</td>
181
<td>Behavior when local files are writable. Valid options are: <code>replace</code>,
182
<code>skip</code> and <code>fail</code>; Defaults to <code>fail</code>
183
<br><code>skip</code> implies <code>failonerror=false</code></td>
188
<td>Stop the buildprocess if ss.exe exits with a returncode of 100. Defaults to true</td>
192
<td>filetimestamp</td>
193
<td>Set the behavior for timestamps of local files. Valid options are <code>current</code>,
194
<code>modified</code>, or <code>updated</code>. Defaults to <code>current</code>.</td>
198
<p>Note that only one of version, date or label should be specified</p>
202
<vssget localPath="C:\mysrc\myproject"
203
recursive="true"
204
label="Release1"
205
login="me,mypassword"
206
vsspath="$/source/aProject"
207
writable="true"/>
210
<p>Does a get on the VSS-Project <i>$/source/myproject</i> using the username
211
<i>me</i> and the password <i>mypassword</i>. It will recursively get the files
212
which are labeled <i>Release1</i> and write them to the local directory
213
<i>C:\mysrc\myproject</i>. The local files will be writable.</p>
218
<h2><a name="vsslabel">VssLabel</a></h2>
220
Task to perform LABEL commands to Microsoft Visual SourceSafe.
221
<p>Assigns a label to the specified version or current version of a file or
224
<table border="1" cellpadding="2" cellspacing="0">
232
<td>SourceSafe path which specifies the project/file(s) you wish to
233
perform the action on.</td>
238
<td>username[,password] - The username and password needed to get access
239
to VSS. Note that you may need to specify both (if you have a password) -
240
Ant/VSS will hang if you leave the password out and VSS does not accept
241
login without a password. </td>
246
<td>directory where <code>ss.exe</code> resides. By default the
247
task expects it to be in the PATH.</td>
252
<td>directory where <code>srcsafe.ini</code> resides.</td>
257
<td>A label to apply to the hierarchy</td>
262
<td>An existing file or project version to label. By default the current
263
version is labeled.</td>
268
<td>The comment to use for this label. Empty or '-' for no comment.</td>
272
<td>autoresponse</td>
273
<td>What to respond with (sets the -I option). By default, -I- is
274
used; values of Y or N will be appended to this.</td>
279
<td>Stop the buildprocess if ss.exe exits with a returncode of 100. Defaults to true</td>
286
<vsslabel vsspath="$/source/aProject"
287
login="me,mypassword"
288
label="Release1"/>
291
<p>Labels the current version of the VSS project <i>$/source/aProject</i> with
292
the label <i>Release1</i> using the username <i>me</i> and the password
297
<vsslabel vsspath="$/source/aProject/myfile.txt"
298
version="4"
299
label="1.03.004"/>
302
<p>Labels version 4 of the VSS file <i>$/source/aProject/myfile.txt</i> with the
303
label <i>1.03.004</i>. If this version already has a label, the operation (and
304
the build) will fail.
310
<h2><a name="vsshistory">VssHistory</a></h2>
312
Task to perform HISTORY commands to Microsoft Visual SourceSafe.
314
<table border="1" cellpadding="2" cellspacing="0">
322
<td>SourceSafe path which specifies the project/file(s) you wish to
323
perform the action on.</td>
328
<td>username[,password] - The username and password needed to get access
329
to VSS. Note that you may need to specify both (if you have a password) -
330
Ant/VSS will hang if you leave the password out and VSS does not accept
331
login without a password. </td>
336
<td>directory where <code>ss.exe</code> resides. By default the
337
task expects it to be in the PATH.</td>
342
<td>directory where <code>srcsafe.ini</code> resides.</td>
347
<td>Start date for comparison</td>
352
<td>End date for comparison</td>
357
<td>Format of dates in fromDate and toDate. Used when calculating dates with
358
the numdays attribute. This string uses the formatting rules of SimpleDateFormat.
359
Defaults to DateFormat.SHORT.</td>
364
<td>Start label for comparison</td>
369
<td>Start label for comparison</td>
374
<td>The number of days for comparison.</td>
379
<td>File to write the diff.</td>
384
<td>true or false</td>
389
<td>brief, codediff, default or nofile. The default is default.</td>
394
<td>Name the user whose changes we would like to see</td>
399
<td>Stop the buildprocess if ss.exe exits with a returncode of 100. Defaults to true</td>
404
<h4>Specifying the time-frame</h4>
405
<p>There are different ways to specify what time-frame you wish to evaluate:</p>
407
<li>Changes between two dates: Specify both <code>fromDate</code> and <code>toDate</code> </li>
408
<li>Changes before a date: Specify <code>toDate</code></li>
409
<li>Changes after a date: Specify <code>fromDate</code></li>
410
<li>Changes X Days before a date: Specify <code>toDate</code> and (negative!) <code>numDays</code></li>
411
<li>Changes X Days after a date: Specify <code>fromDate</code> and <code>numDays</code></li>
418
<vsshistory vsspath="$/myProject" recursive="true"
419
fromLabel="Release1"
420
toLabel="Release2"/>
423
<p>Shows all changes between "Release1" and "Release2".</p>
427
<vsshistory vsspath="$/myProject" recursive="true"
428
fromDate="01.01.2001"
429
toDate="31.03.2001"/>
432
<p>Shows all changes between January 1st 2001 and March 31st 2001 (in Germany, date must be specified according to your locale).</p>
437
<format property="to.tstamp" pattern="M-d-yy;h:mma"/>
440
<vsshistory vsspath="$/myProject" recursive="true"
441
numDays="-14"
442
dateFormat="M-d-yy;h:mma"
443
toDate="${to.tstamp}"/>
446
<p>Shows all changes in the 14 days before today.</p>
451
<h2><a name="vsscheckin">VssCheckin</a></h2>
453
Task to perform CHECKIN commands to Microsoft Visual SourceSafe.
455
<table border="1" cellpadding="2" cellspacing="0">
463
<td>SourceSafe path which specifies the project/file(s) you wish to
464
perform the action on.</td>
469
<td>username[,password] - The username and password needed to get access
470
to VSS. Note that you may need to specify both (if you have a password) -
471
Ant/VSS will hang if you leave the password out and VSS does not accept
472
login without a password. </td>
477
<td>Override the working directory and get to the specified path</td>
482
<td>directory where <code>ss.exe</code> resides. By default the
483
task expects it to be in the PATH.</td>
488
<td>directory where <code>srcsafe.ini</code> resides.</td>
493
<td>true or false</td>
498
<td>true or false</td>
503
<td>Comment to use for the files that where checked in.</td>
507
<td>autoresponse</td>
508
<td>'Y', 'N' or empty. Specify how to reply to questions from VSS.</td>
513
<td>Stop the buildprocess if ss.exe exits with a returncode of 100. Defaults to true</td>
521
<vsscheckin vsspath="$/test/test*"
522
localpath="D:\build\"
523
comment="Modified by automatic build"/>
526
<p>Checks in the file(s) named <i>test*</i> in the project <i>$/test</i> using
527
the local directory <i>D:\build</i>.</p>
532
<h2><a name="vsscheckout">VssCheckout</a></h2>
534
Task to perform CHECKOUT commands to Microsoft Visual SourceSafe.
535
<p>If you specify two or more attributes from version, date and
536
label only one will be used in the order version, date, label.</p>
538
<table border="1" cellpadding="2" cellspacing="0">
546
<td>SourceSafe path which specifies the project/file(s) you wish to
547
perform the action on.</td>
552
<td>username[,password] - The username and password needed to get access
553
to VSS. Note that you may need to specify both (if you have a password) -
554
Ant/VSS will hang if you leave the password out and VSS does not accept
555
login without a password. </td>
560
<td>Override the working directory and get to the specified path</td>
565
<td>directory where <code>ss.exe</code> resides. By default the
566
task expects it to be in the PATH.</td>
571
<td>directory where <code>srcsafe.ini</code> resides.</td>
576
<td>true or false</td>
581
<td>true or false</td>
586
<td>a version number to get</td>
587
<td rowspan="3">No, only one of these allowed</td>
591
<td>a date stamp to get at</td>
595
<td>a label to get for</td>
598
<td>writablefiles</td>
599
<td>Behavior when local files are writable. Valid options are: <code>replace</code>,
600
<code>skip</code> and <code>fail</code>; Defaults to <code>fail</code>
601
<br><code>skip</code> implies <code>failonerror=false</code></td>
606
<td>Stop the buildprocess if ss.exe exits with a returncode of 100. Defaults to true</td>
610
<td>filetimestamp</td>
611
<td>Set the behavior for timestamps of local files. Valid options are <code>current</code>,
612
<code>modified</code>, or <code>updated</code>. Defaults to <code>current</code>.</td>
616
<td>getlocalcopy</td>
617
<td>Set the behavior to retrieve local copies of the files. Defaults to true.</td>
625
<vsscheckout vsspath="$/test"
626
localpath="D:\build"
627
recursive="true"
628
login="me,mypass"/>
631
<p>Does a recursive checkout of the project <i>$/test</i> to the directory D:\build.
637
<h2><a name="vssadd">VssAdd</a></h2>
639
Task to perform ADD commands to Microsoft Visual SourceSafe.
641
<table border="1" cellpadding="2" cellspacing="0">
649
<td>Specify the local file(s) to add to VSS</td>
654
<td>username[,password] - The username and password needed to get access
655
to VSS. Note that you may need to specify both (if you have a password) -
656
Ant/VSS will hang if you leave the password out and VSS does not accept
657
login without a password. </td>
662
<td>directory where <code>ss.exe</code> resides. By default the
663
task expects it to be in the PATH.</td>
668
<td>directory where <code>srcsafe.ini</code> resides.</td>
673
<td>true or false</td>
678
<td>true or false</td>
683
<td>Comment to use for the files that where checked in.</td>
687
<td>autoresponse</td>
688
<td>'Y', 'N' or empty. Specify how to reply to questions from VSS.</td>
693
<td>Stop the buildprocess if ss.exe exits with a returncode of 100. Defaults to true</td>
701
<vssadd localpath="D:\build\build.00012.zip"
702
comment="Added by automatic build"/>
705
<p>Add the file named build.00012.zip into the project current working
706
directory (see vsscp).</p>
711
<h2><a name="vsscp">VssCp</a></h2>
713
<p>Task to perform CP (Change Project) commands to Microsoft Visual SourceSafe.</p>
714
<p>This task is typically used before a VssAdd in order to set the target project</p>
716
<table border="1" cellpadding="2" cellspacing="0">
724
<td>SourceSafe path which specifies the project you wish to
725
make the current project.</td>
730
<td>username[,password] - The username and password needed to get access
731
to VSS. Note that you may need to specify both (if you have a password) -
732
Ant/VSS will hang if you leave the password out and VSS does not accept
733
login without a password. </td>
738
<td>directory where <code>ss.exe</code> resides. By default the
739
task expects it to be in the PATH.</td>
744
<td>directory where <code>srcsafe.ini</code> resides.</td>
749
<td>Stop the buildprocess if ss.exe exits with a returncode of 100. Defaults to true</td>
757
<vsscp vsspath="$/Projects/ant"/>
760
<p>Sets the current VSS project to <i>$/Projects/ant</i>.</p>
765
<h2><a name="vsscreate">VssCreate</a></h2>
767
Task to perform CREATE commands to Microsoft Visual Source Safe.
768
<p>Creates a new project in VSS.</p>
770
<table border="1" cellpadding="2" cellspacing="0">
778
<td>username,password</td>
783
<td>SourceSafe path of project to be created</td>
788
<td>directory where <code>ss.exe</code> resides. By default the task expects it to be in the PATH.</td>
793
<td>suppress output (off by default)</td>
798
<td>fail if there is an error creating the project (true by default)</td>
802
<td>autoresponse</td>
803
<td>What to respond with (sets the -I option). By default, -I- is used; values of Y or N will be appended to this.</td>
808
<td>The comment to use for this label. Empty or '-' for no comment.</td>
815
<vsscreate vsspath="$/existingProject/newProject"/>
818
<p>Creates the VSS-Project <i>$/existingProject/newProject</i>.</p>