Skip to content

Commit 1a822b1

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

File tree

1 file changed

+63
-27
lines changed

1 file changed

+63
-27
lines changed

README.md

Lines changed: 63 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
The coverage report excludes code not intended to be covered.
1111

12-
This avoids the [“broken window” effect](https://blog.codinghorror.com/the-broken-window-theory/): whether coverage is at 43% or 56%, its perceived as equally low—so efforts to improve it are often dismissed. In contrast, high or near-100% coverage is seen as achievable and worth tracking.
12+
This avoids the [“broken window” effect](https://blog.codinghorror.com/the-broken-window-theory/): whether coverage is at 43% or 56%, it's perceived as equally low—so efforts to improve it are often dismissed. In contrast, high or near-100% coverage is seen as achievable and worth tracking.
1313

1414
Refer to the root project's [`build.gradle.kts`](build.gradle.kts#L55-L90) for details.
1515

@@ -36,9 +36,10 @@ Refer to the root project's [`build.gradle.kts`](build.gradle.kts#L55-L90) for d
3636

3737
[**Taskfolio**](https://opatry.github.io/taskfolio) is an Android task management app built using [Google Tasks API](https://developers.google.com/tasks/reference/rest). Developed to demonstrate my expertise in modern Android development, it highlights my skills in architecture, UI design with Jetpack Compose, OAuth authentication, and more—all packaged in a sleek, user-friendly interface.
3838

39-
> [!INFO] The application is also available as a desktop (Jvm) application and an iOS application as well (using [Compose Multi Platform (aka CMP)](https://www.jetbrains.com/compose-multiplatform/) as UI Toolkit).
39+
> [!NOTE]
40+
> The application is also available as a desktop (Jvm) application and an iOS application as well (using [Compose Multi Platform (aka CMP)](https://www.jetbrains.com/compose-multiplatform/) as UI Toolkit).
4041
41-
> I set out to revisit the classical TODO app, ‘local-first syncing with Google Tasks—aiming for an <abbr title="Minimum Viable Experience">MVE</abbr> in 2 weeks, focusing on the 80/20 rule to nail the essentials.
42+
> I set out to revisit the classical TODO app, ‘local-first' syncing with Google Tasks—aiming for an <abbr title="Minimum Viable Experience">MVE</abbr> in 2 weeks, focusing on the 80/20 rule to nail the essentials.
4243
4344
| ![](assets/screens/task_lists_light.png) | ![](assets/screens/groceries_light.png) | ![](assets/screens/add_task_light.png) | ![](assets/screens/home_dark.png) |
4445
| --------------------------------------- |--------------------------------------- | ---------------------------------- | ---------------------------------- |
@@ -78,8 +79,9 @@ I do not aim to implement advanced features beyond what is supported by the Goog
7879

7980
## 🛠️ Tech stack
8081

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/).
82+
- [Kotlin](https://kotlinlang.org/), [Multiplatform (aka KMP)](https://kotlinlang.org/docs/multiplatform.html)
83+
- Android and Desktop are fully supported.
84+
- iOS wasn't initially planned, but a draft version is available (use it at your own risks, there might be dragons 🐉).
8385
- Web is not planned any time soon (contribution are welcome 🤝)
8486
- [Kotlin coroutines](https://kotlinlang.org/docs/reference/coroutines/coroutines-guide.html)
8587
- [Ktor client](https://ktor.io/) (+ [Kotlinx serialization](https://kotlinlang.org/docs/serialization.html))
@@ -125,32 +127,13 @@ I do not aim to implement advanced features beyond what is supported by the Goog
125127
- The Desktop application (thin layer fully reusing `:tasks-app-shared`)
126128
- [`:tasks-app-android`](tasks-app-android) <span style="color: #66FF00;">■■■■■■■■</span>□□ 80%
127129
- The Android application (thin layer fully reusing `:tasks-app-shared`)
130+
- [`:tasks-app-ios/Taskfolio`](tasks-app-ios/Taskfolio) <span style="color: #33FF00;">■■■■■■■■■</span>□ 90%
131+
- The iOS application (thin layer fully reusing `:tasks-app-shared`)
132+
- Xcode project, written in Swift
128133
- [`website/`](website) <span style="color: #00FF00;">■■■■■■■■■■</span> 100%
129134
- The [static site](https://opatry.github.io/taskfolio/) presenting the project
130135
- Made with [Jekyll](https://jekyllrb.com/) and served by [Github pages](https://pages.github.com/)
131136

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-
154137
## 🧑‍💻 Local development
155138

156139
<details>
@@ -187,6 +170,59 @@ When clicking on it, it will open a new window with the hot reload status.
187170
![](assets/compose-hot-reload-console.png)
188171
</details>
189172

173+
## 🍎 Build for iOS target
174+
175+
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.
176+
Feedback and contributions are welcome though 🤝.
177+
178+
<details>
179+
<summary>See details…</summary>
180+
181+
> [!NOTE]
182+
> 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.
183+
> You can enable it by setting `ios.target` Gradle property to `all`, `simulator` or `device` from either `local.properties` or CLI using `-P`.
184+
> When building from Xcode, it automatically sets `-Pios.target=simulator` based on `Config.xcconfig`.
185+
186+
You can build the `:tasks-app-shared` code for iOS using Gradle (to check if evertyhing compiles on Kotlin side):
187+
188+
```bash
189+
./gradlew tasks-app-shared:linkDebugFrameworkIosSimulatorArm64 -Pios.target=simulator
190+
```
191+
192+
For full XCFramework build (to be consumed by the iOS application), you'll have to rely on `xcodebuild` (or build directly from Xcode):
193+
194+
```bash
195+
cd tasks-app-ios
196+
IOS_TARGET=simulator xcodebuild -project Taskfolio.xcodeproj \
197+
-scheme Taskfolio \
198+
-sdk iphonesimulator \
199+
-arch arm64 \
200+
-configuration Debug \
201+
build \
202+
CODE_SIGNING_ALLOWED=NO \
203+
CODE_SIGN_IDENTITY="" \
204+
CODE_SIGNING_REQUIRED=NO
205+
```
206+
This triggers the `:tasks-app-shared:embedAndSignAppleFrameworkForXcode` Gradle task under the hood.
207+
208+
For Xcode integration, it's recommended to install the [Xcode Kotlin plugin](https://touchlab.co/xcodekotlin):
209+
210+
```bash
211+
brew install xcode-kotlin
212+
xcode-kotlin install
213+
```
214+
215+
When you update Xcode, you'll have to sync the plugin:
216+
217+
```bash
218+
xcode-kotlin sync
219+
```
220+
221+
If you want to debug the Kotlin code from Xcode, you'll have to add the needed source sets in Xcode:
222+
Add Group > Add folders as **reference** > `tasks-app-shared/{commonMain,iosMain}` (or any other module you want to debug).
223+
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.
224+
</details>
225+
190226
## ⚖️ License
191227

192228
```

0 commit comments

Comments
 (0)