Skip to content
Merged
Changes from 4 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: 12 additions & 2 deletions topics/development/multiplatform-direct-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,25 @@ To connect the Kotlin framework generated from the multiplatform project to your

![Add run script phase](xcode-run-script-phase-1.png){width=700}

5. Adjust the following script and paste the result in the run script field:
5. Adjust the following script and paste it in the script text field of the new phase:

```bash
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
exit 0
fi
cd "<Path to the root of the multiplatform project>"
./gradlew :<Shared module name>:embedAndSignAppleFrameworkForXcode
./gradlew :<Shared module name>:embedAndSignAppleFrameworkForXcode
```

* In the `cd` command, specify the path to the root of your Kotlin Multiplatform project, for example, `$SRCROOT/..`.
* In the `./gradlew` command, specify the name of the shared module, for example, `:shared` or `:composeApp`.
* When you start an iOS run configuration, IntelliJ IDEA and Android Studio build the Kotlin framework dependency
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very minor but I think the sentence would read better if you replace "IntelliJ IDEA and Android Studio" with "the IDE". So you can eliminate the double "and" (unless it's important to specify both of them).

Also, since it's not an instruction like the previous 2 points, it doesn't need to be a list item.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep the explicit mentions of IntelliJ IDEA and Android Studio since Xcode is also an IDE, and that could be confusing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to "not a list item." If you want to keep it in the list, you can rewrite it as an action point like "Start your iOS run configuration" and move all the details to a separate paragraph

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, IDEs can be ambiguous when we jump around between Xcode and IntelliJ, I keep coming up against this and deciding that it's easier to just mention them both. It's not like there's going to be another IDE on the list any time soon.

As for the list item, agreed, moved this out.

before starting the Xcode build, and set the `OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED` environment variable to "YES".
The suggested shell script checks this variable and prevents the Kotlin framework from being built a second time, from Xcode.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The suggested shell script checks this variable and prevents the Kotlin framework from being built a second time, from Xcode.
The provided shell script checks this variable and prevents the Kotlin framework from being built a second time from Xcode.


When you launch an iOS run configuration for a project that does not support this,
the IDE suggests a fix to set up the build guard.

![Add the script](xcode-run-script-phase-2.png){width=700}

Expand Down