Kotlin DSL - how to specify snapshot/artifact dependencies between different projects


If you use UI, then even if you have completely different projects (not parent-child relation), you are allowed to select such project's build configuration as snapshot/artifact dependencies between each other. If you use Kotlin DSL I have a hard time figuring out how to create "Id" object with the manually assigned value from a completely different project (running in the same TeamCity server, but different Kotlin DSL definition). Am I missing something, or is the Kotlin definition limited to reference only build configurations that belong to the same project? I see that Id has an only a private constructor and if I use something like

dependency { snapshot { buildType { id("something I want") }} }

then I always get prefixed Id - ie. myProjectprefix_something_I_want ... and that, of course, does not fit my project.

1 comment

Hey Tomas,

You can use AbsoluteId for that. All you need is to provide the build configuration's ID as seen on the 'General' tab of its settings. Something like this:

dependencies {
snapshot(AbsoluteId("TestProject_TestSubproject_BuildConfigA") {

Any other questions, just let me know.


Please sign in to leave a comment.