Hi everyone :wave: In our Kotlin/Ktor/Android cour...
# koin
p
Hi everyone 👋 In our Kotlin/Ktor/Android course, we are using Kotlin Toolchain (Amper). This worked really well for our students when building the Ktor backend service. Now they start building the Android app and want to keep using Kotlin Toolchain. My question: Is the Koin Compiler Plugin (or Koin Annotations) supported / configurable in an Kotlin Toolchain (module.yaml) project?
i
Should be as simple, as:
Copy code
product: android/app

dependencies:
  - io.insert-koin:koin-android:4.2.2
  - io.insert-koin:koin-annotations:4.2.2

settings:
  android:
    namespace: com.example.courseapp

  kotlin:
    version: 2.4.21
    compilerPlugins:
      - id: io.insert-koin.compiler.plugin
        dependency: io.insert-koin:koin-compiler-plugin:1.2.1
p
Thank you! I should have searched the Kotlin-toolchain documentation, it is documented here: kotlin-toolchain.org/dev/user-guide/advanced/kotlin-compiler-plugins?h=koin#… (except the mentioned version is outdated)
👍 1
i
Yep, also, it might be fun to convert ktc to gradle to see difference between them github.com/Heapy/ktc-to-gradle And if some plugins required for ktc github.com/Heapy/ktc-plugins
p
Nice to see your fallback solution in case KTC is not mature yet for some project! For new projects it makes the decision to use Kotlin Toolchain a lot easier. It might be worth mentioning in the documentation of your project that the reverse (gradle-to-ktc) is not that simple, motivating to choose KTC for new projects. For our (educational) situation, this is our biggest inconvenience at the moment is: youtrack.jetbrains.com/issue/KTC-4921 Currently Kotlin Toolchain is focused on KMP, but for our project we need just adding an Android module (a KTC version of Android Studio template 'Empty Activity').
👍 1
i
It might be worth mentioning in the documentation of your project that the reverse (gradle-to-ktc) is not that simple, motivating to choose KTC for new projects.
Yep, make total sense, I'll add it to readme