Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition
Abstract:
After discovering a new interesting technology or framework, you will probably start asking yourself how to integrate it into an existing project. That's because, the possibility of starting with a blank canvas is rare (not impossible, but rare).This is also the case for Kotlin Multiplatform, which is getting more and more hype every day. And now, that the technology has become stable, it's the perfect time to start using it! In this hands-on session, we will start with an existing Android and iOS application that "lives" in separate repositories, we will extract the business logic from the Android app and share it between the two apps with a Kotlin Multiplatform library. We will also cover how to distribute the library to the existing applications. By the end of this workshop, you'll have a better understanding of what is needed to start using Kotlin Multiplatform in your existing projects.
Slides:
Video
Workshop material
The GitHub project contains a start folder with an initial workspace for the workshop:
and an end folder with two final workspaces: one that “manually” deploys the KMP library on GitHub and one that it deploys it with KMMBridge.
Resources:
Publishing Java packages with Gradle
https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-gradleGradle Maven deploy failing with 422 Unprocessable Entity #26328
https://github.com/orgs/community/discussions/26328#discussioncomment-3251485How to allow unauthorised read access to GitHub packages maven repository? #26634
https://github.com/orgs/community/discussions/26634Creating a multiplatform binary framework bundle
https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundleBinary Frameworks in Swift
https://developer.apple.com/videos/play/wwdc2019/416/Binary Frameworks in Swift
https://devstreaming-cdn.apple.com/videos/wwdc/2019/416h8485aty341c2/416/416_binary_frameworks_in_swift.pdfBuild final native binaries
https://kotlinlang.org/docs/multiplatform-build-native-binaries.html#build-xcframeworksDistributing binary frameworks as Swift packages
https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packagesKMP-NativeCoroutines
https://github.com/rickclephas/KMP-NativeCoroutinesSKIE Migration Guide
https://touchlab.co/skie-migration?ti=4B0F129C5D944E54B60B31FE35Interoperability with Swift/Objective-C
https://kotlinlang.org/docs/native-objc-interop.html - Kotlin/Native as an Apple framework
https://kotlinlang.org/docs/apple-framework.htmlKotlin-Swift interopedia
https://github.com/kotlin-hands-on/kotlin-swift-interopediaWriting Swift-friendly Kotlin Multiplatform APIs
https://medium.com/@aoriani/list/writing-swiftfriendly-kotlin-multiplatform-apis-c51c2b317fceDependency Management in iOS
https://blog.devgenius.io/dependancy-management-for-ios-27dd681d7ea0multiplatform-swiftpackage
https://github.com/luca992/multiplatform-swiftpackageKMMBridge
https://touchlab.co/kmmbridge/KMMBridge Quick Start
https://touchlab.co/kmmbridge/spmquickstartXcode 13.3 supports SPM binary dependency in private GitHub release
https://medium.com/geekculture/xcode-13-3-supports-spm-binary-dependency-in-private-github-release-8d60a47d5e45Xcode Kotlin - Xcode support for Kotlin browsing and debugging
https://touchlab.co/xcodekotlinSwift package export setup
https://kotlinlang.org/docs/native-spm.htmlSwift Export Sample
https://github.com/Kotlin/swift-export-sampleSwift Export doc https://github.com/JetBrains/kotlin/tree/master/docs/swift-export