Class SOS
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.sos.SOS
- Direct Known Subclasses:
SOSCheckin
,SOSCheckout
,SOSGet
,SOSLabel
A base class for creating tasks for executing commands on SourceOffSite.
These tasks were inspired by the VSS tasks.
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
Fields inherited from interface org.apache.tools.ant.taskdefs.optional.sos.SOSCmd
COMMAND_CHECKIN_FILE, COMMAND_CHECKIN_PROJECT, COMMAND_CHECKOUT_FILE, COMMAND_CHECKOUT_PROJECT, COMMAND_GET_FILE, COMMAND_GET_PROJECT, COMMAND_HISTORY, COMMAND_LABEL, COMMAND_SOS_EXE, FLAG_COMMAND, FLAG_COMMENT, FLAG_FILE, FLAG_LABEL, FLAG_NO_CACHE, FLAG_NO_COMPRESSION, FLAG_PASSWORD, FLAG_PROJECT, FLAG_RECURSION, FLAG_SOS_HOME, FLAG_SOS_SERVER, FLAG_USERNAME, FLAG_VERBOSE, FLAG_VERSION, FLAG_VSS_SERVER, FLAG_WORKING_DIR, PROJECT_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
Execute the created command line.protected String
Get the commentprotected String
Get the filename to be acted upon.protected String
getLabel()
Get the labelprotected String
Builds and returns the working directory.protected String
Get the NoCache flag.protected String
Get the NoCompress flag.protected void
Adds the optional attributes to the command line.protected String
Get the passwordprotected String
Get the project pathprotected String
Get the 'recursive' Flag.protected void
Sets the executable and add the required attributes to the command line.protected String
Get the executable to run.protected String
Get the SOS home directory.protected String
Get the SOS serve path.protected String
Get the usernameprotected String
Get the 'verbose' Flag.protected String
Get the versionprotected String
Get the VSS server pathprotected int
run
(Commandline cmd) Execute the created command line.protected void
setInternalComment
(String text) Set the comment text.protected void
setInternalFilename
(String file) Set the file name.protected void
setInternalLabel
(String text) Set the label.protected void
setInternalRecursive
(boolean recurse) Set the recursive flag.protected void
setInternalVersion
(String text) Set the version.final void
setLocalPath
(Path path) Override the working directory and get to the specified path.final void
setNoCache
(boolean nocache) Flag to disable the cache when set.final void
setNoCompress
(boolean nocompress) Flag to disable compression when set.final void
setPassword
(String password) The SourceSafe password.final void
setProjectPath
(String projectpath) The SourceSafe project path.final void
The directory where soscmd(.exe) is located.final void
setSosHome
(String sosHome) Path to the SourceOffSite home directory.final void
setSosServerPath
(String sosServerPath) The address and port of SourceOffSite Server, for example 192.168.0.1:8888.final void
setUsername
(String username) The SourceSafe username.void
setVerbose
(boolean verbose) Enable verbose output.final void
setVssServerPath
(String vssServerPath) The path to the location of the ss.ini file.Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
commandLine
Commandline to be executed.
-
-
Constructor Details
-
SOS
public SOS()
-
-
Method Details
-
setNoCache
public final void setNoCache(boolean nocache) Flag to disable the cache when set. Required if SOSHOME is set as an environment variable. Defaults to false.- Parameters:
nocache
- True to disable caching.
-
setNoCompress
public final void setNoCompress(boolean nocompress) Flag to disable compression when set. Defaults to false.- Parameters:
nocompress
- True to disable compression.
-
setSosCmd
The directory where soscmd(.exe) is located. soscmd must be on the path if omitted.- Parameters:
dir
- The new sosCmd value.
-
setUsername
The SourceSafe username.- Parameters:
username
- The new username value.
-
setPassword
The SourceSafe password.- Parameters:
password
- The new password value.
-
setProjectPath
The SourceSafe project path.- Parameters:
projectpath
- The new projectpath value.
-
setVssServerPath
The path to the location of the ss.ini file.- Parameters:
vssServerPath
- The new vssServerPath value.
-
setSosHome
Path to the SourceOffSite home directory.- Parameters:
sosHome
- The new sosHome value.
-
setSosServerPath
The address and port of SourceOffSite Server, for example 192.168.0.1:8888.- Parameters:
sosServerPath
- The new sosServerPath value.
-
setLocalPath
Override the working directory and get to the specified path.- Parameters:
path
- The new localPath value.
-
setVerbose
public void setVerbose(boolean verbose) Enable verbose output. Defaults to false.- Parameters:
verbose
- True for verbose output.
-
setInternalFilename
Set the file name.- Parameters:
file
- the filename to use.
-
setInternalRecursive
protected void setInternalRecursive(boolean recurse) Set the recursive flag.- Parameters:
recurse
- if true use the recursive flag on the command line.
-
setInternalComment
Set the comment text.- Parameters:
text
- the comment text to use.
-
setInternalLabel
-
setInternalVersion
Set the version.- Parameters:
text
- the version to use.
-
getSosCommand
Get the executable to run. Add the path if it was specified in the build file- Returns:
- the executable to run.
-
getComment
-
getVersion
-
getLabel
-
getUsername
-
getPassword
-
getProjectPath
-
getVssServerPath
-
getSosHome
-
getSosServerPath
-
getFilename
Get the filename to be acted upon.- Returns:
- if it was set, null if not.
-
getNoCompress
Get the NoCompress flag.- Returns:
- the 'nocompress' Flag if the attribute was 'true', otherwise an empty string.
-
getNoCache
Get the NoCache flag.- Returns:
- the 'nocache' Flag if the attribute was 'true', otherwise an empty string.
-
getVerbose
Get the 'verbose' Flag.- Returns:
- the 'verbose' Flag if the attribute was 'true', otherwise an empty string.
-
getRecursive
Get the 'recursive' Flag.- Returns:
- the 'recursive' Flag if the attribute was 'true', otherwise an empty string.
-
getLocalPath
Builds and returns the working directory.The localpath is created if it didn't exist.
- Returns:
- the absolute path of the working directory.
-
execute
Execute the created command line.- Overrides:
execute
in classTask
- Throws:
BuildException
- on error.
-
run
Execute the created command line.- Parameters:
cmd
- The command line to run.- Returns:
- int the exit code.
- Throws:
BuildException
- if something goes wrong
-
getRequiredAttributes
protected void getRequiredAttributes()Sets the executable and add the required attributes to the command line. -
getOptionalAttributes
protected void getOptionalAttributes()Adds the optional attributes to the command line.
-