shared-hn-android-ios-backend
A sample of Android app, iOs app, and backend that share some common code via Kotlin Multiplatform
This is a sample project used in the talk "And that, folks, is how we shared code between Android, iOS and the Backend" that shows the capabilities of Kotlin Multiplatform
hn-foundation
This is a Kotlin Multiplatform library that it's shared between Android, iOs, and the Backend. For Android and the backend, the library is distributed using a local Maven repository. For iOs instead, the library is distributed using a CocoaPod repository hosted on GitHub.
Publish artifacts for Android and Backend
./gradlew publishToMavenLocal
Publish Debug iOs Framework
./gradlew publishDevFramework
Publish Release iOs Framework
./gradlew publishFramework
N.B. if you want to publish to a different CocoaPod repo, you must have a folder organized like that (where the hn-foundation-cocoa is the repo that contains the framework):
.
├── hn-foundation-cocoa
└── shared-hn-android-ios-backend
├── hn-android-client
├── hn-backend
├── hn-foundation
└── hn-ios-client
If you change the location, remember to customize the path declared in the task on the build.gradle.kts file
hn-backend
After publishing the artifacts to the local Maven repository you can start the backend on your machine.
hn-android-client
After publishing the artifacts to the local Maven repository and after starting the backend, you can try the android app. Remember to change the base address of the backend here
hn-ios-client
You should be able to try the iOs app as is since I've published the Pods. Of course, you can create your CocoaPod repository and try yourself the publishing process. Remember to change the base address of the backend here.