Commit Graph

186 Commits

Author SHA1 Message Date
Leonid Startsev 477c668c80 Promote most deprecations in kotlinx-metadata-jvm to ERROR
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
2023-11-17 16:23:34 +00:00
Mikhail Glukhikh f90831398c K2: temporarily comment unstable part of FlagDelegatesTest.testDelegation
Related to KT-62581
2023-10-25 20:19:39 +00:00
Mikhail Glukhikh d42ae35624 K2: support DELEGATION member kind for properties #KT-62581 Fixed 2023-10-25 20:19:39 +00:00
Mikhail Glukhikh 19bf11f041 FlagDelegatesTest: accept K2 behavior for KT-62582 2023-10-25 20:19:39 +00:00
Dmitriy Novozhilov ef3d3a9724 [Metadata] Update tests according to KT-62580, KT-62581 and KT-62582 2023-10-18 07:59:27 +00:00
Dmitriy Novozhilov 6114e4f068 Fix compilation problems caused by migration to 2.0 2023-10-18 07:59:27 +00:00
Alexander.Likhachev 357d12fc8e [Build] Move JUnit dependencies into the version catalog
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
2023-09-06 22:47:33 +00:00
Leonid Startsev 6e4d033f89 Promote deprecation on Flags API to ERROR
#KT-59440
2023-08-23 16:47:05 +00:00
Leonid Startsev 8b821e1feb Deprecate KmProperty.hasGetter(hasSetter) in favor of KmProperty.getter(setter)
as a follow-up of flag deprecation.

#KT-59440
2023-08-14 12:36:34 +00:00
Leonid Startsev f450122d63 Refactor MetadataExtensions.kt to remove extension visitors
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
2023-08-09 10:16:27 +00:00
Leonid Startsev b8e4b44b04 Promote DeprecationLevel on Visitors API to ERROR
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
2023-08-09 10:16:27 +00:00
Leonid Startsev a17cdfe338 Fix obsolete information in kotlinx-metadata-jvm ReadMe.md 2023-07-17 16:17:03 +00:00
Leonid Startsev 7c1c01156f Add missing delegation in KmDeclarationContainerVisitor.visitExtensions for consistency 2023-07-17 11:04:18 +00:00
Leonid Startsev 20368a9e40 Enable explicit API mode for kotlinx-metadata(-jvm)
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
2023-07-17 11:04:18 +00:00
Leonid Startsev 5424c54fae Make changelog and migration guide for kotlinx-metadata-jvm:0.7.0 2023-07-11 15:56:07 +00:00
Leonid Startsev 0a573a803d Update and clarify documentation for kotlinx-metadata-jvm attributes:
- Review fixes
- Clarify KmClass.isData and enhance nodes documentaiton to mention extensions
2023-06-27 15:12:46 +00:00
Leonid Startsev b15da7c63a Deprecate old kotlinx-metadata flags API:
Flag, Flag constants, Flags typealias, flagsOf() function, and
Flag accessors in nodes (such as KmClass.flags, KmClass.jvmFlags, KmProperty.setterFlags, etc)

#KT-59440
2023-06-27 15:12:46 +00:00
Leonid Startsev 1a1cbcb321 Rework flags in kotlinx.metadata:
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
2023-06-27 15:12:46 +00:00
Leonid Startsev 3933242340 Deprecate KmModule.annotations because it is unused and always empty.
It used to store state of `-Xexperimental` Kotlin compilation flag,
but this feature was removed long ago.

#KT-59366 Fixed
2023-06-19 17:54:18 +00:00
Leonid Startsev b919a12274 Restructure KotlinClass(Module)Metadata.write/read:
- 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
2023-06-19 17:54:18 +00:00
Leonid Startsev 29b6595cfc Start file names with a capital letter according to codestyle
No ABI changes are introduced because file facades are automatically capitalized anyway.
2023-06-13 16:44:13 +00:00
Leonid Startsev 98f7ac044c Add Dokka configuration to kotlinx-metadata-jvm 2023-06-13 12:56:03 +00:00
Leonid Startsev 654874e30f Enhance kotlinx-metadata-jvm KDoc: add missing documentation, apply Grazie suggestions 2023-06-13 12:56:03 +00:00
Leonid Startsev 5088c9370d Add missing deprecation for KmExtensionType and experimentality for KmConstantValue 2023-06-13 12:56:03 +00:00
Leonid Startsev 0cfe2b04f5 Move KmModuleFragment to an internal.common package
because it is klib-related and can be read only with KotlinCommonMetadata.
2023-06-08 17:53:31 +00:00
Leonid Startsev c3d363d1b8 Throw exception instead of returning null from KotlinClass(Module)Metadata.read() 2023-06-08 17:53:31 +00:00
Leonid Startsev 1c629e748f Add JvmStatic + JvmOverloads to writing functions in KotlinClassMetadata
and KotlinModuleMetadata for easier use from Java.
2023-06-08 17:53:31 +00:00
Leonid Startsev 70739df0ad Improve toString() for KmAnnotationArgument 2023-06-08 17:53:31 +00:00
Leonid Startsev a0819e4163 Make changelog for kotlinx-metadata-jvm 0.6.2 release
Note: actual release is done from a separate branch of 1.8.20 with proper fix
(4a9e6f7b2b458ea0ee524afb52f42f3e45dc9ad7)
2023-06-02 11:35:50 +00:00
Leonid Startsev 22096cec3c Make changelog for kotlinx-metadata-jvm 0.6.1 release
Note: actual release is done from 1.8.20 branch (commit 0043ae4390c8555b03428a014b660f395b924695)
2023-05-30 14:27:45 +02:00
Dmitriy Novozhilov 1422654470 [Build] Update version of binary-compatibility-validator to 0.13.0
0.12.0 was incompatible with kotlinx.metadata:0.6.0
2023-02-18 13:26:53 +00:00
Leonid Startsev 4b524b8589 Document that read/write methods may throw IAE and make sure this is true:
- Replace !! with requireNotNull()
- Add try/catch to wrap all other exceptions (mainly protobuf parser ones)
- Add tests for malformed input for both read and write
- Hide InconsistentMetadataException from public API
- Replace its external usages with IllegalArgumentException
2023-02-15 11:21:43 +00:00
Leonid Startsev 64838d5ec9 Extract separate ArrayKClassValue from KClassValue
Remove `data` from KmAnnotation
2023-02-15 11:21:43 +00:00
Leonid Startsev 5999c2b324 Enhance documentation for KotlinClassMetadata 2023-01-24 11:07:45 +00:00
Leonid Startsev f327d68fe0 Refactor JvmMemberSignature:
- Deprecate asString() in favor of toString()
- Rename desc to descriptor with deprecation
2023-01-24 11:07:43 +00:00
Leonid Startsev 0fcb4c3fb0 Document @ExperimentalContextReceivers 2023-01-24 11:07:43 +00:00
Leonid Startsev 1828e293ea Provide @UnstableMetadataApi and mark kotlin_module related API with it,
as it is not finished yet.
2023-01-24 11:07:42 +00:00
Leonid Startsev 165e779e3e Change extension properties on ClassName into functions, to be more distinct from other String extensions. 2023-01-24 11:07:42 +00:00
Roman Efremov 2dc3871954 Add "hasEnumEntries" class flag to kotlinx-metadata
^KT-53929 Fixed
2023-01-23 12:53:06 +01:00
Mikhail Glukhikh cbedbda527 Enhance API/messages around BinaryVersion / JvmMetadataVersion 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh 0c4a0360ac Deserialization/class reading: pass chosen JvmMetadataVersion whenever possible 2023-01-16 18:16:07 +01:00
Leonid Startsev d646906437 New kotlinx-metadata-jvm release
Update changelog for kotlinx-metadata-jvm 0.6.0, add migration guide, and actualize ReadMe.md

Document releasing process

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>

Merge-request: KT-MR-8206
Merged-by: Leonid Startsev <leonid.startsev@jetbrains.com>
2023-01-10 12:25:38 +00:00
Vyacheslav Gerasimov 1fa7c7119b Build: Fix caching of some ShadowJar tasks in the project
To be cacheable relocated shadow jars should not include manifest with
build number. Instead, we repack relocated shadow jar in default jar
task with proper manifest.
2023-01-04 16:31:48 +00:00
Leonid Startsev 4bf6322dd7 Change signature of KmType.visitExtensions — it should return TypeExtensionVisitor, not TypeExtension. 2022-11-28 11:01:57 +00:00
Leonid Startsev 1afe0b9cd0 Change kotlinx.metadata.impl package to kotlinx.metadata.internal
Same with kotlinx.metadata.jvm.impl package
2022-11-28 11:01:57 +00:00
Leonid Startsev 2aede50306 Update BCV to 0.12.0; use JAR dump mode for kotlinx-metadata-jvm and
therefore remove BCV from kotlinx-metadata project.

Introduce @IgnoreInApiDump to workaround issue#104 in BCV.
2022-11-10 13:30:12 +00:00
Leonid Startsev 2b2e749d1f Rename KotlinClassMetadata.header to annotationData 2022-11-10 13:30:11 +00:00
Leonid Startsev b974b283a3 Lower deprecation notice for KotlinClassHeader and improve migration path 2022-11-10 13:30:11 +00:00
Leonid Startsev 96279364de Rework Binary Compatibility Validator integration:
- Add BCV to root project to commonize version

- Remove BCV from kotlinx-metadata-klib as it is not necessary for now

- Remove obsolete entry from kotlinx-metadata apiDump

- Add dependency from :kotlinx-metadata-jvm:check to :kotlinx-metadata:check so TC build can verify integrity of API dumps in both projects
2022-11-10 13:30:11 +00:00
Leonid Startsev 21d2211dcd Fix various review comments: rephrase deprecations, update KDocs,
remove unnecessary deprecations and unused functions.
2022-11-10 13:30:10 +00:00