Kotlin and continuous integration with TeamCity
On this page, you'll learn how to configure TeamCity to build Kotlin applications. For TeamCity installation and basic setup, refer to the TeamCity documentation.
Kotlin integrates directly with standard build tools like Gradle and Maven, so configuring a Kotlin build in TeamCity requires the same workflow as any project. If you compile your project using the IntelliJ IDEA build system instead, TeamCity provides a dedicated runner.
Gradle and Maven
When you build with Gradle or Maven, the build configuration file (build.gradle.kts or pom.xml) already declares the Kotlin dependencies and compiler plugins. TeamCity does not require any additional Kotlin-specific settings.
For Gradle, add a Gradle build step to your build configuration and specify the Step name and Gradle tasks you want to run. 
Similarly, for Maven, add a Maven build step and specify the Step name and Goals you want to execute.
IntelliJ IDEA build system
If you build your project using IntelliJ IDEA project files, the Kotlin version in TeamCity must match the version configured in your IDE project. You can automate downloading and configuring the Kotlin compiler by using a TeamCity recipe. Recipes are the evolution of meta-runners: they serve the same purpose but offer additional benefits like YAML support and easy sharing on JetBrains Marketplace.
Download and import the recipe.
Download the Kotlin meta-runner file from GitHub.
Import it into TeamCity as a new recipe. For details, see Working with recipes.

Add the Kotlin compiler fetching step.
Add a build step using the imported runner.
Specify the Step name and the required Kotlin Version.

Add the compilation step. Add an IntelliJ IDEA Project runner step after the compiler-fetching step to compile the project and produce the build artifacts.

Other CI servers
If you use a CI system other than TeamCity, invoke the standard Gradle or Maven commands directly in your pipeline scripts.
What's next
Learn how to configure TeamCity for a Kotlin Multiplatform application
to build, test, and deploy Kotlin Multiplatform applications.Follow the tutorial to configure an iOS delivery pipeline for your Kotlin Multiplatform project on hosted macOS agents and automate deployments to TestFlight.
Learn how to store project settings in version control and manage your pipelines as code using the Kotlin DSL.