Skip to content

Commit 87617f0

Browse files
committed
WIP Update README for iOS Target
1 parent a3229ff commit 87617f0

1 file changed

Lines changed: 54 additions & 24 deletions

File tree

README.md

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ I do not aim to implement advanced features beyond what is supported by the Goog
7878

7979
## 🛠️ Tech stack
8080

81-
- [Kotlin](https://kotlinlang.org/), [Multiplatform (aka KMP)](https://kotlinlang.org/docs/multiplatform.html) (currently Desktop & Android are supported)
82-
- iOS wasn’t initially planned, but a draft version is available (use it at your own risks, bare minimum support is expected). It uses [Compose Multi Platform (aka CMP)](https://www.jetbrains.com/compose-multiplatform/).
81+
- [Kotlin](https://kotlinlang.org/), [Multiplatform (aka KMP)](https://kotlinlang.org/docs/multiplatform.html)
82+
- Android and Desktop are fully supported.
83+
- iOS wasn’t initially planned, but a draft version is available (use it at your own risks, there might be dragons 🐉).
8384
- Web is not planned any time soon (contribution are welcome 🤝)
8485
- [Kotlin coroutines](https://kotlinlang.org/docs/reference/coroutines/coroutines-guide.html)
8586
- [Ktor client](https://ktor.io/) (+ [Kotlinx serialization](https://kotlinlang.org/docs/serialization.html))
@@ -125,32 +126,13 @@ I do not aim to implement advanced features beyond what is supported by the Goog
125126
- The Desktop application (thin layer fully reusing `:tasks-app-shared`)
126127
- [`:tasks-app-android`](tasks-app-android) <span style="color: #66FF00;">■■■■■■■■</span>□□ 80%
127128
- The Android application (thin layer fully reusing `:tasks-app-shared`)
129+
- [`:tasks-app-ios/Taskfolio`](tasks-app-ios/Taskfolio) <span style="color: #33FF00;">■■■■■■■■■</span>□ 90%
130+
- The iOS application (thin layer fully reusing `:tasks-app-shared`)
131+
- Written in Swift as an Xcode project
128132
- [`website/`](website) <span style="color: #00FF00;">■■■■■■■■■■</span> 100%
129133
- The [static site](https://opatry.github.io/taskfolio/) presenting the project
130134
- Made with [Jekyll](https://jekyllrb.com/) and served by [Github pages](https://pages.github.com/)
131135

132-
## XXX iOS
133-
134-
Dev environment initial setup (cf. https://touchlab.co/xcodekotlin):
135-
```bash
136-
brew install xcode-kotlin
137-
xcode-kotlin install
138-
```
139-
140-
Sync after Xcode update:
141-
```bash
142-
xcode-kotlin sync
143-
```
144-
145-
Build native `tasks-app-shared` code as iOS XCFramework:
146-
```bash
147-
./gradlew tasks-app-shared:linkDebugFrameworkIosSimulatorArm64
148-
./gradlew tasks-app-shared:embedAndSignAppleFrameworkForXcode
149-
```
150-
151-
Either commit (but what?) or explain how to debug with Add Group > Add folders `tasks-app-shared/{commonMain,iosMain}`.
152-
cf. https://touchlab.co/xcodekotlin
153-
154136
## 🧑‍💻 Local development
155137

156138
<details>
@@ -187,6 +169,54 @@ When clicking on it, it will open a new window with the hot reload status.
187169
![](assets/compose-hot-reload-console.png)
188170
</details>
189171

172+
## 🍎 Build for iOS target
173+
174+
The support of iOS works more or less _as-is_ and gets the job done. It's provided without guarantees, use at your own risk.
175+
Feedback and contributions are welcome though 🤝.
176+
177+
<details>
178+
<summary>See details…</summary>
179+
> [!INFO]
180+
> iOS support is _opt-in_ and disabled by default to avoid unnecessary time and disk usage during the initial Gradle sync when the iOS target isn’t required.
181+
> You can enable it by setting `ios.target` Gradle property to `all`, `simulator` or `device` from either `local.properties` or CLI using `-P`.
182+
> When building from Xcode, it automatically sets `-Pios.target=simulator` based on `Config.xcconfig`.
183+
184+
You can build the `:tasks-app-shared` code for iOS using Gradle (to check if evertyhing compiles on Kotlin side):
185+
```bash
186+
./gradlew tasks-app-shared:linkDebugFrameworkIosSimulatorArm64 -Pios.target=simulator
187+
```
188+
189+
For full XCFramework build (to be consumed by the iOS application), you'll have to rely on `xcodebuild` (or build directly from Xcode):
190+
```bash
191+
cd tasks-app-ios
192+
IOS_TARGET=simulator xcodebuild -project Taskfolio.xcodeproj \
193+
-scheme Taskfolio \
194+
-sdk iphonesimulator \
195+
-arch arm64 \
196+
-configuration Debug \
197+
build \
198+
CODE_SIGNING_ALLOWED=NO \
199+
CODE_SIGN_IDENTITY="" \
200+
CODE_SIGNING_REQUIRED=NO
201+
```
202+
This triggers the `:tasks-app-shared:embedAndSignAppleFrameworkForXcode` Gradle task under the hood.
203+
204+
For Xcode integration, it's recommended to install the [Xcode Kotlin plugin](https://touchlab.co/xcodekotlin):
205+
```bash
206+
brew install xcode-kotlin
207+
xcode-kotlin install
208+
```
209+
210+
When you update Xcode, you'll have to sync the plugin:
211+
```bash
212+
xcode-kotlin sync
213+
```
214+
215+
If you want to debug the Kotlin code from Xcode, you'll have to add the needed source sets in Xcode:
216+
Add Group > Add folders as **reference** > `tasks-app-shared/{commonMain,iosMain}` (or any other module you want to debug).
217+
If you properly installed the Xcode Kotlin plugin, you'll be able to set a breakpoint in the Kotlin code and see syntax coloring as well.
218+
</details>
219+
190220
## ⚖️ License
191221

192222
```

0 commit comments

Comments
 (0)