Hello, and thank you for this great library!
I’d like to clarify a few points regarding KMP migration, as there seems to be some confusion around project architecture.
Version Catalogs
I noticed that multiple Gradle plugin versions are supported at the same time—specifically 2.15 and 2.11.5.
- What is the exact difference between these versions?
- Should
kotlin-ble-library only use the 2.11.x versions?
I tried updating locally to 2.15, but I didn’t observe any noticeable differences. Some clarification on the intended usage would be helpful.
Multi-Module Setup
Consider the following module structure:
|- main
|- main-jvm
|- main-android
Currently, artifacts are published with distinct pom_ids, and everything works correctly.
However, when migrating to KMP, complications arise.
If we convert the main module into a KMP module with both Android and JVM targets, it will produce multiple artifacts, such as:
- main
- main-android
- main-jvm
This creates a conflict, as publishing both main and main-android can lead to naming collisions.
Possible Solutions
-
Rename the base module
Rename main to main-api, while keeping main-jvm and main-android as they are.
-
Consolidate into a single KMP module
Move all code into the main module and use KMP sourceSets, which function similarly to JVM source sets.
An example of this approach can be found in the :core module:
https://github.com/makeevrserg/Kotlin-BLE-Library/tree/kmp-core-module
Hello, and thank you for this great library!
I’d like to clarify a few points regarding KMP migration, as there seems to be some confusion around project architecture.
Version Catalogs
I noticed that multiple Gradle plugin versions are supported at the same time—specifically
2.15and2.11.5.kotlin-ble-libraryonly use the2.11.xversions?I tried updating locally to
2.15, but I didn’t observe any noticeable differences. Some clarification on the intended usage would be helpful.Multi-Module Setup
Consider the following module structure:
Currently, artifacts are published with distinct
pom_ids, and everything works correctly.However, when migrating to KMP, complications arise.
If we convert the
mainmodule into a KMP module with both Android and JVM targets, it will produce multiple artifacts, such as:This creates a conflict, as publishing both
mainandmain-androidcan lead to naming collisions.Possible Solutions
Rename the base module
Rename
maintomain-api, while keepingmain-jvmandmain-androidas they are.Consolidate into a single KMP module
Move all code into the
mainmodule and use KMPsourceSets, which function similarly to JVM source sets.An example of this approach can be found in the
:coremodule:https://github.com/makeevrserg/Kotlin-BLE-Library/tree/kmp-core-module