Project configuration with Kotlin Toolchain
Kotlin Toolchain is a tool created by JetBrains to help you configure projects for building, packaging, publishing, and more. With Kotlin Toolchain, you can spend less time dealing with build systems and focus on addressing real business challenges instead.
Kotlin Toolchain lets you create configuration files for Kotlin Multiplatform applications that work on the JVM, Android, iOS, macOS, Windows, and Linux, as well as for multiplatform libraries that work with all of these supported targets.
How Kotlin Toolchain works
Kotlin Toolchain is a standalone CLI application, and allows configuring your project using YAML files.
With Kotlin Toolchain, you can set up platform-specific applications and shared Kotlin libraries. They are declared as modules in a module.yaml manifest file using a special declarative DSL.
The core concept of this DSL is Kotlin Multiplatform. Kotlin Toolchain allows you to configure Kotlin Multiplatform projects quickly and easily without having to dive deep into complex concepts. The Kotlin Toolchain DSL offers a special syntax enabling you to work with multiplatform configurations, including dependencies, settings, and so on.
Here is an example of a Kotlin module file for a Kotlin Multiplatform shared library that can be used with JVM, Android, and iOS applications:
The
productsection defines the project type and the list of targeted platforms.The
dependenciessection adds Maven dependencies, and in the future may support platform-specific package managers, such as CocoaPods and Swift Package Manager.The
$composenamespace is a built-in library catalog that provides access to all optional Compose modules.The
@platformqualifier marks platform-specific sections, including dependencies and settings.
Try Kotlin Toolchain
Check out Kotlin Toolchain's Getting Started guide to try it out yourself.
Feel free to submit any feedback you might have to our issue tracker. Your input will help us shape the future of Kotlin Toolchain.
What's next
Check out the Kotlin Toolchain website to read the guides and comprehensive docs.