Kotlin/dataframe

Support Kotlin Multiplatform Plugin for JVM only

mgroth0 opened this issue · 3 comments

There is already an issue for supporting multiplatform. This is issue is a (possibly) much smaller and simpler request. I am requesting support for gradle modules that are jvm-only, but still use the kotlin multiplatform gradle plugin instead of the regular kotlin("jvm") gradle plugin.

I am just getting started with kotlin dataframes so I don't yet know what degree of support there is, if any, already for the using dataframes in a multiplatform project that only defines a jvm target. However, I can say that upon trying I right away received a warning that indicated to me that there may not be support for this type of project setup:

The 'ksp' configuration is deprecated in Kotlin Multiplatform projects. Please use target-specific configurations like 'kspJvm' instead.

In the best case scenario, maybe kotlin dataframes already mostly supports the kotlin multiplatform plugin and this is just an issue where dataframes needs to make a small change to respect this warning. If that is true, here is my suggestion:

In ConvenienceSchemaGeneratorPlugin in the line that does target.configurations.getByName("ksp").dependencies.add, add add a check for if the kotlin multiplatform plugin is applied. If it is, just use the configuration "kspJvm" instead. And then further down, use "kspJvmTest" instead of "kspTest".

Best case scenario, its just a few lines of code. I could do the PR myself, but if someone more familiar with this project wants to please go ahead as I'm still getting my first look at it.

Also I am using a beta KSP version (2.0.0-Beta5-1.0.19) in case that is related

Oh, hi! We definitely want to support JVM target in multiplatform projects, so thank you for reporting this. I think it used to work, but now deprecated and needs to be fixed. I would appreciate a PR
You can check if fix works locally in your project. Run publishToMavenLocal

build.gradle.kts

id("org.jetbrains.kotlinx.dataframe") version "0.14.0-dev"

settings.gradle.kts

pluginManagement {
    repositories {
        mavenLocal()
        gradlePluginPortal()
    }
}

Hello! Just created the PR.

I might also create another issue/PR later about specifying custom configurations. For example, I have a commonJvmAndroid target (which I expect can work with dataframes since android is still java) so kspJvm might not be sufficient for this use case (I would need kspCommonJvmAndroid). Anyway, I will create a separate issue for that later if needed. The PR should close this.