Is there a up-to-date resource that I can read reg...
# multiplatform
h
Is there a up-to-date resource that I can read regarding publishing a MPP library? I only get as far as publishing to mavenLocal
Especially when using the multiplatform plugin (and not the old method (kotlin-platform-{common,native,jvm}))
o
I’ve made a sample some time ago with tests and publishing in MPP https://github.com/orangy/multiplatform-lib
h
Thanks 👍
Did you test that with an android target (i.e. from presets.android)? For me the info is missing in the gradle metadata (other targets are correct though)
o
No, I didn’t, but should be same as JVM?
h
I'm pretty confident that it is not an issue of your example (which was really helpful!) but with the way the multiplatform gradle plugin creates the publications. Do you have an idea where I can look for a workaround?
o
Can you provide more detailed description of what’s not working? May be @h0tk3y can suggest a workaround or solution.
h
Sure, I will put together a minimal example. But in the meantime: I test this with publishToMavenLocal, it generates folders for all variants (I use iOS, Android and now JVM for additional testing) plus a folder for metadata. Layout: com.example --> lib --> lib-android --> lib-jvm --> lib-iOS --> lib-metadata lib-android contains no artifacts. And if I force it to contain the librarie's aars, they are not recognized. I guess because the metadata (i figure the *.module file contains it) does not have any information about the actual files
https://github.com/HaukeRa/KotlinMultiplatformTest/tree/metadata checkout --> "gradlew build publishToMavenLocal" --> inspect contents of %HOME%/.m2/com.example folder
h
@Hauke Radtki Publishing of Android targets was not yet implemented in 1.3.11 (https://youtrack.jetbrains.com/issue/KT-27535). This feature will be available in 1.3.20 (you will be able to try it in the upcoming 1.3.20 EAP-3, though not in the previous EAPs).
🙏 1
h
Ah, thanks for the info. Somehow my search did not bring up this issue. I will give it a try!
@h0tk3y 1.3.20-eap-100 (which should be EAP-3, correct?) doesn't generate anything for android, is further configuration needed?
h
@Hauke Radtki 1.3.20-eap-100 is currently under testing, we will likely announce it as the EAP 3 or deploy a new build if we find any issues with that one. Yes, it requires additional configuration for publishing Android libraries. You need to choose which variants to publish, none are published by default in this version. It is done as follows if you only want to publish the
release
variant:
Copy code
kotlin {
    android { // configure the Android target
        publishLibraryVariants("release")
    }
}
I'll post more details in the #multiplatform channel once we announce the EAP 3.
🙏 1
h
Works as expected. You saved my day 😎
o
h
Ah, OK, thanks.