Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Kotlin Multiplatform Plugin for JVM only #645

Closed
mgroth0 opened this issue Apr 5, 2024 · 3 comments · Fixed by #647
Closed

Support Kotlin Multiplatform Plugin for JVM only #645

mgroth0 opened this issue Apr 5, 2024 · 3 comments · Fixed by #647

Comments

@mgroth0
Copy link
Contributor

mgroth0 commented Apr 5, 2024

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.

@mgroth0
Copy link
Contributor Author

mgroth0 commented Apr 5, 2024

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

@koperagen
Copy link
Collaborator

koperagen commented Apr 5, 2024

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()
    }
}

@mgroth0
Copy link
Contributor Author

mgroth0 commented Apr 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants