net.sourceforge.cruisecontrol.bootstrappers
Class TFSBootstrapper

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.bootstrappers.TFSBootstrapper
All Implemented Interfaces:
Bootstrapper, java.io.Serializable

public class TFSBootstrapper
extends java.lang.Object
implements Bootstrapper

Bootstrapper for Microsoft Visual Studio Team Foundation Server. The TFS Bootstrapper will perform a get latest for a single ItemSpec before the build process is run. This relies on there being an existing TFS workspace and a working folder mapping existing between the local bootstrap location and the server location for that

Author:
Martin Woodward
See Also:
Serialized Form

Constructor Summary
TFSBootstrapper()
           
 
Method Summary
 void bootstrap()
          Perform the bootstrapping.
protected  Commandline buildGetCommand()
          Generate the tf get command in the format tf get -noprompt c:\cc\projects\connectfour\build.xml -recursive -login:DOMAIN\name,password For more details on get command syntax see http://msdn2.microsoft.com/en-us/library/fx7sdeyf(VS.80).aspx
 void setForce(boolean force)
          Flag to indicate of the tf get command should be performed using the /force switch.
 void setItemSpec(java.lang.String itemSpec)
          Mandatory The path to issue a get for
 void setOptions(java.lang.String options)
          An optional argument to add to the end of the tf get command that is generated.
 void setPassword(java.lang.String password)
          If the username or password is not supplied, then none will be passed to the command.
 void setRecursive(boolean recursive)
          Flag to indicate if the tf get should be performed recursively or not.
 void setTfPath(java.lang.String tfPath)
          The path to the tf command.
 void setUsername(java.lang.String username)
          The username to use when talking to TFS.
 void validate()
          Called after the configuration is read to make sure that all the mandatory parameters were specified..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TFSBootstrapper

public TFSBootstrapper()
Method Detail

bootstrap

public void bootstrap()
               throws CruiseControlException
Description copied from interface: Bootstrapper
Perform the bootstrapping.

Specified by:
bootstrap in interface Bootstrapper
Throws:
CruiseControlException - if bootstrap fails
See Also:
Bootstrapper.bootstrap()

buildGetCommand

protected Commandline buildGetCommand()
                               throws CruiseControlException
Generate the tf get command in the format tf get -noprompt c:\cc\projects\connectfour\build.xml -recursive -login:DOMAIN\name,password For more details on get command syntax see http://msdn2.microsoft.com/en-us/library/fx7sdeyf(VS.80).aspx

Returns:
a tfs get CommandLine instance
Throws:
CruiseControlException

validate

public void validate()
              throws CruiseControlException
Description copied from interface: Bootstrapper
Called after the configuration is read to make sure that all the mandatory parameters were specified..

Specified by:
validate in interface Bootstrapper
Throws:
CruiseControlException - if there was a configuration error.
See Also:
Bootstrapper.validate()

setItemSpec

public void setItemSpec(java.lang.String itemSpec)
Mandatory The path to issue a get for

Parameters:
itemSpec -

setUsername

public void setUsername(java.lang.String username)
The username to use when talking to TFS. This should be in the format DOMAIN\name or name@DOMAIN if the domain portion is required. Note that name@DOMAIN is the easiest format to use from Unix based systems. If the username contains characters likely to cause problems when passed to the command line then they can be escaped in quotes by passing the following into the config.xml:- "name" If the username or password is not supplied, then none will be passed to the command. On windows system using the Microsoft tf.exe command line client, the credential of that the CruiseControl process is running as will be used for the connection to the server.

Parameters:
username - the username to set

setPassword

public void setPassword(java.lang.String password)
If the username or password is not supplied, then none will be passed to the command. On windows system using the Microsoft tf.exe command line client, the credential of that the CruiseControl process is running as will be used for the connection to the server.

Parameters:
password - the password to set

setTfPath

public void setTfPath(java.lang.String tfPath)
The path to the tf command. Either the "tf.exe" command provided by Microsoft in the Team Explorer Client can be used or the "tf" command line client provided by Teamprise can be used. The Teamprise client works cross-platform. Both clients are free to use provided the developers using CruiseControl have a TFS Client Access License (and in the case of Teamprise a license to the Teamprise command line client). If not supplied then the command "tf" will be called and CruiseControl will rely on that command being able to be found in the path.

Parameters:
tfPath - the path where the tf command resides

setRecursive

public void setRecursive(boolean recursive)
Flag to indicate if the tf get should be performed recursively or not. In the usual bootstrapper scenario, the bootstrapper would be located in a single file (build.xml) or at one level in the bootstrapper directory. Therefore, if not passed, recursive will default to false, i.e. not recursive.

Parameters:
recursive -

setForce

public void setForce(boolean force)
Flag to indicate of the tf get command should be performed using the /force switch. By default, TFS will only download files that the server thinks have changed since the last time you told it you were modifying or geting files into your local TFS workspace. It will also not overwrite locally writable files. Setting the force option will make TFS always download the files and overwrite any that happen to be locally writable - however this has the expense of significantly increasing the network traffice and increaing the time to perform the bootstrap process.

Parameters:
force -

setOptions

public void setOptions(java.lang.String options)
An optional argument to add to the end of the tf get command that is generated.

Parameters:
options - the options to set