Skip to content

Commit ecf8c73

Browse files
authored
update: add the instructions for run script phase when enabling Swift export (#4617)
1 parent ec61d85 commit ecf8c73

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed
183 KB
Loading

docs/topics/whatsnew21.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,29 @@ which you can access from Xcode.
669669
#### How to enable Swift export
670670

671671
Keep in mind that the feature is currently only in the early stages of development.
672-
To try it out in your project, add the following Gradle option to your `gradle.properties` file:
673672

674-
```none
675-
# gradle.properties
676-
kotlin.experimental.swift-export.enabled=true
677-
```
673+
Swift export currently works in projects that use
674+
[direct integration](multiplatform-direct-integration.md) to connect the iOS framework to the Xcode project.
675+
This is a standard configuration for Kotlin Multiplatform projects created in Android Studio or through the [web wizard](https://kmp.jetbrains.com/).
676+
677+
To try out Swift export in your project:
678+
679+
1. Add the following Gradle option to your `gradle.properties` file:
680+
681+
```none
682+
# gradle.properties
683+
kotlin.experimental.swift-export.enabled=true
684+
```
685+
686+
2. In Xcode, open the project settings.
687+
3. On the **Build Phases** tab, locate the **Run Script** phase with the `embedAndSignAppleFrameworkForXcode` task.
688+
4. Adjust the script to feature the `embedSwiftExportForXcode` task instead in the run script phase:
689+
690+
```bash
691+
./gradlew :<Shared module name>:embedSwiftExportForXcode
692+
```
693+
694+
![Add the Swift export script](xcode-swift-export-run-script-phase.png){width=700}
678695

679696
#### Leave feedback on Swift export
680697

0 commit comments

Comments
 (0)