jetbrains.buildServer.serverSide
Interface SBuildType

All Superinterfaces:
BuildType, BuildTypeDescriptor, BuildTypeOptions, java.lang.Comparable<BuildTypeDescriptor>, Dependent, OptionSupport, XmlExternalizable
All Known Subinterfaces:
RemoteBuildType

public interface SBuildType
extends BuildType, BuildTypeOptions, OptionSupport, Dependent, XmlExternalizable

This class represents TeamCity build configuration on the server-side.


Nested Class Summary
 
Nested classes/interfaces inherited from interface jetbrains.buildServer.BuildTypeDescriptor
BuildTypeDescriptor.CheckoutType
 
Field Summary
 
Fields inherited from interface jetbrains.buildServer.serverSide.BuildTypeOptions
BT_ALLOW_EXTERNAL_STATUS, BT_CLEAN_BUILD, BT_EXECUTION_TIMEOUT, BT_FAIL_IF_TESTS_FAIL, BT_FAIL_ON_ANY_ERROR_MESSAGE, BT_FAIL_ON_EXIT_CODE, BT_FAIL_ON_OOME_OR_CRASH, BT_HANGING_BUILDS_DETECTION_ENABLED, BT_MAX_RUNNING_BUILDS, BT_PREVENT_DEPENDENCIES_ARTIFACTS_FROM_CLEANUP
 
Method Summary
 void addBuildParameter(Parameter parameter)
          Adds build parameter to the configuration.
 void addBuildTrigger(BuildTrigger trigger)
          Adds new trigger to the configuration.
 void addRequirement(Requirement requirement)
          Adds new build requirement to the contifuration.
 void addRunParameter(Parameter parameter)
          Adds new run parameter.
 SQueuedBuild addToQueue(BuildAgent agent, java.lang.String triggeredBy)
          Adds build instance of the configuration to the queue with the specified requestor name on the specified agent (if agent is authorized).
 SQueuedBuild addToQueue(java.lang.String triggeredBy)
          Adds build instance of the configuration to the queue with the specified requestor name.
 void addVcsRoot(SVcsRoot root)
          Adds VCS root to the build configuration with default checkout rules.
 void clearRunParameters()
          Removes all run parameters.
 boolean containsVcsRoot(long vcsRootId)
          Returns true if VCS root with specified is attached to the build configuration
 SBuildType copyToProject(SProject target, java.lang.String newName, CopyOptions opts)
          Copies this build configuration to the target project.
 void forceCheckingForChanges()
          Starts checking for changes for all VCS roots of this build configuration
 java.util.List<AgentCompatibility> getAgentCompatibilities()
          Returns information about what agent are compatible with the configuration, what are incompatible and why.
<T extends SBuildAgent>
AgentCompatibility
getAgentCompatibility(T agent)
          Returns information about agent compatibility for the specified agent.
 java.util.List<SBuildAgent> getAgentsWhereBuildConfigurationBuilt()
          Returns list of agents (sorted by name) where this build configuration was ever built.
 java.util.List<SArtifactDependency> getArtifactDependencies()
          Returns artifacts this build configuration depending on.
 java.lang.String getArtifactPaths()
          Returns build artifact paths.
 java.io.File getArtifactsDirectory()
          Returns directory containing artifacts of this build configuration.
 java.util.List<SBuildType> getArtifactsReferences()
          Returns list of build configurations which depend on this build configurations artifacts
 BuildNumbers getBuildNumbers()
          Return information about build number pattern (BuildNumbers.getBuildNumberPattern()) and current build counter(BuildNumbers.getBuildCounter() )
 java.util.Map<java.lang.String,java.lang.String> getBuildParameters()
          Return map of build parameters specified by user.
 java.util.Collection<Parameter> getBuildParametersCollection()
          Returns build parameters collection.
 RunType getBuildRunner()
          Return server-side implementation for build runner (RunType) for this build configuration
 java.util.Collection<BuildTrigger> getBuildTriggers()
          Returns all triggers for the configuration.
<T extends BuildAgent>
java.util.List<T>
getCanRunAgents()
          Returns list of agents where this build configuration can run.
<T extends BuildAgent>
java.util.List<T>
getCanRunAndCompatibleAgents(boolean includeDisabled)
          Returns list of agents which are both allowed to run this configuration and are compatble with it.
 java.lang.String getCheckoutDirectory()
          Returns build checkout directory - if specified explicitly.
 CheckoutRules getCheckoutRules(VcsRoot root)
          Returns checkout rules configured for the specified VCS root.
<T extends BuildAgent>
java.util.Collection<T>
getCompatibleAgents()
          Returns list of all agents compatible with the configuration.
 int getExecutionTimeoutMin()
          Returns duration the build allowed to run until killed by the server.
 java.util.List<FilteredVcsChange> getFilteredChanges(SVcsModification modification, SBuild build)
          Deprecated. use SVcsModification.getFilteredChanges(SBuildType) or SVcsModification.getFilteredChanges(SBuild) methods instead
 java.util.List<SFinishedBuild> getHistory()
          See also BuildHistory.processEntries(jetbrains.buildServer.util.ItemProcessor)
 java.util.List<SFinishedBuild> getHistory(boolean includeCanceled)
          Deprecated. AFTER Calcutta, use @{link #getHistory(User, boolean)}
 java.util.List<SFinishedBuild> getHistory(User user, boolean includeCanceled)
          Deprecated. After Calcutta, will be removed; use #getHistory(user, includeCanceled, orderByChanges)
 java.util.List<SFinishedBuild> getHistory(User user, boolean includeCanceled, boolean orderByChanges)
          Returns all finished builds, visible for the specified user of this configuration.
 java.util.List<SFinishedBuild> getHistoryFull(boolean orderByChanges)
          See also BuildHistory.processEntries(String, jetbrains.buildServer.users.User, boolean, boolean, boolean, jetbrains.buildServer.util.ItemProcessor)
 java.util.List<Requirement> getImplicitRequirements()
          Get list of implicit requirements for build agents.
 java.util.List<VcsRoot> getLabelingRoots()
          List of roots whuch should be processed while labeling process
 VcsLabelingSettings.LabelingType getLabelingType()
          Labeling mode
 java.lang.String getLabelPattern()
          Labeling pattern
 SFinishedBuild getLastChangesFinished()
          Returns last finished instance for the build configuration with last user changes (personal builds and canceled builds are excluded).
 SBuild getLastChangesStartedBuild()
          Returns instance of the build, finished or running, which contains latest changes in this build configuration
 SFinishedBuild getLastChangesSuccessfullyFinished()
          Returns last successfully finished build in the configuration with last user changes, personal builds are not considered
 SBuild getLastFinished()
          Deprecated. see getLastChangesFinished()
 SBuild getLastStartedBuild()
          Deprecated. see getLastChangesStartedBuild()
 SFinishedBuild getLastSuccessfullyFinished()
          Deprecated. see getLastChangesSuccessfullyFinished()
 int getMaximumNumberOfBuilds()
          Returns maximum number of simultaneously running builds. 0 means there is no limit on a number of builds.
 java.util.List<SVcsModification> getModificationsSinceLastSuccessful()
          Returns all modifications made since last successfully finished build
 int getNumberOfArtifactReferences()
          Returns number of dependent build configuration having references to this build configuration.
 Comment getPauseComment()
          Returns comment for pausing/resuming this build type
 java.util.List<SVcsModification> getPendingChanges()
          Returns all changes already detected but not associated with a build.
 java.util.Collection<SUser> getPendingChangesCommitters()
          Returns pending changes committers to this build configuration
 SProject getProject()
          Returns parent project for the configuration.
 java.util.List<SQueuedBuild> getQueuedBuilds(User user)
          If user is null returns all queued builds including all personal builds.
 java.util.List<Requirement> getRequirements()
          Get list of explicit requirements for build agents which can run this build configuration.
 java.util.List<SRunningBuild> getRunningBuilds()
          Same as getRunningBuilds(null)
 java.util.List<SRunningBuild> getRunningBuilds(User user)
          See BuildType.getRunningBuilds(User)
 java.util.Map<java.lang.String,java.lang.String> getRunParameters()
          Return map of run parameters for this build configuration.
 java.util.List<Requirement> getRunTypeRequirements()
          Returns list of additional agent requirements imposed by selected runner.
 java.util.List<java.lang.String> getTags()
          List of all tags set for builds of this configuration.
 java.util.List<SBuildType> getTriggeredBy()
          Return list of build configurations which add me to build queue when successfully finish.
 ValueResolver getValueResolver()
          Returns value resolver that can be used to resolve values based on build type parameters.
 java.util.List<VcsRootEntry> getVcsRootEntries()
          Returns all entries of vcs roots.
 java.util.List<SVcsRoot> getVcsRoots()
          Returns all roots currently attached to this configuration
 java.lang.String getVcsSettingsHash(java.util.List<VcsRootEntry> vcsRootEntries)
          Return name of the directory which should be used as checkout directory for this build configuration.
 boolean isAllowExternalStatus()
          Returns if viewing of the configuration status is allowed externally.
 boolean isCleanBuild()
          Returns if all files on an agent machine should be deleted before the build is started.
 boolean isShouldFailBuildIfTestsFailed()
          Returns true if build of the configuration has to fail if there is failed test.
 PathMapping mapVcsPath(java.lang.String path)
          Returns path mapping for the given full VCS path of a file if this path can correspond to any of the project's VCS roots.
 void moveToProject(SProject target, boolean changeScopeOfLocalRoots)
          Moves this build configuration to the target project.
 void releaseSources()
          Releases sources of the build configuration on ALL agents where this configuration built.
 void releaseSources(SBuildAgent agent)
          Releases sources of the build configuration on specified agent only.
 void removeBuildParameter(java.lang.String paramName)
          Removes existing build parameter by its name.
 void removeBuildTrigger(BuildTrigger trigger)
          Removes sppecified trigger.
 void removeRequirement(java.lang.String propertyName)
          Removes requirement with the specified property name from the configuration.
 void removeVcsRoot(SVcsRoot root)
          Removes existing VCS root from the build configuration.
 void setArtifactDependencies(java.util.List<SArtifactDependency> artifacts)
          Sets artifacts this build configuration depending on.
 void setArtifactPaths(java.lang.String artifactPaths)
          Sets build artifact paths.
 void setCheckoutDirectory(java.lang.String dir)
          Sets build checkout directory.
 void setCheckoutRules(VcsRoot root, CheckoutRules checkoutRules)
          Sets checkout rules for specified VCS root.
 void setCheckoutType(BuildTypeDescriptor.CheckoutType type)
          Changes checkout type for the configuration sources.
 void setDescription(java.lang.String description)
          Chanegs configuration description.
 void setLabelingRoots(java.util.List<VcsRoot> roots)
          Changes list of roots whuch should be processed while labeling process
 void setLabelingType(VcsLabelingSettings.LabelingType type)
          Changes labeling mode for the configuration
 void setLabelPattern(java.lang.String pattern)
          Changes labeling pattern
 void setName(java.lang.String newName)
          Renames this build configuration
 void setPaused(boolean paused, User user)
          Deprecated. use setPaused(boolean, jetbrains.buildServer.users.User, String)
 void setPaused(boolean paused, User user, java.lang.String comment)
          Pause/unpause this build configuration.
 void setRunType(java.lang.String runnerType)
          Changes configuration runner.
 void setSleepingChangeBrowserPeriod(int value)
          Deprecated.  
 
Methods inherited from interface jetbrains.buildServer.BuildType
getBuildByBuildNumber, getBuildParameter, getNumberQueued, getResponsibilityInfo, getRunParameter, getStatus, isInQueue, removeResponsible, removeResponsible, setResponsible, setResponsible
 
Methods inherited from interface jetbrains.buildServer.BuildTypeDescriptor
getBuildTypeId, getCheckoutType, getDescription, getFullName, getName, getProjectId, getProjectName, getRunType, isPaused, isPersonal
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface jetbrains.buildServer.util.OptionSupport
getChangedOptions, getOption, setOption
 
Methods inherited from interface jetbrains.buildServer.serverSide.dependency.Dependent
addDependency, getDependencies, getDependencyReferences, getNumberOfDependencyReferences, intersectsWith, removeDependency
 
Methods inherited from interface jetbrains.buildServer.XmlExternalizable
writeTo
 

Method Detail

getBuildRunner

@Nullable
RunType getBuildRunner()
Return server-side implementation for build runner (RunType) for this build configuration

Returns:
see above
See Also:
BuildTypeDescriptor.getRunType()

getRequirements

java.util.List<Requirement> getRequirements()
Get list of explicit requirements for build agents which can run this build configuration. Explicit requirements are specified by user in Web UI explicitly.

Returns:
see above

addRequirement

void addRequirement(@NotNull
                    Requirement requirement)
Adds new build requirement to the contifuration.

Parameters:
requirement - new requirement.

removeRequirement

void removeRequirement(java.lang.String propertyName)
Removes requirement with the specified property name from the configuration.

Parameters:
propertyName - given property name.

getImplicitRequirements

java.util.List<Requirement> getImplicitRequirements()
Get list of implicit requirements for build agents. Implicit requirements appear when some build configuration property, or run parameter contains a reference to another run parameter or build parameter in form %system.property.name% or %env.ENV_VARIABLE% .

Returns:
see above

getRunTypeRequirements

java.util.List<Requirement> getRunTypeRequirements()
Returns list of additional agent requirements imposed by selected runner.

Returns:
see above

getBuildParameters

java.util.Map<java.lang.String,java.lang.String> getBuildParameters()
Return map of build parameters specified by user. Each build parameter has name and value. Name of each parameter starts from a prefix: env. or system. Value may by either simple string, or may contain references to other parameters in form %env.HOME% or %system.os.name% or %system.agent.name%

Returns:
see above

getBuildParametersCollection

java.util.Collection<Parameter> getBuildParametersCollection()
Returns build parameters collection.

Returns:
see above

addBuildParameter

void addBuildParameter(Parameter parameter)
Adds build parameter to the configuration. Parameters can be system and environment properties. Parameter type is being selected by its name prefix. Constants.SYSTEM_PREFIX for system properties and Constants.ENV_PREFIX for environment variable.

Parameters:
parameter - specified parameter.

removeBuildParameter

void removeBuildParameter(java.lang.String paramName)
Removes existing build parameter by its name.

Parameters:
paramName - specified parameter name.

getRunParameters

java.util.Map<java.lang.String,java.lang.String> getRunParameters()
Return map of run parameters for this build configuration. The set of run parameters is defined by build runner, used to build this build configuration (getBuildRunner()). specified by user. Each build parameter has name and value. Name of each parameter starts from a prefix env. or system. Value may by either simple string, or may contain references to other parameters in form %env.HOME% or %system.os.name% or %system.agent.name%

Returns:
see above

clearRunParameters

void clearRunParameters()
Removes all run parameters.


addRunParameter

void addRunParameter(Parameter parameter)
Adds new run parameter.

Parameters:
parameter - new run parameter.

getBuildTriggers

java.util.Collection<BuildTrigger> getBuildTriggers()
Returns all triggers for the configuration.

Returns:
all configured triggers.

addBuildTrigger

void addBuildTrigger(BuildTrigger trigger)
Adds new trigger to the configuration.

Parameters:
trigger - new trigger.

removeBuildTrigger

void removeBuildTrigger(BuildTrigger trigger)
Removes sppecified trigger.

Parameters:
trigger - given trigger.

getHistory

java.util.List<SFinishedBuild> getHistory()
See also BuildHistory.processEntries(jetbrains.buildServer.util.ItemProcessor)

Returns:
all non-cancelled builds non-personal builds for this build configuration, ordered by build start time descending (recent first)

getHistoryFull

java.util.List<SFinishedBuild> getHistoryFull(boolean orderByChanges)
See also BuildHistory.processEntries(String, jetbrains.buildServer.users.User, boolean, boolean, boolean, jetbrains.buildServer.util.ItemProcessor)

Parameters:
orderByChanges - if true, builds are ordered by changes, i.e. most recent build with recent changes goes first; if false, most recent builds go first, regardless change order
Returns:
all (including cancelled and personal builds) for this build configuration, ordered according to orderByChanges parameter.

getHistory

java.util.List<SFinishedBuild> getHistory(@Nullable
                                          User user,
                                          boolean includeCanceled,
                                          boolean orderByChanges)
Returns all finished builds, visible for the specified user of this configuration.

Parameters:
user - specified user. If user is null no personal builds will be included into the list, otherwise there will be personal builds for the specified user.
includeCanceled - if canceled builds should be included.
orderByChanges - if true, builds are ordered by changes, i.e. most recent build with recent changes goes first; if false, most recent builds go first, regardless change order
Returns:
list of all finished builds sorted according to orderByChanges field.

getLastChangesStartedBuild

@Nullable
SBuild getLastChangesStartedBuild()
Returns instance of the build, finished or running, which contains latest changes in this build configuration

Returns:
build with latest changes

getAgentCompatibilities

java.util.List<AgentCompatibility> getAgentCompatibilities()
Returns information about what agent are compatible with the configuration, what are incompatible and why. AgentCompatibility are provided for all registered agents.

Returns:
list of competibility information holders.

getAgentCompatibility

<T extends SBuildAgent> AgentCompatibility getAgentCompatibility(T agent)
Returns information about agent compatibility for the specified agent.

Parameters:
agent - the given agent.
Returns:
agent competibility for the specified agent.

getCompatibleAgents

<T extends BuildAgent> java.util.Collection<T> getCompatibleAgents()
Returns list of all agents compatible with the configuration.

Returns:
all compatible agents.

getCanRunAgents

<T extends BuildAgent> java.util.List<T> getCanRunAgents()
Returns list of agents where this build configuration can run. Build configuration can run on an agent if this agent is registered, and if agent run policy BuildAgentManager.RunConfigurationPolicy allows to run this build configuration.

Returns:
list of agents where this build configuration can run sorted by agent name

getCanRunAndCompatibleAgents

<T extends BuildAgent> java.util.List<T> getCanRunAndCompatibleAgents(boolean includeDisabled)
Returns list of agents which are both allowed to run this configuration and are compatble with it.

Parameters:
includeDisabled - true to include disabled agents in the list, by default they are excluded
Returns:
list of agents which are both allowed to run this configuration and are compatble with it.

getBuildNumbers

BuildNumbers getBuildNumbers()
Return information about build number pattern (BuildNumbers.getBuildNumberPattern()) and current build counter(BuildNumbers.getBuildCounter() )

Returns:
information about current build number.

getRunningBuilds

java.util.List<SRunningBuild> getRunningBuilds(@Nullable
                                               User user)
See BuildType.getRunningBuilds(User)

Specified by:
getRunningBuilds in interface BuildType
Parameters:
user - owner of personal builds
Returns:
list of running builds

getRunningBuilds

java.util.List<SRunningBuild> getRunningBuilds()
Same as getRunningBuilds(null)

Specified by:
getRunningBuilds in interface BuildType
Returns:
list of running builds

getLastChangesFinished

@Nullable
SFinishedBuild getLastChangesFinished()
Description copied from interface: BuildType
Returns last finished instance for the build configuration with last user changes (personal builds and canceled builds are excluded).

Specified by:
getLastChangesFinished in interface BuildType
Returns:
last finished build instance or null if no any build has been finished yet.

getLastChangesSuccessfullyFinished

@Nullable
SFinishedBuild getLastChangesSuccessfullyFinished()
Description copied from interface: BuildType
Returns last successfully finished build in the configuration with last user changes, personal builds are not considered

Specified by:
getLastChangesSuccessfullyFinished in interface BuildType
Returns:
last successfully finished build in the configuration (excluding personal) or null if there are no successfully finished builds.

setPaused

void setPaused(boolean paused,
               User user)
Deprecated. use setPaused(boolean, jetbrains.buildServer.users.User, String)

Pause/unpause this build configuration. Paused build configuration is not triggered by VCS chekins and time triggers

Parameters:
paused - if configuration should be paused
user - use who is pausing the configuration

setPaused

void setPaused(boolean paused,
               User user,
               java.lang.String comment)
Pause/unpause this build configuration. Paused build configuration is not triggered by VCS chekins and time triggers

Parameters:
paused - if configuration should be paused
user - use who is pausing the configuration
comment - user comment
Since:
4.5

getPauseComment

@Nullable
Comment getPauseComment()
Returns comment for pausing/resuming this build type

Returns:
comment for pausing/resuming this build type
Since:
4.5

setSleepingChangeBrowserPeriod

void setSleepingChangeBrowserPeriod(int value)
Deprecated. 


getProject

@NotNull
SProject getProject()
Returns parent project for the configuration.

Returns:
parent project.

setName

void setName(@NotNull
             java.lang.String newName)
             throws DuplicateBuildTypeNameException,
                    BuildTypeRenamingFailedException
Renames this build configuration

Parameters:
newName - new name
Throws:
DuplicateBuildTypeNameException - if another build configuration with such name exists in the build configuration project
BuildTypeRenamingFailedException - if build configuration renaming failed

setDescription

void setDescription(@Nullable
                    java.lang.String description)
Chanegs configuration description.

Parameters:
description - new configuration description.

setCheckoutType

void setCheckoutType(BuildTypeDescriptor.CheckoutType type)
Changes checkout type for the configuration sources.
CheckoutType#ON_SERVER - checkout sources automatically on the server and snd it to the agent.
CheckoutType#ON_AGENT - checkout sources automatically on the agent.
CheckoutType#MANUAL - do not check out sources automatically.

Parameters:
type - new checkout type.

setCheckoutDirectory

void setCheckoutDirectory(@Nullable
                          java.lang.String dir)
Sets build checkout directory. Set it to null to use default checkout directory.

Parameters:
dir - checkout directory

getCheckoutDirectory

@Nullable
java.lang.String getCheckoutDirectory()
Returns build checkout directory - if specified explicitly. Returns null if default checkout directory, generated by TeamCity should be used.

Returns:
build checkout directory
See Also:
getVcsSettingsHash(java.util.List)

setArtifactPaths

void setArtifactPaths(@Nullable
                      java.lang.String artifactPaths)
Sets build artifact paths. Artifact paths are comma separated paths to build artifacts. Support ant-style wildcards and target directories like *.zip => winFiles,unix/distro.tgz => linuxFiles, where winFiles and linuxFiles are target directories. Set to null or empty string to disable artifacts processing.

Parameters:
artifactPaths - paths to build artifacts

getArtifactPaths

@Nullable
java.lang.String getArtifactPaths()
Returns build artifact paths.

Returns:
build artifact paths

setRunType

void setRunType(@NotNull
                java.lang.String runnerType)
Changes configuration runner.

Parameters:
runnerType - new runner type name.
See Also:
RunType.getType()

getArtifactDependencies

java.util.List<SArtifactDependency> getArtifactDependencies()
Returns artifacts this build configuration depending on.

Returns:
list of artifacts this build configuration depending on

getArtifactsReferences

java.util.List<SBuildType> getArtifactsReferences()
Returns list of build configurations which depend on this build configurations artifacts

Returns:
list of build configurations

getNumberOfArtifactReferences

int getNumberOfArtifactReferences()
Returns number of dependent build configuration having references to this build configuration. This number may be greater than the size of the list getArtifactsReferences() because it takes into account all dependent build configurations while getArtifactsReferences() returns only build configurations accessible to an authority currently set in the security context.

Returns:
see above

setArtifactDependencies

void setArtifactDependencies(@NotNull
                             java.util.List<SArtifactDependency> artifacts)
Sets artifacts this build configuration depending on.

Parameters:
artifacts - new artifacts dependency list.

getTriggeredBy

java.util.List<SBuildType> getTriggeredBy()
Return list of build configurations which add me to build queue when successfully finish.

Returns:
list of all configurations which trigger this configuration.

getArtifactsDirectory

@NotNull
java.io.File getArtifactsDirectory()
Returns directory containing artifacts of this build configuration.

Returns:
artifatcs directory on the server.

getVcsRoots

java.util.List<SVcsRoot> getVcsRoots()
Returns all roots currently attached to this configuration

Specified by:
getVcsRoots in interface BuildType
Returns:
all attached vcs roots.

containsVcsRoot

boolean containsVcsRoot(long vcsRootId)
Returns true if VCS root with specified is attached to the build configuration

Parameters:
vcsRootId - id of VCS root
Returns:
true if build configuration contains specified VCS root

getVcsRootEntries

java.util.List<VcsRootEntry> getVcsRootEntries()
Returns all entries of vcs roots. Each entry contains reference to root and its checkout rules.

Returns:
all entries of vcs roots for this configuration

addVcsRoot

void addVcsRoot(@NotNull
                SVcsRoot root)
                throws InvalidVcsRootScopeException,
                       VcsRootNotFoundException
Adds VCS root to the build configuration with default checkout rules.

Parameters:
root - VCS root to add
Throws:
InvalidVcsRootScopeException - if VCS root scope is local and corresponds to another project (not the project - owner of this build configuration)
VcsRootNotFoundException - if specified VCS root does not exist anymore

removeVcsRoot

void removeVcsRoot(@NotNull
                   SVcsRoot root)
Removes existing VCS root from the build configuration. If there were checkout rules attached to this VCS root they will be removed too.

Parameters:
root - VCS root to remove

setCheckoutRules

void setCheckoutRules(@NotNull
                      VcsRoot root,
                      @NotNull
                      CheckoutRules checkoutRules)
Sets checkout rules for specified VCS root. VCS root must be attached to this build configuration.

Parameters:
root - root to set rules for
checkoutRules - checkout rules for the VCS root

getCheckoutRules

CheckoutRules getCheckoutRules(@NotNull
                               VcsRoot root)
Returns checkout rules configured for the specified VCS root. If there are no checkout rules or specified VCS root is not attached to this build configuration, null is returned.

Parameters:
root - VCS root
Returns:
checkout rules or null

getFilteredChanges

java.util.List<FilteredVcsChange> getFilteredChanges(@NotNull
                                                     SVcsModification modification,
                                                     @Nullable
                                                     SBuild build)
Deprecated. use SVcsModification.getFilteredChanges(SBuildType) or SVcsModification.getFilteredChanges(SBuild) methods instead

Retrieves filtered vcs changes for specified VCS modification. Changes are filtered by build configuration checkout rules. If specified vcs modification is pending than current checkout rules are used. Otherwise build where this modification occurred should be specified and checkout rules on the moment of this build are used.

Parameters:
modification - VCS modification
build - build where modification occurred or null if this is a pending modification
Returns:
list of filtered changes

getPendingChanges

java.util.List<SVcsModification> getPendingChanges()
Returns all changes already detected but not associated with a build.

Specified by:
getPendingChanges in interface BuildType
Returns:
list of version control modifications, which are detected but no build with these modifications is created yet.

getPendingChangesCommitters

java.util.Collection<SUser> getPendingChangesCommitters()
Returns pending changes committers to this build configuration

Returns:
see above
Since:
4.5

getModificationsSinceLastSuccessful

java.util.List<SVcsModification> getModificationsSinceLastSuccessful()
Returns all modifications made since last successfully finished build

Specified by:
getModificationsSinceLastSuccessful in interface BuildType
Returns:
list of version control modifications, detected since last successfull finished build has been finished

getVcsSettingsHash

java.lang.String getVcsSettingsHash(java.util.List<VcsRootEntry> vcsRootEntries)
Return name of the directory which should be used as checkout directory for this build configuration. In fact, this name is a generated hash which depends on VCS Roots associated with this build configuration and some other settings, such as CheckoutType BuildTypeDescriptor.getCheckoutType() and checkout rules getCheckoutRules(jetbrains.buildServer.vcs.VcsRoot) If checkout directory was specified explicitly for the build configuration, hash for this string is returned.

Parameters:
vcsRootEntries - vcs roots with checkout rules to get name hash for.
Returns:
name of the directory which will be used as last part of checkout directory, if this directory isn't set explicitly; otherwise hash for exlicitly set checkout directory is returned
See Also:
setCheckoutDirectory(String)

releaseSources

void releaseSources()
Releases sources of the build configuration on ALL agents where this configuration built. After that full checkout will be performed when build of this configuration starts on such agents.


releaseSources

void releaseSources(@NotNull
                    SBuildAgent agent)
Releases sources of the build configuration on specified agent only. After that full checkout will be performed when build of this configuration starts on the specified agent.

Parameters:
agent - agent

getAgentsWhereBuildConfigurationBuilt

@NotNull
java.util.List<SBuildAgent> getAgentsWhereBuildConfigurationBuilt()
Returns list of agents (sorted by name) where this build configuration was ever built.

Returns:
see above

getTags

java.util.List<java.lang.String> getTags()
List of all tags set for builds of this configuration.

Returns:
union of tags for each build for the configuration.

getLabelingType

VcsLabelingSettings.LabelingType getLabelingType()
Labeling mode

Returns:
mode how should be labeled a build of the configuration when finished

setLabelingType

void setLabelingType(VcsLabelingSettings.LabelingType type)
Changes labeling mode for the configuration

Parameters:
type - new labeling mode

getLabelPattern

@Nullable
java.lang.String getLabelPattern()
Labeling pattern

Returns:
what label should be set if it is being set according to labeling mode

setLabelPattern

void setLabelPattern(java.lang.String pattern)
Changes labeling pattern

Parameters:
pattern - new pattern

forceCheckingForChanges

void forceCheckingForChanges()
Starts checking for changes for all VCS roots of this build configuration


addToQueue

@Nullable
SQueuedBuild addToQueue(@NotNull
                                 java.lang.String triggeredBy)
Adds build instance of the configuration to the queue with the specified requestor name.

Parameters:
triggeredBy - contains details about who triggered build, see also TriggeredByBuilder
Returns:
new queued build instrance if there is no instances of this configuration in the queue, or previously added instance otherwise.

addToQueue

@Nullable
SQueuedBuild addToQueue(@NotNull
                                 BuildAgent agent,
                                 @NotNull
                                 java.lang.String triggeredBy)
Adds build instance of the configuration to the queue with the specified requestor name on the specified agent (if agent is authorized).

Parameters:
agent - specified agent.
triggeredBy - contains details about who triggered build, see also TriggeredByBuilder
Returns:
null if agent is not authorized, new SQueuedBuild instance if queue does not contain this configuration with specified agent and existing one otherwise

getQueuedBuilds

@NotNull
java.util.List<SQueuedBuild> getQueuedBuilds(@Nullable
                                                     User user)
If user is null returns all queued builds including all personal builds. If user is not null returns non personal queued builds and personal builds of the specified user.

Parameters:
user - user
Returns:
see above

getLabelingRoots

java.util.List<VcsRoot> getLabelingRoots()
List of roots whuch should be processed while labeling process

Returns:
list of up-to-date vcs roots

setLabelingRoots

void setLabelingRoots(java.util.List<VcsRoot> roots)
Changes list of roots whuch should be processed while labeling process

Parameters:
roots - new roots to be labeled

isCleanBuild

boolean isCleanBuild()
Returns if all files on an agent machine should be deleted before the build is started.

Returns:
true, if agent has to clean all sources and download all sources from the server before each build of the configuration.
See Also:
BuildTypeOptions.BT_CLEAN_BUILD

isShouldFailBuildIfTestsFailed

boolean isShouldFailBuildIfTestsFailed()
Returns true if build of the configuration has to fail if there is failed test.

Returns:
true, if build has to became failed after at least one test failed, regardless of build script exit code.
See Also:
BuildTypeOptions.BT_FAIL_IF_TESTS_FAIL

getExecutionTimeoutMin

int getExecutionTimeoutMin()
Returns duration the build allowed to run until killed by the server.

Returns:
build execution timeout in minutes, timeout 0 means 'forever'
See Also:
BuildTypeOptions.BT_EXECUTION_TIMEOUT

getMaximumNumberOfBuilds

int getMaximumNumberOfBuilds()
Returns maximum number of simultaneously running builds. 0 means there is no limit on a number of builds.

Returns:
see above
See Also:
BuildTypeOptions.BT_MAX_RUNNING_BUILDS

isAllowExternalStatus

boolean isAllowExternalStatus()
Returns if viewing of the configuration status is allowed externally.

Returns:
if viewing of the configuration status is allowed externally.
See Also:
BuildTypeOptions.BT_ALLOW_EXTERNAL_STATUS

getValueResolver

@NotNull
ValueResolver getValueResolver()
Returns value resolver that can be used to resolve values based on build type parameters.

Returns:
build type-aware resolver

copyToProject

SBuildType copyToProject(@NotNull
                         SProject target,
                         java.lang.String newName,
                         CopyOptions opts)
Copies this build configuration to the target project.

Parameters:
target - the destination project
newName - new build type name
opts - copy options
Returns:
a new build configuration

moveToProject

void moveToProject(@NotNull
                   SProject target,
                   boolean changeScopeOfLocalRoots)
Moves this build configuration to the target project.

Parameters:
target - the destination project
changeScopeOfLocalRoots - what to do with local roots

getHistory

java.util.List<SFinishedBuild> getHistory(boolean includeCanceled)
Deprecated. AFTER Calcutta, use @{link #getHistory(User, boolean)}

Returns all finished builds for the configuration.

Parameters:
includeCanceled - if canceled builds should be included.
Returns:
list of all finished builds sorted by build id descending.

getLastStartedBuild

@Nullable
SBuild getLastStartedBuild()
Deprecated. see getLastChangesStartedBuild()

Returns instance of the build, finished or running, last started in this configuration.

Returns:
last started build.

getLastFinished

@Nullable
SBuild getLastFinished()
Deprecated. see getLastChangesFinished()

Return last finished build of the configuration, excluding personal and canceled builds.

Returns:
see above

getLastSuccessfullyFinished

@Nullable
SFinishedBuild getLastSuccessfullyFinished()
Deprecated. see getLastChangesSuccessfullyFinished()

Return last finished build of the configuration, excluding personal and canceled builds.

Returns:
see above

getHistory

java.util.List<SFinishedBuild> getHistory(@Nullable
                                          User user,
                                          boolean includeCanceled)
Deprecated. After Calcutta, will be removed; use #getHistory(user, includeCanceled, orderByChanges)

Returns all finished builds, visible for the specified user of this configuration.

Parameters:
user - specified user. If user is null no personal builds will be included into the list, otherwise there will be personal builds for the specified user.
includeCanceled - if canceled builds should be included.
Returns:
list of all finished builds sorted by build id (start order) descending.

mapVcsPath

@Nullable
PathMapping mapVcsPath(@NotNull
                                java.lang.String path)
Returns path mapping for the given full VCS path of a file if this path can correspond to any of the project's VCS roots. (TODO serganch: describe the term "full VCS path" somewhere)

Parameters:
path - a full path to a file (not necessarily existing)
Returns:
the path mapping object or null if no mapping exists