Hi! I am new to Kotlin Toolchain. I decided to mig...
# kotlin-toolchain
g
Hi! I am new to Kotlin Toolchain. I decided to migrate my project from Gradle to Kotlin Toolchain. So I have several questions: 1. Does Kotlin Toolchain support importing other Kotlin Toolchain projects? My case is that I have an open-source library project that is available on GitHub and a sandbox project that is local on my computer and uses the library project's modules as it dependencies. In Gradle, I make it via including library via
includeBuild
and then declare Gradle modules as dependency modules. So I can publish my project sources as a standalone Gradle project and use it locally in my sandbox. How do I do it using Kotlin Toolchain instead? 2. Can one declare a multiplatform module with run tasks for each platform in Kotlin Toolchain? In previously mentioned sandbox Gradle project, I could use exactly one module to run very very simple code on several platforms. So I don't have to create a separate module for each platform just to run simple code. Is it possible to do something similar in Kotlin Toolchain? If it's not, is it planned?
j
Hi Gleb! Thanks for the questions 1. The Kotlin Toolchain doesn't support included builds like Gradle. You can use your library by publishing it to a Maven repository and depending on it normally via maven coordinates. If you want to use the "unpublished" version of your local library code, you can publish it to the local maven repository on your machine (with for instance a snapshot version), and then use that version from your other project. 2. The Kotlin Toolchain doesn't support having multiple applications in a single module. You have to declare modules for each application you want to support. This is because we want a simpler project model: each module handles one "product". Each application type has different packaging formats and execution runtimes, so the different modules represent this. Note that creating application modules is very easy though, it can be a one liner
module.yaml
(or just with the added dependency on a shared
kmp/lib
module)
👍 1
👍🏻 1