:iphone::heart: :kotlin: :question: I very much w...
# ios
d
📱❤️ K I very much want to return to using AppCode for iOS, which on our KMM project means forming the Xcode project in a way that makes the KMM plugin within AppCode properly aware of the shared Kotlin module. Maybe this integration is still considered Alpha - the return of the KMM plugin to AppCode seems really significant but the silence from JB is puzzling. I can see from setting up a new project in each new version of AppCode, that the project structure keeps changing in some way, which suggests they're less than confident in how this should ideally work at the moment. What I want to do is retrofit the latest approach to our current project; to make the AppCode Xcode project 'aware' of the KMM module. [JB] have you settled on the way this is supposed to work yet? We are currently using the Cocoapods plugin to build the Kotlin module as a 'Development Pod'. I can see that in the latest version, these three elements are at play: • The
xcode-compat
Gradle plugin • A distinct KotlinFramework target, which accomodates the familiar call-out to Gradle for building Kotlin/Native code • A check for the environment variable
KOTLIN_NATIVE_BUILD_CAPABLE
(who sets this?) Is there any documentation or guidance out there; anyone making this work?
1
t
did I miss something? AFAIK Appcode still only supports an outdated kotlin native plugin, not KMM. they share a bunch of code of course, but that unfortunately doesn’t make them the same plugin.
just to make sure I checked the EAP and it has no up to date plugin at all anymore for me.
a
cc @Vyacheslav Karpukhin [JB]
v
Indeed, the plugin for AppCode was implemented in the "Kotlin/Native era", way before KMM announcement. Since then, there haven't been any significant changes to the project structure that the AppCode plugin uses. Still, on the gradle-side everything is more or less similar to what's happening in a regular KMM project. The
xcode-compat
plugin is just a simpler way to provide a
buildForXcode
task, everything it does can be done with a plain
kotlin-multiplatform
gradle plugin.
What I want to do is [...] make the AppCode Xcode project 'aware' of the KMM module.
This should be possible if you take the Xcode project created via project wizard as a reference and use a similar structure. I don't think there are any specific requirements to the Gradle part. Sorry there isn't an easier way to do this at the moment, but we're working on improving this aspect as well.
[JB] have you settled on the way this is supposed to work yet?
We don't really like how an Xcode and a Gradle projects are currently linked together and have a couple of ideas how this can be made easier.
A check for the environment variable 
KOTLIN_NATIVE_BUILD_CAPABLE
  (who sets this?)
This is set by the AppCode plugin, since it invokes the gradle build directly (with a better UI), so there is no need to do it via the script phase.
I checked the EAP and it has no up to date plugin at all anymore for me
The plugin is not available for 2021.1 yet, but it will be.