Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions docs/topics/multiplatform/multiplatform-ios-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ have some other strong reason to do so.
cocoapods {
version = "2.0"
//..
pod("FirebaseAuth") {
version = "10.16.0"
extraOpts += listOf("-compiler-option", "-fmodules")
pod("SDWebImage") {
version = "5.20.0"
}
}
}
Expand All @@ -42,11 +41,10 @@ have some other strong reason to do so.
```groovy
kotlin {
cocoapods {
version = "2.0"
version = '2.0'
//..
pod('FirebaseAuth') {
version = '10.16.0'
extraOpts += ['-compiler-option', '-fmodules']
pod('SDWebImage') {
version = '5.20.0'
}
}
}
Expand All @@ -68,7 +66,7 @@ have some other strong reason to do so.
To use the dependency in your Kotlin code, import the package `cocoapods.<library-name>`. For the example above, it's:

```kotlin
import cocoapods.FirebaseAuth.*
import cocoapods.SDWebImage.*
```

### Without CocoaPods
Expand Down
18 changes: 9 additions & 9 deletions docs/topics/multiplatform/native-cocoapods-dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ a separate function call.
You can specify the name of a Pod library in the function parameters and additional parameter values, like the `version`
and `source` of the library, in its configuration block:

| **Name** | **Description** |
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `version` | The library version. To use the latest version of the library, omit the parameter. |
| **Name** | **Description** |
|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `version` | The library version. To use the latest version of the library, omit the parameter. |
| `source` | Configures the Pod from: <list><li>The Git repository using `git()`. In the block after `git()`, you can specify `commit` to use a specific commit, `tag` to use a specific tag, and `branch` to use a specific branch from the repository</li><li>The local repository using `path()`</li></list> |
| `packageName` | Specifies the package name. |
| `extraOpts` | Specifies the list of options for a Pod library. For example, specific flags: <code-block lang="Kotlin">extraOpts = listOf("-compiler-option")</code-block> |
| `linkOnly` | Instructs the CocoaPods plugin to use Pod dependencies with dynamic frameworks without generating cinterop bindings. If used with static frameworks, the option will remove the Pod dependency entirely. |
| `interopBindingDependencies` | Contains a list of dependencies to other Pods. This list is used when building a Kotlin binding for the new Pod. |
| `useInteropBindingFrom()` | Specifies the name of the existing Pod that is used as dependency. This Pod should be declared before the function execution. The function instructs the CocoaPods plugin to use a Kotlin binding of the existing Pod when building a binding for the new one. |
| `packageName` | Specifies the package name. |
| `extraOpts` | Specifies the list of options for a Pod library. For example, specific flags: <code-block lang="Kotlin">extraOpts = listOf("-compiler-option")</code-block> |
| `linkOnly` | Instructs the CocoaPods plugin to use Pod dependencies with dynamic frameworks without generating cinterop bindings. If used with static frameworks, the option will remove the Pod dependency entirely. |
| `interopBindingDependencies` | Contains a list of dependencies to other Pods. This list is used when building a Kotlin binding for the new Pod. |
| `useInteropBindingFrom()` | Specifies the name of the existing Pod that is used as dependency. This Pod should be declared before the function execution. The function instructs the CocoaPods plugin to use a Kotlin binding of the existing Pod when building a binding for the new one. |

```kotlin
kotlin {
Expand All @@ -146,7 +146,7 @@ kotlin {

pod("pod_dependency") {
version = "1.0"
extraOpts += listOf("-compiler-option", "-fmodules")
extraOpts += listOf("-compiler-option")
linkOnly = true
source = path(project.file("../pod_dependency"))
}
Expand Down
55 changes: 28 additions & 27 deletions docs/topics/multiplatform/native-cocoapods-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ version of the library, you can just omit this parameter altogether.
summary = "CocoaPods test library"
homepage = "https://github.com/JetBrains/kotlin"

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

```kotlin
import cocoapods.FirebaseAuth.*
import cocoapods.SDWebImage.*
```

## On a locally stored library
Expand Down Expand Up @@ -87,17 +86,16 @@ import cocoapods.FirebaseAuth.*

pod("pod_dependency") {
version = "1.0"
extraOpts += listOf("-compiler-option", "-fmodules")
extraOpts += listOf("-compiler-option")
source = path(project.file("../pod_dependency"))
}
pod("subspec_dependency/Core") {
version = "1.0"
extraOpts += listOf("-compiler-option", "-fmodules")
extraOpts += listOf("-compiler-option")
source = path(project.file("../subspec_dependency"))
}
pod("FirebaseAuth") {
version = "10.16.0"
extraOpts += listOf("-compiler-option", "-fmodules")
pod("SDWebImage") {
version = "5.20.0"
}
}
}
Expand All @@ -116,7 +114,7 @@ To use these dependencies from the Kotlin code, import the packages `cocoapods.<
```kotlin
import cocoapods.pod_dependency.*
import cocoapods.subspec_dependency.*
import cocoapods.FirebaseAuth.*
import cocoapods.SDWebImage.*
```

## From a custom Git repository
Expand Down Expand Up @@ -150,25 +148,22 @@ import cocoapods.FirebaseAuth.*

ios.deploymentTarget = "16.0"

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

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

pod("CocoaLumberjack") {
source = git("https://github.com/CocoaLumberjack/CocoaLumberjack.git") {
commit = "3e7f595e3a459c39b917aacf9856cd2a48c4dbf3"
}
extraOpts += listOf("-compiler-option", "-fmodules")
}
}
}
Expand Down Expand Up @@ -230,13 +225,17 @@ import cocoapods.example.*
## With custom cinterop options

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

In the configuration block, specify the cinterop options:
* `extraOpts` – to specify the list of options for a Pod library. For example, specific flags: `extraOpts = listOf("-compiler-option")`.
* `packageName` – to specify the package name. If you specify this, you can import the library using the package name:
`import <packageName>`.
* `extraOpts` – to specify the list of options for a Pod library. For example, `extraOpts = listOf("-compiler-option")`.

> If you encounter issues with clang modules, add the `-fmodules` option as well.
>
{style="note"}

2. Specify the minimum deployment target version for the Pod library.
* `packageName` – to import the library directly using the package name with `import <packageName>`.

3. Specify the minimum deployment target version for the Pod library.

```kotlin
kotlin {
Expand All @@ -249,28 +248,29 @@ import cocoapods.example.*

ios.deploymentTarget = "16.0"

pod("YandexMapKit") {
packageName = "YandexMK"
pod("FirebaseAuth") {
packageName = "FirebaseAuthWrapper"
version = "11.7.0"
extraOpts += listOf("-compiler-option", "-fmodules")
}
}
}
```

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

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

```kotlin
import cocoapods.YandexMapKit.*
import cocoapods.FirebaseAuth.*
```

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

```kotlin
import YandexMK.YMKPoint
import YandexMK.YMKDistance
import FirebaseAuthWrapper.Auth
import FirebaseAuthWrapper.User
```

### Support for Objective-C headers with @import directives
Expand Down Expand Up @@ -298,6 +298,7 @@ kotlin {
ios.deploymentTarget = "16.0"

pod("PodName") {
version = "1.0.0"
extraOpts = listOf("-compiler-option", "-fmodules")
}
}
Expand Down
10 changes: 4 additions & 6 deletions docs/topics/multiplatform/native-cocoapods-xcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
summary = "CocoaPods test library"
homepage = "https://github.com/JetBrains/kotlin"
ios.deploymentTarget = "16.0"
pod("FirebaseAuth") {
version = "10.16.0"
extraOpts += listOf("-compiler-option", "-fmodules")
pod("SDWebImage") {
version = "5.20.0"
}
podfile = project.file("../ios-app/Podfile")
}
Expand Down Expand Up @@ -90,9 +89,8 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
ios.deploymentTarget = "16.0"
tvos.deploymentTarget = "16.0"

pod("FirebaseAuth") {
version = "10.16.0"
extraOpts += listOf("-compiler-option", "-fmodules")
pod("SDWebImage") {
version = "5.20.0"
}
podfile = project.file("../severalTargetsXcodeProject/Podfile") // specify the path to the Podfile
}
Expand Down
6 changes: 3 additions & 3 deletions docs/topics/multiplatform/native-cocoapods.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ Try these workarounds to avoid this error:

1. Look through the downloaded Pod directory `[shared_module_name]/build/cocoapods/synthetic/IOS/Pods/...`
for the `module.modulemap` file.
2. Check the framework name inside the module, for example `AppsFlyerLib {}`. If the framework name doesn't match the Pod
2. Check the framework name inside the module, for example `SDWebImageMapKit {}`. If the framework name doesn't match the Pod
name, specify it explicitly:

```kotlin
pod("FirebaseAuth") {
moduleName = "AppsFlyerLib"
pod("SDWebImage/MapKit") {
moduleName = "SDWebImageMapKit"
}
```
#### Specify headers
Expand Down