kmongo icon indicating copy to clipboard operation
kmongo copied to clipboard

Consider migrating to gradle and adding support for Kotlin-Multiplatform

Open saied89 opened this issue 7 years ago • 12 comments

Its really great that you've extracted Kmongo-Id so that it could be used in common modules. I tried to adapt it for Kotlin multi-platform but it can't be done because multi-platform is only supported on Gradle.

Please consider migrating to gradle and adding support for multi-platform.

saied89 avatar Oct 30 '18 09:10 saied89

@zigzago I can help with that, I just wonder if we don't want to merge "*-tests" modules to follow standard gradle structure. WDYT?

dwlizlo avatar Jun 10 '20 22:06 dwlizlo

@dwlizlo the -tests modules are not in a /test test source folder because they need to be launched by more than one module.

For example, kmongo-core-tests tests are used by kmongo, kmongo-native & kmongo-serialization modules - the same tests are checked for different mapping engines.

I don't know what is the best way to configure this behaviour with gradle, but if there is a more elegant solution, I'm ok with it ;)

zigzago avatar Jun 11 '20 11:06 zigzago

Separate -test modules and then importing them with testImplementation wouldn't work?

saied89 avatar Jun 15 '20 16:06 saied89

I am working on both going MPP (at least for the model not the implementation) and migration to Gradle. It would speed up the process a lot if I could talk with someone that explains to me the hierarchy of the project.

Maven and Gradle are similar but Gradle offers levels flexibility that could make the project better but requires decisions from someone who knows KMongo from inside out!

lamba92 avatar Oct 13 '20 20:10 lamba92

all sub modules are here: https://github.com/Litote/kmongo/blob/master/pom.xml#L31

  • kmongo uses kmongo-core (mongo sync driver extensions) & kmongo-jackson-mapping dependencies

  • kmongo-native uses kmongo-core & kmongo-native-mapping

  • kmongo-serialization uses kmongo-core & kmongo-serialization-mapping

  • kmongo-coroutine uses kmongo-coroutine-core & kmongo-jackson-mapping dependencies

  • kmongo-coroutine-native uses kmongo-coroutine-core & kmongo-native-mapping dependencies

  • etc.

tests are shared between mapping engines.

For example,

  • kmongo tests uses kmongo-core-tests & kmongo-jackson-mapping

  • kmongo-native tests uses uses kmongo-core-tests & kmongo-native-mapping

  • kmongo-coroutine-serialization tests uses kmongo-coroutine-core-tests & kmongo-serialization-mapping

  • etc.

JUnit Category (https://dzone.com/articles/grouping-tests-using-junit) are used for tests that are dedicated to specific engine - for example SerializationMappingCategory for kotlinx.serialization (https://github.com/Litote/kmongo/blob/master/kmongo-serialization/pom.xml#L57)

HTH and if you have any questions, please ask ;)

zigzago avatar Oct 14 '20 19:10 zigzago

Any progress on this? I'm also working on a KMM project and would love to use this.

lammertw avatar Dec 21 '20 18:12 lammertw

I was very busy during the last 2 months with university. Today I finally graduated 🎉🎊 I'll try to look into it during holidays 🎄🎄

lamba92 avatar Dec 22 '20 00:12 lamba92

I would also love to see this, anyone managed a work around?

Atm I am overriding my base serializable classes from commonsMain in jvmMain to include the _id property. However, this means I can no longer make the base classes data classes.

dosier avatar May 25 '21 10:05 dosier

The issue is approaching it's 3yr birthday slowly. Are there any plans to fix this?

fsmorygo avatar Jun 11 '21 22:06 fsmorygo

I will implement it for 4.3.0

zigzago avatar Jun 19 '21 08:06 zigzago

Any news ?

jonathanoff2022 avatar Feb 11 '23 14:02 jonathanoff2022

Yes! This is planned for the inclusion in mongo github repository :)

zigzago avatar Feb 13 '23 19:02 zigzago