Dependencies

Collection of dependencies in build configuration or template.

Example. Snapshot dependency with disabled reuse of existing builds

Snapshot dependencies form a build chain.

dependencies {
snapshot(AnotherBuild) {
reuseBuilds = ReuseBuilds.NO
}
}

Example. Artifact dependency on artifacts of some pinned build

See also artifact dependency

dependencies {
artifacts(AnotherBuild) {
buildRule = lastPinned()
// this rule will find all the jar files in the build artifacts root directory
// and place them under the "library" folder on the agent
artifactRules = "*.jar => libraries"
// this will ensure that "libraries" folder is cleaned up before the .jar files are placed there
cleanDestination = true
}
}

Example. Artifact dependency on a build outside of Kotlin DSL project

dependencies {
artifacts(AbsoluteId("Another_Project_Library")) {
buildRule = lastSuccessful()
artifactRules = "*.jar => libraries"
cleanDestination = true
}
}

In this example "Another_Project_Library" is an id of a build configuration which is not defined in the Kotlin DSL project, but exists somewhere else in the TeamCity projects hierarchy.

See also dependencies().

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun artifacts(buildType: BuildType, init: ArtifactDependency.() -> Unit)

Adds an artifact dependency on the specified buildType

fun artifacts(buildTypeId: Id, init: ArtifactDependency.() -> Unit)

Adds an artifact dependency on the buildType with the specified id

Link copied to clipboard

Copies the receiver dependencies

Link copied to clipboard

Copies the receiver dependencies to the specified target

Link copied to clipboard
fun dependency(buildTypeId: IdOwner, init: Dependency.() -> Unit)

Adds a dependency on the buildType with the specified id, it should be further configured using snapshot() and artifacts() methods. Useful when buildType is not defined in kotlin.

Link copied to clipboard
fun snapshot(buildType: BuildType, init: SnapshotDependency.() -> Unit)

Adds a snapshot dependency on the specified buildType

fun snapshot(buildTypeId: Id, init: SnapshotDependency.() -> Unit)

Adds a snapshot dependency on the buildType with the specified id