From 1d2558cd94b47c57cfc1f552e49b9ff950573f75 Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Mon, 16 Apr 2018 18:18:58 +0700 Subject: [PATCH] [mpp-readme] Concretize some points about an Xcode project --- MULTIPLATFORM.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/MULTIPLATFORM.md b/MULTIPLATFORM.md index 65f1cfc2193..4f10c401cc0 100644 --- a/MULTIPLATFORM.md +++ b/MULTIPLATFORM.md @@ -300,20 +300,27 @@ building the framework to Gradle. To do this, make the following steps: -1. Create a new Xcode project using `iosApp` as a root directory for it. +1. Create a new Xcode project in the root directory of our project (the `application` directory in the +[section 1](#1-preparing-a-workspace)). Name it `iosApp` so Xcode will create the project in the directory we created +in the section 1. 2. Add a new framework in the project. Go `File` -> `New` -> `Target` -> `Cocoa Touch Framework`. Specify the same framework name as in `greeting/ios/build.gradle`: `Greeting`. -3. Choose the new framework in the `Project Navigator` and open `Build Settings` tab. Here we need to add a new build -setting specifying what Gradle task will be executed to build the framework for one or another platform. Create this -build setting in the `User-defined` section, name it `KONAN_TASK` and specify the following values for it depending on -the platform: - * For any iOS simulator (both debug and release): `compileKonanIos_x64` - * For any iOS device (both debug and release): `compileKonanIos_arm64` +3. Choose the new framework in the `Project Navigator` and open the `Build Settings` tab. Here we need to add a new build +setting specifying what Gradle task will be executed to build the framework for one or another platform. Fortunately, +Xcode allows us to set different values for the same build setting depending on the platform. Create a new build +setting in the `User-defined` section and name it `KONAN_TASK`. Then specify the following values of it for different +platforms (for both `Debug` and `Release` modes): + + |Platform |Value | + |-----------------------|---------------------------------------| + |`Any iOS simulator SDK`|`compileKonanIos_x64` | + |`Any iOS SDK` |`compileKonanIos_arm64`| Replace `` with the name you specified in the library's `ios/build.gradle`. Use camel case, e.g. for our `greeting` library these tasks will be named `compileKonanGreetingIos_x64` and `compileKonanGreetingIos_arm64`. -4. Select the `Build phases` tab and remove all default phases except `Target Dependencies`. +4. Ensure that the framework is still selected in the `Project Navigator` and open the `Build phases` tab. Remove all +default phases except `Target Dependencies`. 5. Add a new `Run Script` build phase and put the following line into the script field: ```