https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
a

ankur2037

09/28/2023, 5:18 PM
Hi 👋. Please help here. I have two KMP projects, P1 and P2, where P2 -> P1. P1 purely has Kotlin code and doesn't have any platform-specific code. P2 does have Android and iOS-specific code and is also consuming P1. P1 is using a Maven repository for publishing artifacts. I was planning to use a Linux-based machine for CI-CD publishing of P1 and a Mac-based machine for P2 for further consumption. While testing the above setup, I am getting an error where P2 is not able to resolve iOS-specific artifacts from P1. I understand that my Linux-based machine will not be publishing iOS-specific artifacts, but I am not able to understand why iOS-based artifacts from P1 are required by P2 given that P1 doesn't have any platform-specific code.
j

jw

09/28/2023, 5:20 PM
There is no such thing as common or platform-agnostic code in the current setup of how Kotlin compiles code. As such, each library must compile source to each supported target.
a

ankur2037

09/28/2023, 5:38 PM
Thanks for clarifying that. So there is no other way than to use a Mac-based machine instead of a Linux-based one to publish artifacts for all our internal KMP projects from CI-CD?
j

jw

09/28/2023, 5:38 PM
Yes, unfortunately.
👍 1
j

Jan Skrasek

09/28/2023, 5:46 PM
Do you know if there is a plan to change this?
j

jw

09/28/2023, 5:47 PM
Certainly nothing near-term as it's a fairly fundamental change in behavior both from the perspective of the library publishing but also library consuming.
❤️ 3