The class extends the 'exec' task as it operates by executing the ss.exe program supplied with SourceSafe. By default the task expects ss.exe to be in the path, you can override this be specifying the ssdir attribute.
This class provides set and get methods for 'login' and 'vsspath' attributes. It also contains constants for the flags that can be passed to SS.
| Modifier and Type | Class and Description |
|---|---|
| public static class | MSVSS.
Extension of EnumeratedAttribute to hold the values for file time stamp. |
| public static class | MSVSS.
Extension of EnumeratedAttribute to hold the values for writable filess. |
| Modifier and Type | Field and Description |
|---|---|
| private String | autoResponse
Auto response |
| private String | comment
Comment |
| private String | date
Date |
| private DateFormat | dateFormat
Date format for History |
| private boolean | failOnError
Fail on error defaults to true |
| private String | fromDate
From date |
| private String | fromLabel
From label |
| private boolean | getLocalCopy
Get local copy for checkout defaults to true |
| private String | label
Label |
| private String | localPath
Local path |
| private int | numDays
Number of days offset for History |
| private String | outputFileName
Output file name |
| private boolean | quiet
Quiet defaults to false |
| private boolean | recursive
Recursive defaults to false |
| private String | |
| private String | |
| private String | style
History style |
| private MSVSS. | timestamp
Timestamp for retrieved files |
| private String | toDate
To date |
| private String | toLabel
To label |
| private String | user
User |
| private String | version
Version |
| private String | |
| private String | |
| private boolean | writable
Writable defaults to false |
| private MSVSS. | writableFiles
Behaviour for writable files |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract Commandline | Returns: The Constructed command line.Each sub-class must implement this method and return the constructed command line to be executed. |
| private String | |
| public void | |
| private String | Returns: The command line as a string with out the passwordThe command line to clean cmd)Changes the password to '***' so it isn't displayed on screen if the build fails |
| protected String | Returns: The default value "-I-" if autoresponse is not set.Gets the auto response string. |
| protected String | |
| private boolean | Returns: True if the FailOnError flag has been set or if 'writablefiles=skip'.Gets the value of the fail on error flag. |
| public String | Returns: The default file time flag, if not set.Gets the value set for the FileTimeStamp. |
| protected String | Returns: An empty string if get local copy is true.Builds and returns the -G- flag if required. |
| protected String | |
| protected String | |
| protected String | |
| protected String | |
| protected String | |
| protected String | Returns: An empty string if recursive is not set or is false.Gets the recursive string. |
| private String | Returns: at most the 30 first chars of the labelReturn at most the 30 first chars of the label, logging a warning message about the truncation |
| protected String | Returns: The path to ss.exe or just ss if sscommand is not set.Gets the sscommand string. |
| protected String | |
| protected String | |
| protected String | |
| protected String | Returns: An empty string if neither Todate or from date are set.Gets the Version date string. |
| protected String | Returns: An empty string if a version, date and label are not set.Gets the version string. |
| protected String | Returns: An empty string if neither tolabel or fromlabel are set.Gets the version string. |
| protected String | |
| protected String | |
| public String | Returns: An empty String, if not set.Gets the value to determine the behaviour when encountering writable files. |
| private int | Returns: The return code from the exec'd process.The command line to execute. cmd)Sets up the required environment and executes the command line. |
| public final void | setFailOnError(final boolean
True if task should fail on any error. failOnError)Indicates if the build should fail if the Sourcesafe command does. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | setInternalFileTimeStamp(final MSVSS.
the value to use. timestampSet the timestamp attribute. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | setInternalOutputFilename(final String
the value to use. outputFileName)Set the outputFileName comment attribute. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | setInternalWritableFiles(final MSVSS.
the value to use. writableFilesSet the writableFiles attribute. |
| public final void | |
| public final void | setServerpath(final String
The path to the VSS server. serverPath)Directory where |
| public final void | |
| public final void | setVsspath(final String
The VSS project path. vssPath)SourceSafe path which specifies the project/file(s) you wish to perform the action on. |
| autoResponse | back to summary |
|---|---|
| private String autoResponse Auto response | |
| comment | back to summary |
|---|---|
| private String comment Comment | |
| date | back to summary |
|---|---|
| private String date Date | |
| dateFormat | back to summary |
|---|---|
| private DateFormat dateFormat Date format for History | |
| failOnError | back to summary |
|---|---|
| private boolean failOnError Fail on error defaults to true | |
| fromDate | back to summary |
|---|---|
| private String fromDate From date | |
| fromLabel | back to summary |
|---|---|
| private String fromLabel From label | |
| getLocalCopy | back to summary |
|---|---|
| private boolean getLocalCopy Get local copy for checkout defaults to true | |
| label | back to summary |
|---|---|
| private String label Label | |
| localPath | back to summary |
|---|---|
| private String localPath Local path | |
| numDays | back to summary |
|---|---|
| private int numDays Number of days offset for History | |
| outputFileName | back to summary |
|---|---|
| private String outputFileName Output file name | |
| quiet | back to summary |
|---|---|
| private boolean quiet Quiet defaults to false | |
| recursive | back to summary |
|---|---|
| private boolean recursive Recursive defaults to false | |
| serverPath | back to summary |
|---|---|
| private String serverPath | |
| ssDir | back to summary |
|---|---|
| private String ssDir | |
| style | back to summary |
|---|---|
| private String style History style | |
| timestamp | back to summary |
|---|---|
| private MSVSS. Timestamp for retrieved files | |
| toDate | back to summary |
|---|---|
| private String toDate To date | |
| toLabel | back to summary |
|---|---|
| private String toLabel To label | |
| user | back to summary |
|---|---|
| private String user User | |
| version | back to summary |
|---|---|
| private String version Version | |
| vssLogin | back to summary |
|---|---|
| private String vssLogin | |
| vssPath | back to summary |
|---|---|
| private String vssPath | |
| writable | back to summary |
|---|---|
| private boolean writable Writable defaults to false | |
| writableFiles | back to summary |
|---|---|
| private MSVSS. Behaviour for writable files | |
| MSVSS | back to summary |
|---|---|
| public MSVSS() | |
| buildCmdLine | back to summary |
|---|---|
| pack-priv abstract Commandline buildCmdLine() Each sub-class must implement this method and return the constructed command line to be executed. It is up to the sub-task to determine the required attributes and their order.
| |
| calcDate | back to summary |
|---|---|
| private String calcDate(String startDate, int daysToAdd) throws ParseException Calculates the start date for version comparison. Calculates the date numDay days earlier than startdate. | |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Executes the task. Builds a command line to execute ss.exe and then calls Exec's run method to execute the command line.
| |
| formatCommandLine | back to summary |
|---|---|
| private String formatCommandLine(Commandline cmd) Changes the password to '***' so it isn't displayed on screen if the build fails
| |
| getAutoresponse | back to summary |
|---|---|
| protected String getAutoresponse() Gets the auto response string. This can be Y "-I-Y" or N "-I-N".
| |
| getComment | back to summary |
|---|---|
| protected String getComment() Gets the comment string. "-Ccomment text"
| |
| getFailOnError | back to summary |
|---|---|
| private boolean getFailOnError() Gets the value of the fail on error flag.
| |
| getFileTimeStamp | back to summary |
|---|---|
| public String getFileTimeStamp() Gets the value set for the FileTimeStamp. if it equals "current" then we return -GTC if it equals "modified" then we return -GTM if it equals "updated" then we return -GTU otherwise we return -GTC
| |
| getGetLocalCopy | back to summary |
|---|---|
| protected String getGetLocalCopy() Builds and returns the -G- flag if required.
| |
| getLabel | back to summary |
|---|---|
| protected String getLabel() Gets the label string. "-Lbuild1" Max label length is 32 chars
| |
| getLocalpath | back to summary |
|---|---|
| protected String getLocalpath() Gets the localpath string. "-GLc:\source" The localpath is created if it didn't exist.
| |
| getLogin | back to summary |
|---|---|
| protected String getLogin() Gets the login string. This can be user and password, "-Yuser,password" or just user "-Yuser".
| |
| getOutput | back to summary |
|---|---|
| protected String getOutput() Gets the output file string. "-Ooutput.file"
| |
| getQuiet | back to summary |
|---|---|
| protected String getQuiet() Gets the quiet string. -O-
| |
| getRecursive | back to summary |
|---|---|
| protected String getRecursive() Gets the recursive string. "-R"
| |
| getShortLabel | back to summary |
|---|---|
| private String getShortLabel() Return at most the 30 first chars of the label, logging a warning message about the truncation
| |
| getSSCommand | back to summary |
|---|---|
| protected String getSSCommand() Gets the sscommand string. "ss" or "c:\path\to\ss"
| |
| getStyle | back to summary |
|---|---|
| protected String getStyle() Gets the style string. "-Lbuild1"
| |
| getUser | back to summary |
|---|---|
| protected String getUser() Gets the user string. "-Uusername"
| |
| getVersion | back to summary |
|---|---|
| protected String getVersion() Gets the version string.
| |
| getVersionDate | back to summary |
|---|---|
| protected String getVersionDate() throws BuildException Gets the Version date string.
| |
| getVersionDateLabel | back to summary |
|---|---|
| protected String getVersionDateLabel() Gets the version string. Returns the first specified of version "-V1.0", date "-Vd01.01.01", label "-Vlbuild1".
| |
| getVersionLabel | back to summary |
|---|---|
| protected String getVersionLabel() Gets the version string. This can be to-from "-VLbuild2~Lbuild1", from "~Lbuild1" or to "-VLbuild2".
| |
| getVsspath | back to summary |
|---|---|
| protected String getVsspath() Gets the vssserverpath string.
| |
| getWritable | back to summary |
|---|---|
| protected String getWritable() Gets the writable string. "-W"
| |
| getWritableFiles | back to summary |
|---|---|
| public String getWritableFiles() Gets the value to determine the behaviour when encountering writable files.
| |
| run | back to summary |
|---|---|
| private int run(Commandline cmd) Sets up the required environment and executes the command line.
| |
| setFailOnError | back to summary |
|---|---|
| public final void setFailOnError(final boolean failOnError) Indicates if the build should fail if the Sourcesafe command does. Defaults to true.
| |
| setInternalAutoResponse | back to summary |
|---|---|
| protected void setInternalAutoResponse(final String autoResponse) Set the auto response attribute.
| |
| setInternalComment | back to summary |
|---|---|
| protected void setInternalComment(final String comment) Set the internal comment attribute.
| |
| setInternalDate | back to summary |
|---|---|
| protected void setInternalDate(final String date) Set the date attribute.
| |
| setInternalDateFormat | back to summary |
|---|---|
| protected void setInternalDateFormat(final DateFormat dateFormat) Set the date format attribute.
| |
| setInternalFailOnError | back to summary |
|---|---|
| protected void setInternalFailOnError(final boolean failOnError) Set the failOnError attribute.
| |
| setInternalFileTimeStamp | back to summary |
|---|---|
| protected void setInternalFileTimeStamp(final MSVSS. Set the timestamp attribute.
| |
| setInternalFromDate | back to summary |
|---|---|
| protected void setInternalFromDate(final String fromDate) Set the from date attribute.
| |
| setInternalFromLabel | back to summary |
|---|---|
| protected void setInternalFromLabel(final String fromLabel) Set the from label attribute.
| |
| setInternalGetLocalCopy | back to summary |
|---|---|
| protected void setInternalGetLocalCopy(final boolean getLocalCopy) Set the getLocalCopy attribute.
| |
| setInternalLabel | back to summary |
|---|---|
| protected void setInternalLabel(final String label) Set the label attribute.
| |
| setInternalLocalPath | back to summary |
|---|---|
| protected void setInternalLocalPath(final String localPath) Set the local path comment attribute.
| |
| setInternalNumDays | back to summary |
|---|---|
| protected void setInternalNumDays(final int numDays) Set the num days attribute.
| |
| setInternalOutputFilename | back to summary |
|---|---|
| protected void setInternalOutputFilename(final String outputFileName) Set the outputFileName comment attribute.
| |
| setInternalQuiet | back to summary |
|---|---|
| protected void setInternalQuiet(final boolean quiet) Set the quiet attribute.
| |
| setInternalRecursive | back to summary |
|---|---|
| protected void setInternalRecursive(final boolean recursive) Set the recursive attribute.
| |
| setInternalStyle | back to summary |
|---|---|
| protected void setInternalStyle(final String style) Set the style attribute.
| |
| setInternalToDate | back to summary |
|---|---|
| protected void setInternalToDate(final String toDate) Set the to date attribute.
| |
| setInternalToLabel | back to summary |
|---|---|
| protected void setInternalToLabel(final String toLabel) Set the to label attribute.
| |
| setInternalUser | back to summary |
|---|---|
| protected void setInternalUser(final String user) Set the user attribute.
| |
| setInternalVersion | back to summary |
|---|---|
| protected void setInternalVersion(final String version) Set the version attribute.
| |
| setInternalWritable | back to summary |
|---|---|
| protected void setInternalWritable(final boolean writable) Set the writable attribute.
| |
| setInternalWritableFiles | back to summary |
|---|---|
| protected void setInternalWritableFiles(final MSVSS. Set the writableFiles attribute.
| |
| setLogin | back to summary |
|---|---|
| public final void setLogin(final String vssLogin) Login to use when accessing VSS, formatted as "username,password". You can omit the password if your database is not password protected. If you have a password and omit it, Ant will hang.
| |
| setServerpath | back to summary |
|---|---|
| public final void setServerpath(final String serverPath) Directory where
| |
| setSsdir | back to summary |
|---|---|
| public final void setSsdir(String dir) Directory where
| |
| setVsspath | back to summary |
|---|---|
| public final void setVsspath(final String vssPath) SourceSafe path which specifies the project/file(s) you wish to perform the action on. A prefix of 'vss://' will be removed if specified.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | Returns: The values.Implements abstract org. |
| CurrentModUpdated | back to summary |
|---|---|
| public CurrentModUpdated() | |
| getValues | back to summary |
|---|---|
| public String[] getValues() Implements abstract org. Gets the list of allowable values.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | Returns: The values.Implements abstract org. |
| WritableFiles | back to summary |
|---|---|
| public WritableFiles() | |
| getValues | back to summary |
|---|---|
| public String[] getValues() Implements abstract org. Gets the list of allowable values.
| |