mcarleio / konvert

This kotlin compiler plugin is using KSP API and generates kotlin code to map one class to another
https://mcarleio.github.io/konvert/
Apache License 2.0
93 stars 8 forks source link

feat: directly use interface implementations instead of requiring jvm reflection during runtime #33

Closed mcarleio closed 10 months ago

mcarleio commented 10 months ago

As Konvert aims to support KMP (kotlin multiplatform), the need for reflection during runtime needed to be removed.

This commit changes the current behavior, as the generated code will NOT use Konverter.get<YourMappingInterface>() anymore for accessing @Konverter annotated interfaces. Instead, the generated code will directly access the generated implementation (YourMappingInterfaceImpl).

For compatibility, the old behavior can be configured via the option konvert.konverter.use-reflection with value true.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (0d71146) 84.28% compared to head (3d40c1d) 85.03%.

Files Patch % Lines
.../processor/konvertfrom/KonvertFromDataCollector.kt 27.27% 0 Missing and 8 partials :warning:
...arle/konvert/processor/GeneratedKonverterLoader.kt 66.66% 1 Missing and 1 partial :warning:
...onvert/processor/konvert/KonverterDataCollector.kt 85.71% 0 Missing and 1 partial :warning:
...vert/processor/konvertto/KonvertToDataCollector.kt 50.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #33 +/- ## ========================================== + Coverage 84.28% 85.03% +0.74% ========================================== Files 68 68 Lines 2304 2312 +8 Branches 307 317 +10 ========================================== + Hits 1942 1966 +24 + Misses 185 172 -13 + Partials 177 174 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.