Skip to content

Migrate to kmp#56

Merged
nasrabadiAM merged 30 commits into
mainfrom
migrate-to-kmp
May 25, 2025
Merged

Migrate to kmp#56
nasrabadiAM merged 30 commits into
mainfrom
migrate-to-kmp

Conversation

@nasrabadiAM

@nasrabadiAM nasrabadiAM commented May 2, 2025

Copy link
Copy Markdown
Owner

Summary by Sourcery

Migrate the project to Kotlin Multiplatform (KMP), adding support for both Android and iOS platforms (Resolved #15)

New Features:

  • Added iOS application support
  • Added wasm application support for browsers
  • Added desktop application support on jvm
  • Created a shared Kotlin Multiplatform module

Enhancements:

  • Restructured project to support multiplatform development
  • Updated Gradle and dependency versions

Chores:

  • Renamed Android app module to androidApp
  • Updated project configuration to support KMP

@sourcery-ai

sourcery-ai Bot commented May 2, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This pull request migrates the project to Kotlin Multiplatform (KMP) by restructuring modules, updating Gradle configurations, and adding initial shared code and an iOS application.

File-Level Changes

Change Details Files
Updated Gradle configuration for KMP.
  • Upgraded AGP, Kotlin, and Gradle versions.
  • Added Kotlin Multiplatform, Android Library plugins.
  • Added kotlin-test dependency.
gradle/libs.versions.toml
build.gradle.kts
gradle/wrapper/gradle-wrapper.properties
Restructured project modules for KMP.
  • Renamed the app module to androidApp.
  • Created a new shared module for KMP code, configured for Android and iOS targets.
  • Created a basic iosApp module with Xcode project files.
  • Updated settings.gradle.kts to include androidApp and shared.
  • Added shared module dependency to androidApp.
settings.gradle.kts
app/build.gradle.kts
androidApp/build.gradle.kts
shared/build.gradle.kts
iosApp/iosApp.xcodeproj/project.pbxproj
iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Added initial shared KMP code structure.
  • Introduced Platform expect/actual interface.
  • Implemented Platform for Android and iOS.
  • Added a Greeting class utilizing the Platform interface.
shared/src/commonMain/kotlin/me/nasrabadiam/tictactoe/Greeting.kt
shared/src/commonMain/kotlin/me/nasrabadiam/tictactoe/Platform.kt
shared/src/androidMain/kotlin/me/nasrabadiam/tictactoe/AndroidPlatform.kt
shared/src/iosMain/kotlin/me/nasrabadiam/tictactoe/IOSPlatform.kt
Added basic iOS application structure.
  • Added default SwiftUI ContentView and App.
  • Included template UI and unit tests.
  • Added necessary asset catalogs and configuration files.
iosApp/iosApp/ContentView.swift
iosApp/iosApp/iosAppApp.swift
iosApp/iosAppTests/iosAppTests.swift
iosApp/iosAppUITests/iosAppUITests.swift
iosApp/iosAppUITests/iosAppUITestsLaunchTests.swift
iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json
iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json
iosApp/iosApp/Assets.xcassets/Contents.json
iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json
iosApp/iosApp.xcodeproj/xcuserdata/ali.xcuserdatad/xcschemes/xcschememanagement.plist
Updated Detekt configuration.
  • Changed the rootPackage value.
detekt.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @nasrabadiAM - I've reviewed your changes - here's some feedback:

  • Consider moving existing platform-agnostic logic from androidApp to the shared module in this PR. ✅
  • Clarify the intended scope of the newly added iosApp within this migration PR. ✅
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nasrabadiAM

nasrabadiAM commented May 15, 2025

Copy link
Copy Markdown
Owner Author

Known issues:

  • wasmJsBrowser platform has runtime exception due to window-size-class library. added in 57fb475 ✅ Fixed by updating libraries.
  • desktop variant fails when runnig with error: Caused by: org.jetbrains.skiko.LibraryLoadException: Cannot find libskiko-macos-arm64.dylib.sha256, proper native dependency missing. ✅ Fixed by updating libraries.

@nasrabadiAM

nasrabadiAM commented May 17, 2025

Copy link
Copy Markdown
Owner Author
  • Add basic UI tests for IOS, desktop, wasm to ensure all platforms build and run successfully.
  • Move all compose multiplatform tests to shared module, and run on each platform with github actions(more).
  • Update Github actions to run all UI tests on CI.
  • Fix UI adaptiveness on different platforms(There are some known accessibility issues) -> it will be resolved in Fix Adaptive screen issues #57

@nasrabadiAM nasrabadiAM merged commit 1797fba into main May 25, 2025
4 checks passed
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.

Make app multiplatform with jetpack compose

1 participant