Skip to content

KMP migration #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

Conversation

yigitozgumus
Copy link
Member

This MR partially completes the KMP migration. Build logic and publishing logic will follow.

- Kotlin to 2.1.10
- AGP to 8.7.3
- Hilt to 2.55
- Add compile, target and minSDK to libs.versions.toml
…lugins

- Kotlin Multiplatfrom will be used to create KMP project
- Compose Multiplatform will be used for creating Compose Multiplatform
samples
- Android Library must be applied to target library for android
Root `build.gradle.kts` file is a place where we declare but not apply
the plugins we want to use inside the project. Declaring here allows us
to apply plugins to any/all submodules-projects.
- Defined the module on settings.gradle.kts
- Added kotlin multiplatform and compose multiplatform plugins
- Added android.application and compose.compiler plugins
- Migrated sample app code to new cmp sample
- Refactored Hilt code for DI to Koin
- Added swing dependency
- Build Failure due to forgotton android code
…ndroid platforms

- This approach helps us to use kmp compatible code between different
platforms.
- We first start with declaring a target for the `transmission` and
`transmission-test` libraries. These will set up the library usage for
ios targets in the future. For the sample app, we similarly need to
define the targets we want to show this app to. So we add ios related
targets.
- For the sample, we want to use the whole sample code in iOS, so we
bundle the app code into a Framework by creating a framework for each
native type.

- However, build now fails. Since we added new ios targets, our
  commonMain code is not truly Multiplatform. We need to replace java
  specific code
- We successfully created the iOS sample app. To be able to see our
framework code, we also added a build step to the iOS build phases. But
our build process still fails. - This error is specific to the
transmission Library. Normally creating generic types that don't change
doesn't create any issue but for KMP, it is a problem.
- We remove the Generic contract definitions from the `QueryHandler` and
`CheckpointHandler` interfaces. With this step, we can successfully
build the iOSApp using xCode and see the initially created Hello World
screen
- This final commit helps us migrate our Sample app to [[Compose
Multiplatform]]. We created `MainViewController` inside `iosMain`. Then
we created `UIViewControllerRepresentable` and on
`makeUiViewController`, we call the controller function we defined in
iosMain.- We also need to call the initKoin function to make DI setup
work- Lastly, we update info.plist for iOS simulator related error.
- Move the code
- Create the iOS app
- Bind the Framework code and add a ViewController
@yigitozgumus yigitozgumus changed the title Kmp migration KMP migration Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant