Dependency

class Dependency(var buildTypeId: IdOwner)

Represents dependency of one build on another

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.

Constructors

Link copied to clipboard
fun Dependency(buildTypeId: IdOwner)

Functions

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

Configures artifact dependency. When this block is missing, no artifact dependency will be added.

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

Configures snapshot dependency. When this block is missing, no snapshot dependency will be added.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
var artifacts: <ERROR CLASS>

Artifact dependencies settings

Link copied to clipboard
var buildTypeId: IdOwner

id of the buildType to depend on

Link copied to clipboard
var snapshot: SnapshotDependency? = null

Snapshot dependency settings or null if there should be no snapshot dependency

Extensions

Link copied to clipboard
fun Dependency.copy(): Dependency

Copies the receiver dependency