Build Agent API Changes

After our posts about TeamCity’s new multiple build steps (previously called “multiple build runners“) feature and further changes in .NET build runners, I believe that plugin developers might have some questions to be clarified.

So today, I’m going to shed some light on the major agent-side API changes that we’ve made to support multiple build steps. I hope this post will help you to painlessly improve your build runner plugins.

AgentRunningBuild interface no longer represents parameters for a build runner. We’ve introduced new interface BuildRunnerContext that provides parameters for build runner. Starting with TeamCity 6.0 AgentRunningBuild will only describe a build.

Note that there is no getter for BuildRunnerContext in AgentRunningBuild. AgentLifeCycleListener interface now provides BuildRunnerContext in build step related methods.
We’ve added runnerFinished event and updated almost all build-related events signatures to contain AgentRunningBuild and BuildRunnerContext instances. So, in most cases one will not need to cache those instances in a plugin code.

So if you ask yourself, what to do to improve your build runner, the answer is simple. If your build runner is implemented by extending CommandLineBuildService, you need to extend BuildServiceAdapter abstract class. This class contains all getters for all parameters you may need in build runner implementation.

Of course, this post doesn’t cover all the details, but only gives general tips. So don’t hesitate to ask questions, I’ll be glad to answer.

About Eugene Petrenko

Eugene is a developer advocate at JetBrains, software developer, speaker, and blogger. His interests include software development, distributed systems design, cloud computing, and programming languages. Eugene holds a PhD in computer science; he writes code in Kotlin, Go, Java, C/C++, Kotlin/Native, and JavaScript. A Kotlin fan for years, he started using Kotlin before 1.0 and completed his first production Kotlin app back in 2013. He is known as @jonnyzzz
This entry was posted in FYI, How-To's and tagged , , , . Bookmark the permalink.

One Response to Build Agent API Changes

  1. Pingback: Tweets that mention JetBrains TeamCity Blog » Blog Archive » Build Agent API Changes --

Comments are closed.