Skip to content

Commit a411e9f

Browse files
authored
update: cocoapods instructions improvements (#4307)
1 parent 668633d commit a411e9f

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ have some other strong reason to do so.
5858
* [From a custom Podspec repository](native-cocoapods-libraries.md#from-a-custom-podspec-repository)
5959
* [With custom cinterop options](native-cocoapods-libraries.md#with-custom-cinterop-options)
6060

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

6364
To use the dependency in your Kotlin code, import the package `cocoapods.<library-name>`. For the example above, it's:
6465

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
To add dependencies between a Kotlin project and a Pod library, [complete the initial configuration](native-cocoapods.md#set-up-an-environment-to-work-with-cocoapods).
44
You can then add dependencies on different types of Pod libraries.
55

6-
When you add a new dependency and re-import the project in IntelliJ IDEA, the new dependency will be added automatically.
6+
When you add a new dependency and re-import the project in your IDE, the new dependency will be added automatically.
77
No additional steps are required.
88

99
To use your Kotlin project with Xcode, you should [make changes in your project Podfile](native-cocoapods.md#update-podfile-for-xcode).
@@ -49,7 +49,8 @@ version of the library, you can just omit this parameter altogether.
4949
}
5050
```
5151

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

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

@@ -101,7 +102,8 @@ import cocoapods.FirebaseAuth.*
101102
>
102103
{type="note"}
103104

104-
3. Re-import the project.
105+
3. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
106+
to re-import the project.
105107

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

@@ -162,7 +164,8 @@ import cocoapods.FirebaseAuth.*
162164
}
163165
```
164166

165-
3. Re-import the project.
167+
3. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
168+
to re-import the project.
166169

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

@@ -198,7 +201,8 @@ import cocoapods.CocoaLumberjack.*
198201
}
199202
```
200203

201-
4. Re-import the project.
204+
4. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
205+
to re-import the project.
202206

203207
> To work correctly with Xcode, you should specify the location of specs at the beginning of your Podfile.
204208
> For example,
@@ -242,7 +246,8 @@ import cocoapods.example.*
242246
}
243247
```
244248

245-
3. Re-import the project.
249+
3. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
250+
to re-import the project.
246251

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

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
5959
end
6060
```
6161

62-
6. Re-import the project.
62+
6. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
63+
to re-import the project.
6364

6465
## Xcode project with several targets
6566

@@ -108,6 +109,12 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
108109
end
109110
```
110111
111-
6. Re-import the project.
112+
6. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
113+
to re-import the project.
112114
113-
You can find a sample project [here](https://github.com/Kotlin/kmm-with-cocoapods-multitarget-xcode-sample).
115+
You can find a sample project [here](https://github.com/Kotlin/kmm-with-cocoapods-multitarget-xcode-sample).
116+
117+
## What's next
118+
119+
See [Connect the framework to your iOS project](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-integrate-in-existing-app.html#connect-the-framework-to-your-ios-project)
120+
to learn how to add a custom build script to build phases in Xcode projects.

docs/topics/native/native-cocoapods.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
Kotlin/Native provides integration with the [CocoaPods dependency manager](https://cocoapods.org/). You can add dependencies
44
on Pod libraries as well as use a multiplatform project with native targets as a CocoaPods dependency.
55

6-
You can manage Pod dependencies directly in IntelliJ IDEA and enjoy all the additional features such as code highlighting
7-
and completion. You can build the whole Kotlin project with Gradle and not ever have to switch to Xcode.
6+
You can manage Pod dependencies directly in IntelliJ IDEA or Android Studio and enjoy all the additional features such as
7+
code highlighting and completion. You can build the whole Kotlin project with Gradle and not ever have to switch to Xcode.
88

9-
Use Xcode only when you need to write Swift/Objective-C code or run your application on a simulator or device.
9+
You only need Xcode if you want to change Swift/Objective-C code or run your application on an Apple simulator or device.
1010
To work correctly with Xcode, you should [update your Podfile](#update-podfile-for-xcode).
1111

1212
Depending on your project and purposes, you can add dependencies between [a Kotlin project and a Pod library](native-cocoapods-libraries.md)
@@ -91,21 +91,6 @@ sudo gem install cocoapods
9191
</tab>
9292
</tabs>
9393
94-
<procedure initial-collapse-state="collapsed" title="If you use Kotlin prior to version 1.7.0">
95-
<p>If your current version of Kotlin is earlier than 1.7.0, additionally install the <a href="https://github.com/square/cocoapods-generate"><code>cocoapods-generate</code></a> plugin:</p>
96-
<p>
97-
<code style="block"
98-
lang="bash">
99-
sudo gem install -n /usr/local/bin cocoapods-generate
100-
</code>
101-
</p>
102-
<tip>
103-
<p>
104-
Mind that <code>cocoapods-generate</code> couldn't be installed on Ruby 3.0.0 and later. If it's your case, downgrade Ruby or upgrade Kotlin to 1.7.0 or later.
105-
</p>
106-
</tip>
107-
</procedure>
108-
10994
If you encounter problems during the installation, check the [Possible issues and solutions](#possible-issues-and-solutions) section.
11095
11196
## Add and configure Kotlin CocoaPods Gradle plugin
@@ -170,9 +155,10 @@ If you want to configure your project manually:
170155
>
171156
{type="note"}
172157
173-
3. Re-import the project.
158+
3. Run **Reload All Gradle Projects** in IntelliJ IDEA (or **Sync Project with Gradle Files** in Android Studio)
159+
to re-import the project.
174160
4. Generate the [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) to avoid compatibility
175-
issues during an Xcode build.
161+
issues during an Xcode build.
176162
177163
When applied, the CocoaPods plugin does the following:
178164
@@ -213,7 +199,8 @@ of specs at the beginning of your Podfile:
213199
end
214200
```
215201
216-
> Re-import the project after making changes in the Podfile.
202+
> After making changes in the Podfile, run **Reload All Gradle Projects** in IntelliJ IDEA
203+
> (or **Sync Project with Gradle Files** in Android Studio) to re-import the project.
217204
>
218205
{type="note"}
219206

0 commit comments

Comments
 (0)