DslContext

object DslContext

Context of DSL execution

Functions

Link copied to clipboard
fun addParameters(vararg pairs: <ERROR CLASS><String, String>)

Add a parameter to this context, the function is intented to be used in Kotlin DSL tests

Link copied to clipboard
fun clearParameters()
Link copied to clipboard
fun createId(value: String): Id

Creates relative id if context is relative, otherwise creates an absolute id.

Link copied to clipboard
fun getParameter(name: String, defaultValue: String? = null): String

Returns the value of the context parameter specified in Versioned Settings UI. If defaultValue is null and the parameter is not defined, then DSL code will fail and the corresponding error will be shown in the UI.

Properties

Link copied to clipboard
val baseDir: File

When DSL scripts are executed, current working directory can point to some temporary folder. This temporary folder may not have contents of .teamcity directory. If one needs to read some files from .teamcity/ directory, they should construct File instances with the baseDir property as parent.

Link copied to clipboard
val hasSettingsRootId: Boolean

Returns true if context provides an id of the settings VCS root.

Link copied to clipboard
val isRelative: Boolean

Returns true if the context of DSL execution is relative.

Link copied to clipboard
var parentProjectId: AbsoluteId

Absolute parent id of the project where versioned settings are enabled. Can be used only in relative DSL context.

Link copied to clipboard
var projectId: AbsoluteId

Absolute id of the project where versioned settings are enabled. Can be used only in relative DSL context.

Link copied to clipboard
var projectName: String

Name of the project where versioned settings are enabled. Can be used only in relative DSL context.

Link copied to clipboard
val settingsRoot: VcsRoot

VCS root where settings are stored. Contains only root id, doesn't contain vcs type or parameters. Can be used only in relative DSL context.

Link copied to clipboard
var settingsRootId: AbsoluteId

Absolute id of the VCS root where settings are stored. Can be used only in relative DSL context.