https://kotlinlang.org logo
e

eygraber

05/16/2022, 4:19 PM
What determines the value of
isCompatibilityMetadataVariantEnabled
in
kotlin-tooling-metadata.json
? I'm seeing it set to
true
in all of the dependencies that I use (e.g. coroutines), except for a library that I publish (e.g. portal), where it is
false
.
r

russhwolf

05/16/2022, 4:38 PM
Oh I forgot to ask about that in the call earlier. The default for the related gradle parameter apparently changed in 1.6.20 but I'm not clear on whether it's still relevant or not
In the early hmpp days it was a way to make sure you're compatible with consumers regardless of whether they have hmpp enabled.
k

kpgalligan

05/16/2022, 5:13 PM
I added it into Kermit because somebody was having issues digesting the dependency: https://github.com/touchlab/Kermit/blob/e69d519009601789fea5bed85063848e82721499/gradle.properties#L47
I’m still pretty confused by the various versions and what is/isn’t needed, but it did seem to solve that person’s issue.
s

Sebastian Sellmair [JB]

05/17/2022, 7:53 AM
isCompatibilityMetadataVariantEnabled will determine if a HMPP (1.6.20+) library will support non hmpp consumers for tooling. As explained in the last meeting: In hmpp, every source set gets compiled into a ‘metadata klib’ and then published. Those artifacts can only be read by projects also using hmpp! Pre-HMPP multiplatform uses a
.koltin_metadata
format, which is becoming obsolete! A library with this setting enabled will still support projects that did not enable (or explicitly disable HMPP!
e

eygraber

05/17/2022, 8:27 AM
Is there any harm in keeping it enabled in libraries that have already upgraded to 1.6.21? So that consumers of the library aren't forced to enable HMPP (for whatever reason).
s

Sebastian Sellmair [JB]

05/17/2022, 8:28 AM
Feel free to choose enabling this in your libraries! There should not be a lot of harm done, but I am more than happy that this legacy mode is fading out ☺️
👍 1
e

eygraber

05/17/2022, 8:40 AM
If I have a project that has HMPP disabled, would
enableCompatibilityMetadataVariant
be needed so that project module dependencies work correctly?
s

Sebastian Sellmair [JB]

05/17/2022, 10:02 AM
No, iirc this property does not do anything when hmpp is disabled! For what reasons exactly did you have do disable hmpp on your end?
e

eygraber

05/17/2022, 2:05 PM
I don't have any use case, just curious about how it works 😅
k

kpgalligan

05/17/2022, 3:43 PM
There should not be a lot of harm done, but I am more than happy that this legacy mode is fading out
To clarify, it’s fading out because as people upgrade Kotlin to 1.6.20+ it goes away automatically? Also, is there zero harm, or like a bit of “harm” and what would that be?
11 Views