https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
h

Hauke Radtki

01/15/2019, 12:33 PM
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

orangy

01/15/2019, 12:59 PM
I’ve made a sample some time ago with tests and publishing in MPP https://github.com/orangy/multiplatform-lib
h

Hauke Radtki

01/15/2019, 1:00 PM
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

orangy

01/15/2019, 6:34 PM
No, I didn’t, but should be same as JVM?
h

Hauke Radtki

01/15/2019, 6:36 PM
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

orangy

01/15/2019, 6:38 PM
Can you provide more detailed description of what’s not working? May be @h0tk3y can suggest a workaround or solution.
h

Hauke Radtki

01/15/2019, 6:43 PM
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

h0tk3y

01/15/2019, 6:59 PM
@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

Hauke Radtki

01/15/2019, 7:00 PM
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

h0tk3y

01/16/2019, 9:33 AM
@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

Hauke Radtki

01/16/2019, 9:37 AM
Works as expected. You saved my day 😎
o

orangy

01/16/2019, 9:50 AM
h

h0tk3y

01/16/2019, 9:52 AM
Ah, OK, thanks.
2 Views