Skip to content
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

♻️ Convert the Domain module to a KMP module #521

Merged
merged 29 commits into from
Aug 3, 2023

Conversation

igorescodro
Copy link
Owner

The first step to convert Alkaa to Kotlin Multiplatform Mobile! The domain layer is already a Kotlin-only module, which make the process much easier.

@igorescodro igorescodro force-pushed the amm/domain branch 2 times, most recently from 07f1333 to 6a7db6b Compare July 21, 2023 13:31
@igorescodro igorescodro force-pushed the amm/domain branch 2 times, most recently from 8026dbe to 1ff1b99 Compare August 1, 2023 14:57
@igorescodro igorescodro changed the title Convert the Domain module to a KMM module Convert the Domain module to a KMP module Aug 1, 2023
igorescodro and others added 15 commits August 1, 2023 15:30
Update dependency io.insert-koin:koin-androidx-compose to v3.4.6
Fix the `packagingOptions` and `textFieldColors` deprecations
Update dependency io.insert-koin:koin-core to v3.4.3
A new `shared` module was create to hold all the shared logic between
the different mobile platforms. Future changes will make the `shared`
module the new `domain` if possible.

Since the `:domain` module is already Kotlin-only, the code was simply
moved and works!
Moved the dependencies from the Kotlin-only to the Kotlin Multiplatform
Mobile one
For some reason, Kotlin-only modules do not find the KMM modules. This
module was temporarily converted to Android to make the code work. In
the future, this module will also be a KMM one.
Small back-and-forth to convert the `shared` to the old `domain`. Now
that everything is set, the module was updated to the original name.
Oopsy, I removed the tests when moving the class between the modules.
The classes are now back and removed the junit dependencies since it
doesn't work well with KMM.
Removing Java's Calendar and adapting the logging tool to its
multiplatform version. Some work was needed for the convertions since
the Android layers will keep using Calendar for now. Future commits will
address the TODOs and make it more clear.
Fix the logging system in the remaining use cases and also some oopsies
along the way.
All the domain tests are working fine again all the Calendar/DateTime
migration
A few lint complaints
Instrumented tests fixed
When renaming the module from "shared" to "domain", one property was
missed. Updated!
When migrating to KMM, the checkers were removed from the Gradle script.
The quality plugin was re-added and the lint fixes updated.
Now that everything is set on the correct KMM directory, no need to keep
this folder anymore.
When running the Android Test task, KMP requires the minimum SDK to 30
to allow space in the test names. Another solution is to remove the
spaces and use simple names. The following regex was used to make the
job easier:

\s+(?=(?:(?:[^`]*`){2})*[^`]*`[^`]*$)
The Instant API requires min SDK 26, so we can't use the emulator on 24
anymore
Previously, some versions were inside the Version Catalog TOML and
others were in the AlkaaVersions file. Since the versioning and
compiling will be even more important now that we will compile with KMP,
all the versions are centralized in a single place.

Also, the VersionCatalogExtensions was broken in several classes to make
it easier to understand. They are: Bundles, Libraries and Versions.
@igorescodro igorescodro merged commit 2c8cffc into alkaa-multiplatform Aug 3, 2023
3 of 4 checks passed
@igorescodro igorescodro deleted the amm/domain branch August 3, 2023 12:52
@igorescodro igorescodro changed the title Convert the Domain module to a KMP module ♻️ Convert the Domain module to a KMP module Aug 28, 2023
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.

None yet

1 participant