|
1 | 1 | # Kotlin Native Xcode Support |
2 | 2 |
|
3 | | -Plugin to facilitate debugging iOS applications using Kotlin Native in Xcode. |
4 | | -Defines Kotlin files as source code, with basic highlighting. Allows you to |
5 | | -set breakpoints and includes llvm support to view data in the debug window. |
| 3 | +Plugin to facilitate debugging iOS applications using Kotlin Native in Xcode. Defines Kotlin files as source code, with basic highlighting. Allows you to set breakpoints and includes llvm support to view data in the debug window. Xcode does not officially support custom language definitions, but they also don't explicitly block them. |
6 | 4 |
|
7 | 5 | > ## **We're Hiring!** |
8 | 6 | > |
9 | | -> Touchlab is looking for Android-focused mobile engineers, experienced with Kotlin and |
10 | | -> looking to get involved with Kotlin Multiplatorm in the near future. [More info here](https://on.touchlab.co/2P94J5q). |
11 | | -
|
12 | | -# Xcode 11+ |
13 | | - |
14 | | -Xcode does not officially support custom language definitions, but they also don't explicitly block them. However, |
15 | | -Xcode 11 introduced several breaking changes from earlier versions, and some resolutions are still outstanding. |
16 | | - |
17 | | -## Xcode <= 10.x |
18 | | - |
19 | | -For earlier versions, please see [xcode10 branch](https://github.com/touchlab/xcode-kotlin/tree/xcode10). Life moves on, |
20 | | -and we'll only be supporting Xcode 11+. |
| 7 | +> Touchlab is looking for Android-focused mobile engineers, experienced with Kotlin and looking to get involved with Kotlin Multiplatorm in the near future. [More info here](https://on.touchlab.co/2P94J5q). |
21 | 8 |
|
22 | 9 | ## Installation |
23 | 10 |
|
24 | 11 | There are 2 parts to Kotlin support: 1) debugging support and 2) language color and style formatting. |
25 | 12 |
|
26 | | -### Step 1: Debugging Support |
| 13 | +You need to tell Xcode that `*.kt` files are source files, and run an lldb formatter script when debugging starts. Advanced users may want to do this manually, but if you have Xcode installed in the default place, you can run the setup script. |
| 14 | + |
| 15 | +### Xcode 11 |
27 | 16 |
|
28 | | -You need to tell Xcode that `*.kt` files are source files, and run an lldb formatter script when debugging starts. |
29 | | -Advanced users may want to do this manually, but if you have Xcode installed in the default place, you can run the |
30 | | -setup script. |
| 17 | +For debugging support in Xcode 11, run the installation script: |
31 | 18 |
|
32 | 19 | ``` |
33 | | -./setup.sh |
| 20 | +./setup-xcode11.sh |
34 | 21 | ``` |
35 | 22 |
|
36 | | -### Step 2: Formatting Support |
| 23 | + Xcode 11 introduced several breaking changes from earlier versions, and some resolutions are still outstanding. If you're using Xcode 11, you need to move some files into a protected area. Some users may not want to do this, and may possibly not have permissions to do this. You'll need to run the formatting support script with sufficient permissions, which generally means `sudo`. |
37 | 24 |
|
38 | | -In Xcode 11, you need to move some files into a protected area. Some users may not want to do this, and may possibly |
39 | | -not have permissions to do this. You'll need to run the script with sufficient permissions, which generally means |
40 | | -`sudo`. |
| 25 | +``` |
| 26 | +sudo ./colorsetup-xcode11.sh |
| 27 | +``` |
41 | 28 |
|
42 | 29 | *You can still debug Kotlin without formatting support, just FYI. This step is not required.* |
43 | 30 |
|
| 31 | +### All Other Xcode Versions |
| 32 | + |
| 33 | +For all other versions of Xcode, the following script will install both debugging and formatting support: |
| 34 | + |
44 | 35 | ``` |
45 | | -sudo ./colorsetup.sh |
| 36 | +./setup.sh |
46 | 37 | ``` |
47 | 38 |
|
48 | 39 | ## Kotlin 1.3.6x Issue |
@@ -70,12 +61,9 @@ The [Droidcon NYC](https://github.com/touchlab/DroidconKotlin/) app has both the |
70 | 61 |
|
71 | 62 | ### Sources |
72 | 63 |
|
73 | | -Setting up the Plugin has been an amalgam of various source projects, as Xcode "Plugins" |
74 | | -are undocumented. The most significant piece, the language color file, came from other color |
75 | | -files shipped with Xcode. Xcode plugin file from [GraphQL](https://github.com/apollographql/xcode-graphql/blob/master/GraphQL.ideplugin/Contents/Resources/GraphQL.xcplugindata) |
| 64 | +Setting up the Plugin has been an amalgam of various source projects, as Xcode "Plugins" are undocumented. The most significant piece, the language color file came from other color files shipped with Xcode. Xcode plugin file from [GraphQL](https://github.com/apollographql/xcode-graphql/blob/master/GraphQL.ideplugin/Contents/Resources/GraphQL.xcplugindata) |
76 | 65 |
|
77 | | -LLDB formatting originally comes from the Kotlin/Native project, source [konan_lldb.py](https://github.com/JetBrains/kotlin-native/blob/dbb162a4b523071f31913e888e212df344a1b61e/llvmDebugInfoC/src/scripts/konan_lldb.py), although the way data is grabbed has been heavily modified to better |
78 | | -support an interactive debugger. |
| 66 | +LLDB formatting originally comes from the Kotlin/Native project, source [konan_lldb.py](https://github.com/JetBrains/kotlin-native/blob/dbb162a4b523071f31913e888e212df344a1b61e/llvmDebugInfoC/src/scripts/konan_lldb.py), although the way data is grabbed has been heavily modified to better support an interactive debugger. |
79 | 67 |
|
80 | 68 | ## Possible Future Stuff |
81 | 69 |
|
|
0 commit comments