mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
Support new scheme of compilation of OptionalExpectation annotations
Instead of generating these annotation classes as package-private on JVM, serialize their metadata to the .kotlin_module file, and load it when compiling dependent multiplatform modules. The problem with generating them as package-private was that kotlin-stdlib for JVM would end up declaring symbols from other platforms, which would include some annotations from package kotlin.native. But using that package is discouraged by some tools because it has a Java keyword in its name. In particular, jlink refused to work with such artifact altogether (KT-21266). #KT-38652 Fixed
This commit is contained in:
committed by
Alexander Udalov
parent
63e355d979
commit
012ffa2993
@@ -8,7 +8,6 @@ Cleaning output files:
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/pJvm/FKt.class
|
||||
out/production/pJvm/SharedImmutable.class
|
||||
End of files
|
||||
Compiling files:
|
||||
c/src/f.kt
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
c [sourceSetHolder]
|
||||
|
||||
pJvm [compilationAndSourceSetHolder, jvm]
|
||||
pJvm -> c [include]
|
||||
|
||||
pJs [compilationAndSourceSetHolder, js]
|
||||
pJs -> c [include]
|
||||
@@ -0,0 +1,24 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Cleaning output files:
|
||||
out/production/pJs/pJs.js
|
||||
out/production/pJs/pJs.meta.js
|
||||
out/production/pJs/pJs/root-package.kjsm
|
||||
End of files
|
||||
Compiling files:
|
||||
c/src/usage.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
Building pJvm
|
||||
Cleaning output files:
|
||||
out/production/pJvm/META-INF/pJvm.kotlin_module
|
||||
out/production/pJvm/Usage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
c/src/usage.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
@@ -0,0 +1,3 @@
|
||||
@OptIn(ExperimentalMultiplatform::class)
|
||||
@OptionalExpectation
|
||||
expect annotation class Optional(val value: String)
|
||||
@@ -0,0 +1,2 @@
|
||||
@Optional("1")
|
||||
class Usage
|
||||
@@ -0,0 +1,2 @@
|
||||
@Optional("2")
|
||||
class Usage
|
||||
Reference in New Issue
Block a user