https://kotlinlang.org logo
Title
r

Romain Dubreucq

01/31/2020, 11:08 AM
Hello! I have two questions on Cocoapods plugin: 1. Does the Cocoapods plugin handle remote repositories? Most of the examples I have found only show an integration where the iOS app is part of the K/N project 2. Is there a parameter to tell the plugin that the generated podspec should be at the root directory? For the moment, my multiplatform project is organized with a root project and a submodule (with a build.gradle file in each)
a

Artyom Degtyarev [JB]

01/31/2020, 1:47 PM
Hi, @Romain Dubreucq! First of all, I got to mention that this plugin is still experimental, so it can be missing some functionality. 1. Can you clarify a bit, what exactly do you want here? 2. AFAIK, there is no such option. Currently, the list of parameters is bound to version, authors, summary, etc(according to https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/cocoapods/CocoapodsExtension.kt). Also, I would like to ask about your use-case here. Maybe some practices can be recommended to achieve your goals.
r

Romain Dubreucq

01/31/2020, 2:13 PM
Thanks for your reply! 1. Basically our architecture is like this: iOS Bluetooth Framework -> Kotlin/Native Module -> iOS Wrapper Framework -> iOS Application We have two iOS applications that will use the Kotlin/Native module through a Swift wrapper framework. Our applications are pure Xcode projects and the idea is that each application Podfile should be able to reference the Kotlin/Native module from a remote repository. 2. Do you recommend to create a Gradle project without submodule? Because Cocoapods expects the podspec to be in the root directory of a pod when targeting a remote repository. If the podspec is in the module directory of a gradle project, it would probably complain about it
a

Artyom Degtyarev [JB]

02/03/2020, 12:13 PM
Okay, currently there are two options for you: If this iOS Bluetooth Framework is a CoreBluetooth, that has a platform library binding in K/N compile, then maybe it’s possible to deliver a framework as a file. One can produce a complete fat framework and use it in a hand-written podspec. The problem comes if this framework you depend on is delivered via CocoaPods. Then, you probably should try to use the plugin. Maybe it will work correctly, no one just tried it for now. About podspec location - it should be possible to extend the build.gradle with a task that moves or copies it to the root directory.
r

Romain Dubreucq

02/03/2020, 2:07 PM
Thanks for you reply! I know that we could integrate Bluetooth module into K/N, bur our code uses Swift features that are not available in Objective-C, and then can’t be generated by K/N compiler. For the Cocoapods plugin, even if I’m aware that it still is experimental, I would like to have remote repository support as it is the main purpose of a dependency manager for me. Not everyone will create its iOS application in a multiplatform project, so making K/N library available through a “standard” Cocoapods integration would be great! I will try to move the podspec in the root directory and see if it still works. Thanks again for yours replies, and for this amazing technology 🙂