Because `public JvmTypeExtensionVisitor` was removed, a new place for `const val PLATFORM_TYPE_ID`
is required. It is logical to place it as a some kind of constant for Km node;
however, because it is platform-specific, there is a need for an empty
`KmFlexibleTypeUpperBound.Companion` in metadata common sources
and `public val KmFlexibleTypeUpperBound.Companion.PLATFORM_TYPE_ID`
extension in kotlin-metadata-jvm sources.
See also: KT-63156
This includes APIs such as:
- Visitors API
- Obsolete KotlinClassMetadata reading and writing API
- Extension and extension visitors API
- Flags and `class Flag` (a reduced version of it was moved to test sources)
- Various utility methods
Extensions mechanism got reworked with the removal of public visitors; it is
completely internal now with special accessors in kotlinx.metadata.internal
package.
Since `var KmClass.flags` is internal now (instead of being deprecated), special
utility functions with the name `_flagAccess` were added to internal package
for testing purposes.
^KT-63156 Fixed
Change package, artifact group, artifact name, and Gradle module name to
kotlin-metadata and kotlin-metadata-jvm, respectively.
In Kotlin 2.0, kotlin-metadata-jvm library is promoted to stable, and is
a part of Kotlin distribution now.
Note that kotlinx-metadata-klib is left with org.jetbrains.kotlinx group, artifact name and package
because -klib part is considered not stable and for internal use. Since it is still published via Sonatype,
it should have kotlinx group. Therefore, it will have both classes from kotlin.metadata and kotlinx.metadata packages. This is not a problem, because we already had kotlinx.metadata split package between -jvm and -klib before.
#KT-63219 Fixed
for cases when the version requirement cannot be read correctly (missing from the table).
It usually happens when we read the inner class' old metadata, which stored everything
in the outer class' table.
Fixes #KT-60870
Merge-request: KT-MR-13337
Merged-by: Leonid Startsev <leonid.startsev@jetbrains.com>
It's going to be deprecated in Gradle 8.3
There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
Separate class allows encapsulating comparison, equality, and structure of version parts.
It also makes more sense from API standpoint than plain `IntArray`.
To make sure that the correct version and flags are preserved during metadata transformation,
they are now stored inside KotlinClassMetadata.
Such change also makes it possible to make write() a member function of KotlinClassMetadata, further simplifying API.
Also, it allows tracking whether readStrict or readLenient was used to read metadata and prohibit writing accordingly.
Also provide transform() method as a shortcut for readStrict+write.
Related to: #KT-59441
In strict mode, an exception will be thrown when inconsistent metadata is encountered. In lenient mode, the reader will attempt to handle the inconsistent metadata by ignoring certain inconsistencies. This is a solution to a problem of reading metadata 'from the future' that is not allowed by default, but desired in certain cases. See updated ReadMe for details.
Also fix problem with Strict Semantics flag.
#KT-57922 Fixed
#KT-59441 Fixed
because WARNING versions of them were already released at some point.
The following declarations were not promoted and have to be promoted later:
- KmProperty.hasGetter, .hasSetter
- Deprecations from readStrict/readLenient/write() rework
#KT-63157 In progress
The `kotlin-test` dependencies are left untouched as changing them affects publications, thus these versions are independent from the used inside our build
#KTI-1349 In Progress
This helps to completely get rid of Visitors API during reading and writing
of the JVM metadata.
Note: Klib writers still use .accept and left for future refactorings.
See also #KT-59442
Rewrite Readers.kt and Writers.kt to avoid using
Visitors API
Align KotlinCommonMetadata/KotlinModuleMetadata API with
KotlinClassMetadata one (it is necessary for restructured reading/writing)
#KT-59442 In Progress
Most of the declarations are made public as-is, except for some reader implementation details
and MetadataExtensions.INSTANCES.
Also added missing delegation in KmDeclarationContainerVisitor.visitExtensions
#KT-59182 Fixed
Flag, Flag constants, Flags typealias, flagsOf() function, and
Flag accessors in nodes (such as KmClass.flags, KmClass.jvmFlags, KmProperty.setterFlags, etc)
#KT-59440
Introduce extensions for KmNodes to work with various modifiers instead of old Flags.SOMETHING.invoke(flags).
Provide Visibility, Modality, and Kind enums.
Introduce KmPropertyAccessorAttributes to replace KmProperty.getterFlags and KmProperty.setterFlags.
Deprecate nodes constructors which take flags but not flags itself (yet).
Adapt KotlinP to changes.
#KT-59440 Fixed
- Write now returns result (Metadata or ByteArray) directly without re-wrapping it;
- annotationData/bytes is private to avoid unsoundness if external client corrupts it;
- .toXxx() do not throw exceptions anymore and deprecated. Exceptions are thrown only from read/write;
- Instead of toXxx(), properties like .kmClass should be used instead. They're initialized eagerly and return a view without copying.
- KotlinClassMetadata.Unknown is now a data object, as no useful information is exposed
#KT-59365 Fixed