Skip to content

KMP migration issues clarification #288

@makeevrserg

Description

@makeevrserg

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

  1. Rename the base module
    Rename main to main-api, while keeping main-jvm and main-android as they are.

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions