:mega: multiplatform library sample with testing a...
# multiplatform
o
šŸ“£ multiplatform library sample with testing and publishing (unofficial) https://github.com/orangy/multiplatform-lib It runs tests for jvm, js & native and can publish it to bintray and likely to maven central (didn’t try it myself). Hope it helps you set up your project for testing & distribution. Feel free to ask questions in a thread.
šŸ˜ 3
🤘 3
šŸ† 3
ā¤ļø 1
šŸ‘ 12
t
Please add iOS (including simulator) and Android
āž• 3
o
I will add iOS (I have some non-pretty code here https://github.com/orangy/lanark/blob/master/playground/build.gradle), but I don’t have an Android so maybe someone can contribute?
t
I can add some Android but not earlier than monday. Do you need help with publishing or sample app itself?
o
It’s not about an app, but rather a library. I’d appreciate setting up an Android target, together with tests and publishing.
m
AFAIK Android requires gradle 4.10+, and Native requires 4.7 (exactly)
a
I'll try this out on my project on the weekend!
j
The same with a .kts gradle build file would be nice šŸ™‚
o
New mpp gradle doesn’t support kts yet, but we’re working on it
d
I've been able to set up a multiplatform project purely in kotlin dsl with a multi-level hierarchy and 24 source sets. Yes it was difficult and I ran into a nasty bug, but the build code is clean and works well. I use the kotlin dsl for all my projects. I don't experience the problem you're talking about. However, I can't speak for many plugins. Only JB made plugins and a select few others.
g
I don’t experience the problem you’re talking about.
I’m talking about ā€œdifficultā€ and ā€œa nasty bugā€. I know this is possible, it was officially ā€œnot supportedā€ It’s nice! Looking into Kotlin 1.3.20
d
Oh, okay. Interesting. What do dynamic functions look like in kotlin dsl?
g
you just cannot call fromPreset, this function is not available. https://youtrack.jetbrains.com/issue/KT-28635
d
I think I'm using that.. Let me check
Ah, I implemented it myself. Never mind
g
@orangy I'm having an issue with a multiplatform lib where common tests are ignored by the JVM. Decided to clone your repo (thank you šŸ™Œ) and try it out, but the result is the same. Using
./gradlew jvmTest
, no JVM tests run, although it says "BUILD SUCCESSFUL". šŸ˜• Any hints?
JS and Native runs like a charm.
o
Does it run them with
cleanJvmTest jvmTest
? Gradle tries to not run tests, if possible on JVM
g
Hum, it does! šŸ¤”