[KAPT4] KT-51982 Implement generation of @Metadata annotations in Java stubs

Also adds rendering of @Metadata annotations in Kapt3 and Kapt4 tests
(currently disabled for a few tests).

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
This commit is contained in:
strangepleasures
2023-07-31 23:09:08 +02:00
committed by Space Team
parent f40fc1b0c6
commit 2423b7b62f
250 changed files with 15438 additions and 81 deletions
@@ -1,3 +1,20 @@
/**
* public final class Test : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // field: foo:LTest$Companion$Example;
* private final val foo: Test.Companion.Example
* private final get
*
* // companion object: Companion
*
* // nested class: Companion
*
* // module name: main
* }
*/
@kotlin.Metadata()
public final class Test {
private final Test.Companion.Example foo;
@@ -8,6 +25,17 @@ public final class Test {
super();
}
/**
* public final companion object Test.Companion : kotlin/Any {
*
* // signature: <init>()V
* private constructor()
*
* // nested class: Example
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Companion {
@@ -15,6 +43,19 @@ public final class Test {
super();
}
/**
* public final enum class Test.Companion.Example : kotlin/Enum<Test.Companion.Example> {
*
* // signature: <init>(Ljava/lang/String;I)V
* private constructor()
*
* FOO,
*
* // module name: main
*
* // has Enum.entries
* }
*/
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;
@@ -28,6 +69,23 @@ public final class Test {
////////////////////
/**
* public final class Test2 : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // field: foo:LTest2$Amigo$Example;
* private final val foo: Test2.Amigo.Example
* private final get
*
* // companion object: Amigo
*
* // nested class: Amigo
*
* // module name: main
* }
*/
@kotlin.Metadata()
public final class Test2 {
private final Test2.Amigo.Example foo;
@@ -38,6 +96,17 @@ public final class Test2 {
super();
}
/**
* public final companion object Test2.Amigo : kotlin/Any {
*
* // signature: <init>()V
* private constructor()
*
* // nested class: Example
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Amigo {
@@ -45,6 +114,19 @@ public final class Test2 {
super();
}
/**
* public final enum class Test2.Amigo.Example : kotlin/Enum<Test2.Amigo.Example> {
*
* // signature: <init>(Ljava/lang/String;I)V
* private constructor()
*
* FOO,
*
* // module name: main
*
* // has Enum.entries
* }
*/
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;
@@ -58,6 +140,21 @@ public final class Test2 {
////////////////////
/**
* public final class Test3 : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // field: foo:LTest3$Amigo$Example;
* private final val foo: Test3.Amigo.Example
* private final get
*
* // nested class: Amigo
*
* // module name: main
* }
*/
@kotlin.Metadata()
public final class Test3 {
private final Test3.Amigo.Example foo = Test3.Amigo.Example.FOO;
@@ -66,6 +163,17 @@ public final class Test3 {
super();
}
/**
* public final object Test3.Amigo : kotlin/Any {
*
* // signature: <init>()V
* private constructor()
*
* // nested class: Example
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Amigo {
@org.jetbrains.annotations.NotNull()
@@ -75,6 +183,19 @@ public final class Test3 {
super();
}
/**
* public final enum class Test3.Amigo.Example : kotlin/Enum<Test3.Amigo.Example> {
*
* // signature: <init>(Ljava/lang/String;I)V
* private constructor()
*
* FOO,
*
* // module name: main
*
* // has Enum.entries
* }
*/
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;
@@ -88,6 +209,23 @@ public final class Test3 {
////////////////////
/**
* public final class Test4 : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // field: foo:I
* private final val foo: kotlin/Int (* = ... *)
* private final get
*
* // companion object: Companion
*
* // nested class: Companion
*
* // module name: main
* }
*/
@kotlin.Metadata()
public final class Test4 {
private final int foo = 1;
@@ -98,6 +236,17 @@ public final class Test4 {
super();
}
/**
* public final companion object Test4.Companion : kotlin/Any {
*
* // signature: <init>()V
* private constructor()
*
* // nested class: Foo
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Companion {
@@ -105,6 +254,19 @@ public final class Test4 {
super();
}
/**
* public final object Test4.Companion.Foo : kotlin/Any {
*
* // signature: <init>()V
* private constructor()
*
* // field: constProperty:I
* public final const val constProperty: kotlin/Int (* = ... *)
* public final get
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Foo {
@org.jetbrains.annotations.NotNull()
@@ -121,6 +283,21 @@ public final class Test4 {
////////////////////
/**
* public final class Test5 : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // field: foo:LTest5$Amigos$Companion$Goo$Example;
* private final val foo: Test5.Amigos.Companion.Goo.Example
* private final get
*
* // nested class: Amigos
*
* // module name: main
* }
*/
@kotlin.Metadata()
public final class Test5 {
private final Test5.Amigos.Companion.Goo.Example foo;
@@ -129,6 +306,19 @@ public final class Test5 {
super();
}
/**
* public final class Test5.Amigos : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // companion object: Companion
*
* // nested class: Companion
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Amigos {
@org.jetbrains.annotations.NotNull()
@@ -138,6 +328,17 @@ public final class Test5 {
super();
}
/**
* public final companion object Test5.Amigos.Companion : kotlin/Any {
*
* // signature: <init>()V
* private constructor()
*
* // nested class: Goo
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Companion {
@@ -145,6 +346,17 @@ public final class Test5 {
super();
}
/**
* public final class Test5.Amigos.Companion.Goo : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // nested class: Example
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class Goo {
@@ -152,6 +364,19 @@ public final class Test5 {
super();
}
/**
* public final enum class Test5.Amigos.Companion.Goo.Example : kotlin/Enum<Test5.Amigos.Companion.Goo.Example> {
*
* // signature: <init>(Ljava/lang/String;I)V
* private constructor()
*
* FOO,
*
* // module name: main
*
* // has Enum.entries
* }
*/
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;