Closed natanfudge closed 5 years ago
Do you have this line in your settings.gradle
?
Kotlin multiplatform relies on gradle metadata to resolve different artifacts from the same name. Basically, scientifik:plotlykt-core
and scientifik:plotlykt-core-jvm
are two different projects, and you need to add a specific dependency for each of your platforms. If you have gradle metadata enabled, then your kotlin plugin could find appropriate platform artifact from the root dependency (scientifik:plotlykt-core
). I've tested it and it seemed to be working with gradle metadata enabled: https://github.com/mipt-npm/plotly.kt/blob/dev/examples/build.gradle.kts.
I do have that line. I updated the build.gradle with the common, jvm, and js dependencies of the library, still doesn't work. Try to see if you have the same issue with this project: https://github.com/natanfudge/plotlyktmpptest
You have multiple problems in the build. The major one is that you seem to have old gradle wrapper, 4.11 does not seem to properly support metadata feature (try to use 5+). Second, you do not have all repositories. It should look like this:
repositories {
jcenter()
maven{ url = "https://dl.bintray.com/mipt-npm/dataforge"}
maven{ url = "https://dl.bintray.com/mipt-npm/scientifik"}
maven{ url = "https://kotlin.bintray.com/kotlinx"}
// maven{ url = "https://dl.bintray.com/kotlin/ktor/"}
}
And finally, you should comment native targets. Currently, we do not support them. If you want native target, we can try to add it, but then please add a separate feature request.
Thanks for this issue, I will update README with proper build instructions.
I found that all but gradle version is already in readme in dev branch: https://github.com/mipt-npm/plotly.kt/tree/dev. I will merge it later.
Hey, I made a new Kotlin Multi Platform project with the following build.gradle:
Although trying to import
scientifik.*
does not compile. I tried again in a gradle-jvm project:And still no luck. If I change
scientifik:plotlykt-core:0.1.1
toscientifik:plotlykt-core-jvm:0.1.1
itdoes workseems to work, but build failes. Please explain how to use the library as a dependency.