Skip to content

Commit 3d90bb4

Browse files
committed
update: cocoapod library examples
1 parent 6bfefc5 commit 3d90bb4

File tree

5 files changed

+51
-45
lines changed

5 files changed

+51
-45
lines changed

docs/topics/multiplatform/multiplatform-ios-dependencies.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ have some other strong reason to do so.
2828
cocoapods {
2929
version = "2.0"
3030
//..
31-
pod("FirebaseAuth") {
32-
version = "10.16.0"
33-
extraOpts += listOf("-compiler-option", "-fmodules")
31+
pod("SDWebImage") {
32+
version = "5.20.0"
33+
extraOpts += listOf("-compiler-option")
3434
}
3535
}
3636
}
@@ -42,11 +42,11 @@ have some other strong reason to do so.
4242
```groovy
4343
kotlin {
4444
cocoapods {
45-
version = "2.0"
45+
version = '2.0'
4646
//..
47-
pod('FirebaseAuth') {
48-
version = '10.16.0'
49-
extraOpts += ['-compiler-option', '-fmodules']
47+
pod('SDWebImage') {
48+
version = '5.20.0'
49+
extraOpts += ['-compiler-option']
5050
}
5151
}
5252
}
@@ -68,7 +68,7 @@ have some other strong reason to do so.
6868
To use the dependency in your Kotlin code, import the package `cocoapods.<library-name>`. For the example above, it's:
6969
7070
```kotlin
71-
import cocoapods.FirebaseAuth.*
71+
import cocoapods.SDWebImage.*
7272
```
7373
7474
### Without CocoaPods

docs/topics/multiplatform/native-cocoapods-dsl-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ kotlin {
146146

147147
pod("pod_dependency") {
148148
version = "1.0"
149-
extraOpts += listOf("-compiler-option", "-fmodules")
149+
extraOpts += listOf("-compiler-option")
150150
linkOnly = true
151151
source = path(project.file("../pod_dependency"))
152152
}

docs/topics/multiplatform/native-cocoapods-libraries.md

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ version of the library, you can just omit this parameter altogether.
4343
summary = "CocoaPods test library"
4444
homepage = "https://github.com/JetBrains/kotlin"
4545

46-
pod("FirebaseAuth") {
47-
version = "10.16.0"
48-
extraOpts += listOf("-compiler-option", "-fmodules")
46+
pod("SDWebImage") {
47+
version = "5.20.0"
48+
extraOpts += listOf("-compiler-option")
4949
}
5050
}
5151
}
@@ -57,7 +57,7 @@ version of the library, you can just omit this parameter altogether.
5757
To use these dependencies from the Kotlin code, import the packages `cocoapods.<library-name>`:
5858

5959
```kotlin
60-
import cocoapods.FirebaseAuth.*
60+
import cocoapods.SDWebImage.*
6161
```
6262

6363
## On a locally stored library
@@ -87,17 +87,17 @@ import cocoapods.FirebaseAuth.*
8787

8888
pod("pod_dependency") {
8989
version = "1.0"
90-
extraOpts += listOf("-compiler-option", "-fmodules")
90+
extraOpts += listOf("-compiler-option")
9191
source = path(project.file("../pod_dependency"))
9292
}
9393
pod("subspec_dependency/Core") {
9494
version = "1.0"
95-
extraOpts += listOf("-compiler-option", "-fmodules")
95+
extraOpts += listOf("-compiler-option")
9696
source = path(project.file("../subspec_dependency"))
9797
}
98-
pod("FirebaseAuth") {
99-
version = "10.16.0"
100-
extraOpts += listOf("-compiler-option", "-fmodules")
98+
pod("SDWebImage") {
99+
version = "5.20.0"
100+
extraOpts += listOf("-compiler-option")
101101
}
102102
}
103103
}
@@ -116,7 +116,7 @@ To use these dependencies from the Kotlin code, import the packages `cocoapods.<
116116
```kotlin
117117
import cocoapods.pod_dependency.*
118118
import cocoapods.subspec_dependency.*
119-
import cocoapods.FirebaseAuth.*
119+
import cocoapods.SDWebImage.*
120120
```
121121

122122
## From a custom Git repository
@@ -150,25 +150,25 @@ import cocoapods.FirebaseAuth.*
150150

151151
ios.deploymentTarget = "16.0"
152152

153-
pod("FirebaseAuth") {
154-
source = git("https://github.com/firebase/firebase-ios-sdk") {
155-
tag = "10.16.0"
153+
pod("SDWebImage") {
154+
source = git("https://github.com/SDWebImage/SDWebImage") {
155+
tag = "5.20.0"
156156
}
157-
extraOpts += listOf("-compiler-option", "-fmodules")
157+
extraOpts += listOf("-compiler-option")
158158
}
159159

160160
pod("JSONModel") {
161161
source = git("https://github.com/jsonmodel/jsonmodel.git") {
162162
branch = "key-mapper-class"
163163
}
164-
extraOpts += listOf("-compiler-option", "-fmodules")
164+
extraOpts += listOf("-compiler-option")
165165
}
166166

167167
pod("CocoaLumberjack") {
168168
source = git("https://github.com/CocoaLumberjack/CocoaLumberjack.git") {
169169
commit = "3e7f595e3a459c39b917aacf9856cd2a48c4dbf3"
170170
}
171-
extraOpts += listOf("-compiler-option", "-fmodules")
171+
extraOpts += listOf("-compiler-option")
172172
}
173173
}
174174
}
@@ -230,13 +230,17 @@ import cocoapods.example.*
230230
## With custom cinterop options
231231

232232
1. Specify the name of a Pod library in the `pod()` function.
233+
2. In the configuration block, add the following options:
233234

234-
In the configuration block, specify the cinterop options:
235-
* `extraOpts` – to specify the list of options for a Pod library. For example, specific flags: `extraOpts = listOf("-compiler-option")`.
236-
* `packageName` – to specify the package name. If you specify this, you can import the library using the package name:
237-
`import <packageName>`.
235+
* `extraOpts` – to specify the list of options for a Pod library. For example, `extraOpts = listOf("-compiler-option")`.
236+
237+
> If you encounter issues with clang modules, add the `-fmodules` option as well.
238+
>
239+
{style="note"}
238240

239-
2. Specify the minimum deployment target version for the Pod library.
241+
* `packageName` – to import the library directly using the package name with `import <packageName>`.
242+
243+
3. Specify the minimum deployment target version for the Pod library.
240244

241245
```kotlin
242246
kotlin {
@@ -249,28 +253,29 @@ import cocoapods.example.*
249253

250254
ios.deploymentTarget = "16.0"
251255

252-
pod("YandexMapKit") {
253-
packageName = "YandexMK"
256+
pod("FirebaseAuth") {
257+
packageName = "FirebaseAuthWrapper"
258+
version = "11.7.0"
254259
extraOpts += listOf("-compiler-option", "-fmodules")
255260
}
256261
}
257262
}
258263
```
259264

260-
3. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
265+
4. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
261266
to re-import the project.
262267

263268
To use these dependencies from the Kotlin code, import the packages `cocoapods.<library-name>`:
264269

265270
```kotlin
266-
import cocoapods.YandexMapKit.*
271+
import cocoapods.FirebaseAuth.*
267272
```
268273

269274
If you use the `packageName` parameter, you can import the library using the package name `import <packageName>`:
270275

271276
```kotlin
272-
import YandexMK.YMKPoint
273-
import YandexMK.YMKDistance
277+
import FirebaseAuthWrapper.Auth
278+
import FirebaseAuthWrapper.User
274279
```
275280

276281
### Support for Objective-C headers with @import directives
@@ -298,6 +303,7 @@ kotlin {
298303
ios.deploymentTarget = "16.0"
299304

300305
pod("PodName") {
306+
version = "1.0.0"
301307
extraOpts = listOf("-compiler-option", "-fmodules")
302308
}
303309
}

docs/topics/multiplatform/native-cocoapods-xcode.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
4040
summary = "CocoaPods test library"
4141
homepage = "https://github.com/JetBrains/kotlin"
4242
ios.deploymentTarget = "16.0"
43-
pod("FirebaseAuth") {
44-
version = "10.16.0"
45-
extraOpts += listOf("-compiler-option", "-fmodules")
43+
pod("SDWebImage") {
44+
version = "5.20.0"
45+
extraOpts += listOf("-compiler-option")
4646
}
4747
podfile = project.file("../ios-app/Podfile")
4848
}
@@ -90,9 +90,9 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
9090
ios.deploymentTarget = "16.0"
9191
tvos.deploymentTarget = "16.0"
9292
93-
pod("FirebaseAuth") {
94-
version = "10.16.0"
95-
extraOpts += listOf("-compiler-option", "-fmodules")
93+
pod("SDWebImage") {
94+
version = "5.20.0"
95+
extraOpts += listOf("-compiler-option")
9696
}
9797
podfile = project.file("../severalTargetsXcodeProject/Podfile") // specify the path to the Podfile
9898
}

docs/topics/multiplatform/native-cocoapods.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ Try these workarounds to avoid this error:
318318
319319
1. Look through the downloaded Pod directory `[shared_module_name]/build/cocoapods/synthetic/IOS/Pods/...`
320320
for the `module.modulemap` file.
321-
2. Check the framework name inside the module, for example `AppsFlyerLib {}`. If the framework name doesn't match the Pod
321+
2. Check the framework name inside the module, for example `SDWebImageMapKit {}`. If the framework name doesn't match the Pod
322322
name, specify it explicitly:
323323
324324
```kotlin
325-
pod("FirebaseAuth") {
326-
moduleName = "AppsFlyerLib"
325+
pod("SDWebImage/MapKit") {
326+
moduleName = "SDWebImageMapKit"
327327
}
328328
```
329329
#### Specify headers

0 commit comments

Comments
 (0)